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 %>
精彩评论