form_for 但要发布到不同的操作 [英] form_for but to post to a different action

查看:30
本文介绍了form_for 但要发布到不同的操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个 form_for @user,但要发布到用户控制器中的自定义操作.

I want to have a form_for @user, but post to a custom action in the users controller.

我该怎么做?

推荐答案

form_for @user, :url => url_for(:controller => 'mycontroller', :action => 'myaction')

form_for @user, :url => whatever_path

这篇关于form_for 但要发布到不同的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆