hi, i'm new to ruby on rails and am working with version 2.3 on mac osx. i am trying to create the same functionality a scaffold creates, but on my own. i created a "post" controller, view, and model. in post controller, i have the following:
class PostController < ApplicationController
def index
end
def new
@post = Post.new
end
end
in new.html.erb, i have the following:
<h1>New Post</h1>
<% form_for :post do |f| %>
<%= f.text_field :title %>
<% end %>
i noticed that in the scaffold generated code, the use the instance variable @post for the form_for helper. why do they use the instance variable in the scaffold generated form if passing the symbol :post in form_for does the exact same thing, while a symbol requires changing the config of the routes?
thank you very much, yuval