Two buttons on one line

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

On Thu, Jan 21, 2010 at 1:04 PM, Pito S. [email protected]
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. :slight_smile:

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 :slight_smile:

hope it mane any difference in you app :slight_smile: and pls let me know if it
did or didn’t

all the best,
radu

On Jan 21, 11:51 pm, Hassan S. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs