I modified the routes to point to controller. But now I get this:

Started POST "/users/create" for 127.0.0.1 at 2011-03-08 14:21:21 -0500
  Processing by UsersController#create as JSON
  SQL (177.7ms)  BEGIN
  SQL (1.6ms)  ROLLBACK
Rendered text template (0.0ms)
Completed 422 Unprocessable Entity in 290ms (Views: 47.3ms | 
ActiveRecord: 179.3ms)

this is create method:

  def create
    @user = User.new(params[:user])

    if @user.save
      respond_to do |format|
        format.json { render :json => @user.to_json, :status => 200 }
        format.xml  { head :ok }
        format.html { redirect_to :action => :index }
      end
    else
      respond_to do |format|
        format.json { render :text => "Could not create user", :status 
=> :unprocessable_entity } # placeholder
        format.xml  { head :ok }
        format.html { render :action => :new, :status => 
:unprocessable_entity }
      end
    end


    end

-- 
Posted via http://www.ruby-forum.com/.

-- 
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