开发者

How call the "create" action in rails

I'm working in a rails app (rails 2.3.8), and I created a resource called articles. I need a form who call the create action in that controller. I used a form_remote_tag, but I can't call correctly the "create" action, the app always call de "new" action. I used several different combinations, the last one is this

  <%=form_remote_tag :html => { :action => url_for (:action => :create)} %>

How a could do this?.开发者_JAVA百科 I can't use the for_remote_for or the form_for because that form will feed more tan one table in my database.

Thanks in advance


You are over complicating it:

<%= form_remote_tag :action => :create %>

Also, be sure that this is what you truly need. You say you want to create multiple objects in the form, which is why I think you may be after form_remote_for coupled with fields_for rather than form_remote_tag, but from your question I don't fully understand.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜