Static Pages from Railcast

Jim Oser wrote in post #1069201:

Other people have reported this error:

NoMethodError:       undefined method `visit' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0xa1695cc>     # ./spec/requests/static_pages_spec.rb:7:in `block (3 levels) in <top (required)>'

google: rspec visit

In particular see:

https://github.com/rspec/rspec-rails/issues/360

You might want to post your Gemfile.

Hmm i see my issues, i installed the rspec not through my gemfile but through a command line gem install rspec. Would this be the issue

What i am doing wrong??

So I am at chapter 8, and everything seem to be working except that once loggin I am apparently not login but do see some of the information such as show correct user.

Here what I have app/controllers/customers.rb class CustomersController < ApplicationController

  def show   @customer = Customer.find(params[:id])   end

  def create     @customer = Customer.new(params[:customer])     if @customer.save   sign_in @customer   flash[:success] = "Welcome to Where you Where"   redirect_to @customer       # Handle a successful save.     else       render 'new'     end   end

  def new   @customer = Customer.new   end

  def edit   @customer = Customer.find(params[:id])   end

  def update     if @customer.update_attributes(params[:customer])       flash[:success] = "Profile updated"       sign_in @customer       redirect_to @customer     else       render 'edit'     end   end

  private

    def signed_in_customer       redirect_to signin_path, notice: "Please sign in." unless signed_in?     end

    def correct_customer       @customer = Customer.find(params[:id])       redirect_to(root_path) unless current_customer?(@customer)     end

end

I have change the name of the resource from user to customer for trying different then the person

this is my session help found in the folder app/helpers/session.rb module SessionsHelper

  def sign_in(customer)     cookies.permanent[:remember_token] = customer.remember_token     self.current_customer= customer   end

  def current_customer=(customer)     @current_customer = customer   end

  def current_customer?(customer)   customer == current_customer   end

  def current_customer     @current_customer ||= Customer.find_by_remember_token(cookies[:remember_token])   end

  def sign_in(customer)     cookies.permanent[:remember_token] = customer.remember_token     self.current_customer = customer   end

  def signed_in?     !current_customer.nil?   end

  def sign_out     cookies.delete(:remember_token)     self.current_customer = nil   end

end

Here his my header just in case i made a small mistake <header class="navbar navbar-fixed-top">   <div class="navbar-inner">     <div class="container">       <nav>         <ul class="nav pull-right">           <li><%= link_to "Home", root_path %></li>           <% if signed_in? %>             <li><%= link_to "Customers", '#' %></li>             <li id="fat-menu" class="dropdown">               <a href="#" class="dropdown-toggle" data-toggle="dropdown">                 Account <b class="caret"></b>               </a>               <ul class="dropdown-menu">                 <li><%= link_to "Profile", current_customer %></li>                 <li><%= link_to "Settings", '#' %></li>                 <li class="divider"></li>                 <li>                   <%= link_to "Sign out", signout_path, method: "delete" %>                 </li>               </ul>             </li>           <% else %>             <li><%= link_to "Sign in", signin_path %></li>           <% end %>         </ul>       </nav>     </div>   </div> </header>

Again i only see sign and home as link has i am assuming something his wrong with my sign process

Jean-Sébastien D. wrote in post #1069202:

Jim Oser wrote in post #1069201:

Other people have reported this error:

Thanks.

I am wondering if its actually possible to see into the application controller other resources

Example

class ApplicationController < ActionController::Base         protect_from_forgery         include SessionsHelper   @pages = Page.all end

app/layout/_footer.html.erb <% @pages.each do |page| %>     <li>       <%= @page.name %>     </li> <% end %>

Thanks in advance