开发者

RoutingError on Ruby Rails?

开发者 https://www.devze.com 2023-01-06 20:42 出处:网络
Hey everyone, thanks for reading this. Ihave the next issue: When I call my \"New\" template (generated by scaffold) I got the next error:

Hey everyone, thanks for reading this. Ihave the next issue: When I call my "New" template (generated by scaffold) I got the next error:

<h1>ActionController::RoutingError in Flujos_de_trabajo#new</h1>

Showing app/views/flujos_de_trabajo/new.html.erb where line #3 raised:

flujos_de_trabajo_url failed to generate from {:controller=>"flujos_de_trabajo", :action=>"show"} - you may have ambiguous routes, or you may need to supply additional parameters for this route.  content_url has the following required parameters: ["flujos_de_trabajo", :id] - are they all satisfied?

Extracted source (around line #3):

1: <h1>New flujo_de_trabajo</h1><br/>
2: <br/>
3: <% form_for(@flujo_de_trabajo) do |f| %><br/>
4:   <%= f.erro开发者_运维百科r_messages %><br/>
5: <br/>
6:   <p><br/>

I have overlooked everything, and I don't know what the problem is. The code in the view and in the controller is the same as the generated. In fact, i deleted it, generated it againg, and nothing, the same problem. Can you help me?


Did you do this.

  1. script/generate scaffold FlujosDeTrabajo
  2. rake db:migrate
  3. http://localhost:3000/flujos_de_trabajos/new

it is working for me


Rails is really bad for languages that aren't English. It's failing here because it thinks that "flujo_de_trabajo" is the singular version of "flujo_de_trabajo". You're going to have to set up some inflections telling Rails the correct singular version of this. Look at the examples in config/initializers/inflectors.rb.

0

精彩评论

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

关注公众号