开发者

How do I get /users/new to show up on /static/index

I have two开发者_Python百科 controllers: Users and Static. Static/index is my root index page.

I want the Users/new form to be displayed on my index page.

All forms are working, just no idea how to include the Users form on Static/index.


Something like

# static controller
def index
   # your stuff ...
   @user = User.new
end

def create
   # your stuff ...
   @user.create(params[:user])   
end

# static's index view
# your stuff ...
<% form_for @user do |f| %>
   <%= f.label :name, 'Name' %>:
   <%= f.text_field :name %>
   # more fields
<% end %>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜