Can''t figure this one out: I''d like two buttons on the same line. If I do this: <%= button_to "New", :action => "new" %><%= button_to "old", :action => "old" %> I get two lines (naturally.) But I''d like them side by side. It must be simple. Thanks so much for any help! Pito -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Jan 21, 2010 at 1:04 PM, Pito Salas <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> <%= button_to "New", :action => "new" %><%= button_to "old", :action => > "old" %> > > I get two lines (naturally.) But I''d like them side by side. It must be > simple.`view source` is your friend: ''button_to'' wraps a couple of inputs in a div inside a form, both the latter being normally block elements. Ergo, adjust your CSS to taste. :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
hassan is right put the buttons in a div id="buttons holder" , and give it the right length in the stylesteet of that html. next pass a css parameter in the first button_to metheod like :class => "button1", and then to the second one :class=>"button2"(more reference at http://railsapi.com/doc/rails-v2.3.5/ ) in the stylesheet give both buttons the float:left propriety, again you have to adjust the height and lenghon of the "buttons holder div" it shoul do the trick :) hope it mane any difference in you app :) and pls let me know if it did or didn''t all the best, radu On Jan 21, 11:51 pm, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Thu, Jan 21, 2010 at 1:04 PM, Pito Salas <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > <%= button_to "New", :action => "new" %><%= button_to "old", :action => > > "old" %> > > > I get two lines (naturally.) But I''d like them side by side. It must be > > simple. > > `view source` is your friend: ''button_to'' wraps a couple of inputs in a > div inside a form, both the latter being normally block elements. Ergo, > adjust your CSS to taste. :-) > > -- > Hassan Schroeder ------------------------ hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.