Hi: does button_to_function allow the use of an image? I tried it in place of the text with "image_tag" and it doesn''t work. Maybe some form of button_to? Any direction you can give would be great! Mike -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Mike, > does button_to_function allow the use of an image? I tried it in place > of the text with "image_tag" and it doesn''t work. Maybe some form of > button_to? I couldn''t find a way to pass an image as parameter, but you can fabricate it yourself. <%= content_tag(:button, image_tag("ok.png")+"Submit", :type => "submit") %> A good candidate for a helper. Alain Ravet -------- http://blog.ravet.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?hl=en -~----------~----~----~----~------~----~------~--~---
Alain Ravet wrote:> Mike, > > > does button_to_function allow the use of an image? I tried it in > place > > of the text with "image_tag" and it doesn''t work. Maybe some form > of > > button_to? > > I couldn''t find a way to pass an image as parameter, but you can > fabricate it yourself. > > <%= content_tag(:button, image_tag("ok.png")+"Submit", :type => > "submit") %> > > A good candidate for a helper. > > > Alain Ravet > -------- > http://blog.ravet.comHi Alain: Thank you so much! It worked. But here''s what I did: <%= content_tag(:button, image_tag("btn_send.gif"), :type => "submit", :onclick => "closeiframe();") %> So when I do this, it puts a button-box around "image_tag". Any further suggestions??? Thanks again! Mike -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Mike, > But here''s what I did: > <%= content_tag(:button, image_tag("btn_send.gif"), :type => "submit", :onclick => "closeiframe();") %> > So when I do this, it puts a button-box around "image_tag". Yep. That''s what you''re looking for, arent''t you? see: http://particletree.com/features/rediscovering-the-button-element/ Note: if you don''t need text in the button, there is : image_submit_tag http://api.rubyonrails.com/classes/ActionView/Helpers/FormTagHelper.html#M000613 Alain Ravet -------- http://blog.ravet.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?hl=en -~----------~----~----~----~------~----~------~--~---
Mike Dershowitz wrote:> Hi: > > does button_to_function allow the use of an image? I tried it in place > of the text with "image_tag" and it doesn''t work. Maybe some form of > button_to? > > Any direction you can give would be great! > > MikeMike, give this a go. link_to_function(image_tag("delete"), "if (confirm(''Really?'')) do_delete()") Produces: <a onclick="if (confirm(''Really?'')) do_delete(); return false;" href="#"> <img src="/images/delete.png?" alt="Delete"/> </a> RJS template: <%= link_to_function image_tag(''foo.jpg'', :class => "foobar") do |page| page.visual_effect :blind_up, "foo_#{@bar.id}" page.show "foo_#{@bar.id}" end %> I also recommend you visit: http://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#M001061 -- 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?hl=en -~----------~----~----~----~------~----~------~--~---