Reputation: 319
How can i format a form on a rails app? I have my application.css file, no classes where gives or ids to the form tags inside of the form action page. but the form inherited the formatting in somehow but it is not what i wanted.
Also, how can i make every single page in my rails app have its own page and css file? i don't want to make one master page and imbed the pages codes inside the body tag
like i want to have every single page its own application.html.erb and how to let rails know about this and not to load the default one?
I'm a php guy, so working with styling and templates very confusing to me. when i want to format a form using css. i know how to do it, also i write the code like below:
<form id="FirstForm">
in my rails app tutorial i followed, there is no id tages or formatting inside the form tags and fields at all. don't know how this got formatted? is it allowed to write ids and classes inside of the rails form tag?
Upvotes: 0
Views: 98
Reputation: 115531
You can pass id
and class
as you desire.
Example:
<%= form_for @article, :url => { :action => "create" }, :html => {:id => "FirstForm", :class => "your_class"} do |f| %>
Check full doc.
Upvotes: 2