Topic: Weird behavior after deploying to Heroku?

My app is acting weird on Heroku. I have this create method in my IncidentsController:

def create
    @incident = current_user.incidents.new(params[:incident])
    @incident.status = "In Progress"

    respond_to do |format|
      if @incident.save
    @incident.create_timesheet()
    format.html { redirect_to edit_incident_timesheet_path(@incident), :notice => "The Incident has been saved! Now please fill in the timesheet by adding personnel below. You can do this later if you want to skip this step for now." }
      else
         format.html { render :action => "new" }
      end
    end
  end

But when I click 'Submit' when creating a new Incident, it just takes me to the Show Incident page and says 'Incident was successfully created.' It is completely ignoring my custom redirect and it's also not creating a timesheet.

When I run my app locally, the create method works just fine after I click submit, but on Heroku doing something completely different.

Any idea what is going on?

Last edited by FinneJager (2011-01-11 13:08:15)

Re: Weird behavior after deploying to Heroku?

Looks simple enough, I can't see anything wrong, so I'd add some loggers around your code and make sure that you have pushed all your changes.

Re: Weird behavior after deploying to Heroku?

I fixed the problem. I had an IncidentsController.rb and also an IncidentsController_BACKUP.rb in my Controllers folder, and for some reason Heroku used the old _BACKUP file instead of the correct one.