Custom Route Required?

I have a model class with the name of MilestoneProgress. The model file
is called milestone_progress.rb. The controller class is called
MilestoneProgressController and is located in
milestone_progress_controller.rb.

However, when I try to connect to the milestone_progress controller, I
get the following message:

No route matches “/milestone_progress/create” with {:method=>:post}.

Do I need to create a custom route for this controller? Or have I
somehow gotten my conventions all messed up?

Ta

Rory

You added the mapping to your config/routes.rb right?

Assuming you did that you probably didn’t specify a create action in
your controller. Unfortunately those don’t get auto generated for
you. IMO this is a major drawback to the current resources
implementation. There is however, a very interesting plugin[1] that
will do this for you.

HTH,

Sean

[1]
http://jamesgolick.com/2007/10/19/introducing-resource_controller-focus-on-what-makes-your-controller-special

schof wrote:

You added the mapping to your config/routes.rb right?

Hi Sean

No I haven’t yet, as I wasn’t sure if it was required. So, would it be a
good rule of thumb to assume that if I have a “double-barreled”
controller name, I will have to create a custom route for it?

Thanks

Rory

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs