views:

18

answers:

1

This is a 101 question I know, sorry.

I have two 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 User form on Static/index

+2  A: 

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 %>
j.
thank you! I'm coming from php and sometimes I just miss the good-ol <include> :)
Jason
You're welcome!
j.
You can include other templates with <%= render :partial => 'my_template' %>
elektronaut