Hi all ! I've got a problem in my application. I've written a bug_reports controller. It is pretty RESTful, there are index, new and create actions. Everytime I submit a new bug_report, the index action is called, not the create action, you can see the log here: http://pastie.org/258857. My form looks like this: <fieldset id="bugreport"> <% form_for @bug_report, :url => bug_reports_path do |f| -%> <div> <%= f.text_field :title, :value => "Title" %> </div> <div> <%= f.text_area :body %> </div> <div> <%= f.submit "Submit", :disable_with => 'Submiting...' %> </div> <% end -%> </fieldset>
My routes.rb contains this line: map.resources :bug_reports
And finally, my BugReportsController looks like this: class BugReportsController < ApplicationController login_required def index @bug_reports = BugReport.all end
def new @bug_report = BugReport.new end
def create @bug_report = BugReport.new params[:bug_report] if @bug_report.save flash[:notice] = "Thank you for submitting this bug." else flash[:warning] = "Your bug report was not saved. Please try again." end redirect_to root_url end end
This error doesn't occur in other parts of my app. I really don't know why this happens, I hope you can help me. Thank you very much in advance, Christoph
PS: I've written a small patch regarding options_from_collection_for_select. You can find it here: http://rails.lighthouseapp.com/projects/8994/tickets/890-in-options_from_collection_for_select-text-value_method-are-chainable. I would be happy if someone would give me feedback on this.