I'm rather new to rails, but I do have a Rails 2.0 project up and
running. Now I want to add a new view, let's call it "newpage" and it
has a link from my main page called "index.html.erb"
I assume i'll need a file called "newpage.html.erb" in my project
"views" folder, and i'll need a method in my <project>_controller.rb
file called "newpage". Currently, it looks like this, but its not
working:
def newpage
end
Anybody know what i'm missing? Do I need some other code in there?
All I want to do at this point is display a simple page, so I assume I
don't need anything in the method or do I? Any help would be
appreciated.
I'm rather new to rails, but I do have a Rails 2.0 project up and
running. Now I want to add a new view, let's call it "newpage" and it
has a link from my main page called "index.html.erb"
Is your :index and :newpage in the same controller? If not you need to tell the link above what controller to use.
I assume i'll need a file called "newpage.html.erb" in my project
"views" folder, and i'll need a method in my <project>_controller.rb
file called "newpage". Currently, it looks like this, but its not
working:
def newpage
end
If it's just a view you don't even need the method declaration. Doesn't hurt though.