inline...

On Oct 7, 3:10 pm, "Eric Schulte" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using RESTFUL routes with the following setup with a form_for tag,
> but instead of calling the :create action my form is calling the :new
> action.  I have read and re-read the resources documentation, and I am
> confident that I have the right combination of paths, and posting
> methods, please take a look at this setup and let me know if I'm doing
> something stupid or if this is an error w/rails routing.
>
> ,----[environment.rb]
> | # Specifies gem version of Rails to use when vendor/rails is not present
> | RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
> `----
>

What code do you have in your controller?  It should be something like
this:

class ProcessingServiceLevelsController < ApplicationController

  def new
    @processing_service_level = ProcessingServiceLevel.new
  end

end

> ,----[processing_service_levels/new.html.erb]
> |     <% form_for(:processing_service_levels, @level,
> |                 :url => processing_service_level_path(@level),
> |                 :html => { :method => :post}) do |f| %>
> `----

Given the above controller code, you can use this instead:

<% form_for @processing_service_level do |f| %>


That should create a POST action to /processing_service_levels, which
should call your create action.

Last resort, try restarting your web server (mongrel or webrick or
whatever).

Jeff

purpleworkshops.coom

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to