I'm having the darnedest time understanding something I'm sure is very simple (at least was under other web dev platforms where I would do a href...C:\windows\apps\home.html). I'm trying to set up a link to my home page
I have an application controller:
And a home controller:Code:# Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers. class ApplicationController < ActionController::Base layout "main" helper :all # include all helpers, all the time protect_from_forgery # See ActionController::RequestForgeryProtection for details # Scrub sensitive parameters from your log # filter_parameter_logging :password end
and a main.html.erb:Code:class HomeController < ApplicationController def index end end
I would like home to display the contents of my main.html.erb file. (or should it be application.html.erb?). To further confuse me, my home folder, under /apps/views/home has an index.html.erb file.Code:!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <title>Pics4Flicks</title> <%= stylesheet_link_tag 'style' %> </head> <body> <div id="container"> <div id="top"> </div> <div id="navbar"> <ul> <li>Home</li> <li><%= link_to 'Movies', movies_path %></li> #this link works fine <li>DVD</li> <li>News</li> <li>Forum</li> <li>Contact</li> </ul> </div>
I must be mixing up my views (have I somehow created too many?) and perhaps not defining things properly in routes.rb. Hopefully haven't confused you all as much as I have myself. Any help most appreciated.![]()




Bookmarks