开发者

Rails rendering a new object as an edit?

开发者 https://www.devze.com 2022-12-09 12:46 出处:网络
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.

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 b开发者_运维知识库reaking 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


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

<%= form_for @issue do |f|
0

精彩评论

暂无评论...
验证码 换一张
取 消