views:

49

answers:

1

I have an application where I'm creating a new object via a "new" action. Rails is using the correct controller action, and also rendering out the new form correctly.

However, the path for the form is coming up with an Id for an edit which is breaking things. The form tag is just:

<% form_for @issue do |f|

etc

Any ideas as to why this would be an edit form instead for a new one?

Controller looks like this:

class IssuesController < ApplicationController
  layout 'application'

  def new
    @issue = Issue.new
  end
end

Routing is as follows:

ActionController::Routing::Routes.draw do |map|
  map.resources :issues
end
A: 

The = sign here is the guy that breaks your stuff!

<%= form_for @issue do |f|
Pavel Shved
pretty sure you don't want to add the `=` sign. http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html
Lukas