How does one assign an image in place of a simple button in ruby/rails? For instance, my submit tag for searching looks like: <%= form_tag :action =>''search'', :controller => ''search'' %> <%= text_field_with_auto_complete :product, :title %> <%= submit_tag "Go" %> <%= end_form_tag %> And it works fine but looks a little ugly. I''d like to replace the ''Go'' with an image of a magnifying glass or something. What''s the best way to do that? Thanks.. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
you can supply an id to the submit tag and use an image to replace the button. .....This would make a great helper if someone wrote a little code to automtically add the image as a button if supplied! On 9/28/06, Vince W. <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > How does one assign an image in place of a simple button in ruby/rails? > For instance, my submit tag for searching looks like: > > <%= form_tag :action =>''search'', :controller => ''search'' %> > <%= text_field_with_auto_complete :product, :title %> > <%= submit_tag "Go" %> > <%= end_form_tag %> > > And it works fine but looks a little ugly. I''d like to replace the ''Go'' > with an image of a magnifying glass or something. What''s the best way > to do that? > > Thanks.. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
image_submit_tag http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000503 c. Vince W. wrote:> How does one assign an image in place of a simple button in ruby/rails? > For instance, my submit tag for searching looks like: > > <%= form_tag :action =>''search'', :controller => ''search'' %> > <%= text_field_with_auto_complete :product, :title %> > <%= submit_tag "Go" %> > <%= end_form_tag %> > > And it works fine but looks a little ugly. I''d like to replace the ''Go'' > with an image of a magnifying glass or something. What''s the best way > to do that? > > Thanks..-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---