Is there a way to add styling to rails form_for and make it display inline?
+1
A:
There might be a cleaner way to do this, but it works. (I tried with another nested hash, no dice)
<% form_for(@model, :html => { :style => 'background-color:red;' }) do |f| %>
Andy Gaskell
2009-09-01 03:28:36
If there's a cleaner way, great ... but this works just fine for me if there isn't! Thanks so much Andy!
Daniel
2009-09-01 04:35:08
A:
Put it in a div of the appropriate class? Its a display thing, not a rails thing.
application.css:
.inline form {display: inline; }
<div class=inline>
<%= form....
</div>
dalyons
2009-09-01 06:42:00
+1
A:
A even cleaner way would be to define the styling in an external stylesheet (like application.css
). form_for
creates a <form id="something"/>
tag with an id attribute. You can of course use this id in your stylesheet(s) to apply some specific styling to the form.
Christoph Schiessl
2009-09-01 15:19:29