KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm having a bit of a trouble on my edit form. For some reason my select helper is not working properly on the edit action. It seems to ignore for some reason the option :prompt=>true and does not show the "Please select" message. But only on the edit action, the new action is working just fine. the snippet from the form partial: f.select :category_id, @categories, {:prompt => true} the edit action def edit @page = Page.find(params[:id]) @categories = Category.where(:cat_type=>"page").map { |c| [t("category.#{c.slug}",:default=>"#{c.name}"), c.id] } end the new action def new @page = Page.new @categories = Category.where(:cat_type=>"page").map { |c| [t("category.#{c.slug}",:default=>"#{c.name}"), c.id] } respond_to do |format| format.html # new.html.erb format.json { render json: @page } end end Any idea?
Tags (comma-separated)
Save Edits
Cancel