fenec
fenec

Reputation: 5806

In Rails Can we pass a parameters to a new Action

i would like to write a message using an instince variable in the new invition action like this. redirect_to new_invitation_path("invite your friend")

Controller invitations:

def new(message)
 @message = message
 @from_user_id = facebook_session.user.to_s
end

Apparently it is not possible how can i find a way around this?

Upvotes: 0

Views: 98

Answers (2)

Thiago
Thiago

Reputation: 2258

I guess that redirect_to goes through the client, so you might need to use params[] for that

Upvotes: 1

Jakub Hampl
Jakub Hampl

Reputation: 40533

You might want to clarify your question, but wouldn't a flash message solve your problem?

Upvotes: 2

Related Questions