RESTful but use create in another controller

I have a RESTful setup, where one is for messages. In MessagesController
I have the basic methods. But I have problems when I want to “create”
from another controller. I took the form in new.erb.html from message
view and copied that to a new file in views in a different location, and
another controller. What if I want to have a method in the new
controller called create_message, how should this form_for be changed?

<% form_for(@message) do |f| %>

What is the “create” action currently doing in the MessagesController?

“New” can surely be from a different controller, but if you’re being
RESTful, why not keep “create” in the MessagesController?

You can pass in options, though:

<% form_for @message, :url => path do |f| %>

Stephen

On Apr 23, 9:19 am, Pål Bergström [email protected]

[email protected] wrote:

What is the “create” action currently doing in the MessagesController?

“New” can surely be from a different controller, but if you’re being
RESTful, why not keep “create” in the MessagesController?
On Apr 23, 9:19�am, P�l Bergstr�m [email protected]

That’s true. But what if I want to redirect_to another action and still
use the create in the MessagesController?

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