开发者

In Rails Can we pass a parameters to a new Action

开发者 https://www.devze.com 2022-12-31 11:29 出处:网络
iwould like to write a message using an instince variable in the new invition action like this. redirect_to new_invitation_path(\"invite your开发者_如何学编程 friend\")

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?


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号