KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Here is a piece of code in edit.html.erb which does not work. The purpose of the code is to fill a form for editing. Collection is used with option of yes and no. How can I set the collection to the current 'active' value with :selected option? <%= simple_form_for @category do |f| %> <%= f.input :name, :disabled => true, :required => false %> <%= f.input :description %> <%= f.input :active, :collection => ['Yes', 'No'], :selected => f.active %> <%= f.button :submit %> <% end %> The error saying the active is not a method in f.input :active, :collection.
Tags (comma-separated)
Save Edits
Cancel