diff --git a/app/helpers/outfits_helper.rb b/app/helpers/outfits_helper.rb index f3f530ee..a2ef35bb 100644 --- a/app/helpers/outfits_helper.rb +++ b/app/helpers/outfits_helper.rb @@ -8,7 +8,8 @@ module OutfitsHelper options_from_collection_for_select(collection, :id, :human_name, value) end - def pet_name_tag - text_field_tag 'name', nil, :spellcheck => false, :id => nil + def pet_name_tag(options={}) + options = {:spellcheck => false, :id => nil}.merge(options) + text_field_tag 'name', nil, options end end diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index 807f7b8c..710e74c4 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -1,6 +1,6 @@ #outfit-forms #pet-preview - = image_tag 'default_preview.png' + = image_tag 'default_preview.png', :alt => '' %span %h1 Dress to Impress %h2 Neopets wearables made easy! @@ -9,7 +9,7 @@ = destination_tag 'wardrobe' %fieldset %legend Enter your pet's name - = pet_name_tag + = pet_name_tag :id => 'main-pet-name' %button{:type => "submit"} Plan my outfit! = form_tag wardrobe_path, :method => 'get', :id => 'start-from-scratch' do diff --git a/public/javascripts/outfits/new.js b/public/javascripts/outfits/new.js index dfe369fc..f06b1321 100644 --- a/public/javascripts/outfits/new.js +++ b/public/javascripts/outfits/new.js @@ -3,7 +3,7 @@ var preview_el = $('#pet-preview'), img_el = preview_el.find('img'), response_el = preview_el.find('span'), - name_el = $('#name'); + name_el = $('#main-pet-name'); preview_el.click(function () { name_el.val(Preview.Job.current.name).closest('form').submit();