1

So by default RoR has Form Helpers that let you render form fields easily eg

<% form_for @article do |f| %>
  <%= f.text_field :name %>
<% end %>

Awesome but let's say i want to render all my forms in a different way let's say i want to add different things

  1. Bootstrap classes to fields form-control
  2. Red asterisk next to the label if it's required.
  3. data-toggle="validator"

Just to name a few, What would be the best way i can achieve these?

2
  • Some simple Googling will get you started down the right road. Once you've tried some specific things, come back and ask a more focused question (or questions) showing us what you've tried, what is unclear, etc. Commented Feb 28, 2016 at 23:10
  • @jvillian What isn't clear here? Pardon my english Commented Feb 28, 2016 at 23:14

1 Answer 1

1

You can achieve this by defining your own custom form builder.

Refer to Form Builder for more info.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.