Is there a way to add styling to rails form_for and make it display inline?
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| %>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With