title: simple_form is giving error undefined method `reviews_path' for #<# for nested route in Rails 4
body: <p>I checked the other simple_form posts and they didn't quite hit on my problem. I have a nested resource for restaurant reviews in my routes.rb here:</p>
  
  <pre><code>Rails.application.routes.draw do
    devise_for :users
    resources :restaurants do
      resources :reviews, except: [:show, :index]
     end
  </code></pre>
  
  <p>My review controller seems to be set properly here:</p>
  
  <pre><code>class ReviewsController &lt; ApplicationController
    before_action :authenticate_user!
    before_action :set_restaurant
    before_action :set_review, only: [:edit, :update, :destroy]
  
    # GET /reviews/new
    def new
      @review = Review.new
    end
  
    # GET /reviews/1/edit
    def edit
    end
  
    # POST /reviews
    # POST /reviews.json
    def create
      @review = Review.new(review_params)
      @review.user_id = current_user.id
      @review.restaurant_id = @restaurant.id
  
      respond_to do |format|
        if @review.save
          format.html { redirect_to root_path, notice: 'Review was successfully created.' }
          format.json { render :show, status: :created, location: @review }
        else
          format.html { render :new }
          format.json { render json: @review.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # PATCH/PUT /reviews/1
    # PATCH/PUT /reviews/1.json
    def update
      respond_to do |format|
        if @review.update(review_params)
          format.html { redirect_to @review, notice: 'Review was successfully updated.' }
          format.json { render :show, status: :ok, location: @review }
        else
          format.html { render :edit }
          format.json { render json: @review.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # DELETE /reviews/1
    # DELETE /reviews/1.json
    def destroy
      @review.destroy
      respond_to do |format|
        format.html { redirect_to reviews_url, notice: 'Review was successfully destroyed.' }
        format.json { head :no_content }
      end
    end
  
    private
      # Use callbacks to share common setup or constraints between actions.
      def set_review
        @review = Review.find(params[:id])
      end
      def set_restaurant
        @restuarant = Restaurant.find(params[:restaurant_id])
      end
      # Never trust parameters from the scary internet, only allow the white list through.
      def review_params
        params.require(:review).permit(:rating, :comment)
      end
  end
  </code></pre>
  
  <p>My restaurant controller is here:</p>
  
  <pre><code>class RestaurantsController &lt; ApplicationController
    before_action :set_restaurant, only: [:show, :edit, :update, :destroy]
  
    # GET /restaurants
    # GET /restaurants.json
    def index
      @restaurants = Restaurant.all
    end
  
    # GET /restaurants/1
    # GET /restaurants/1.json
    def show
    end
  
    # GET /restaurants/new
    def new
      @restaurant = Restaurant.new
    end
  
    # GET /restaurants/1/edit
    def edit
    end
  
    # POST /restaurants
    # POST /restaurants.json
    def create
      @restaurant = Restaurant.new(restaurant_params)
  
      respond_to do |format|
        if @restaurant.save
          format.html { redirect_to @restaurant, notice: 'Restaurant was successfully created.' }
          format.json { render :show, status: :created, location: @restaurant }
        else
          format.html { render :new }
          format.json { render json: @restaurant.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # PATCH/PUT /restaurants/1
    # PATCH/PUT /restaurants/1.json
    def update
      respond_to do |format|
        if @restaurant.update(restaurant_params)
          format.html { redirect_to @restaurant, notice: 'Restaurant was successfully updated.' }
          format.json { render :show, status: :ok, location: @restaurant }
        else
          format.html { render :edit }
          format.json { render json: @restaurant.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # DELETE /restaurants/1
    # DELETE /restaurants/1.json
    def destroy
      @restaurant.destroy
      respond_to do |format|
        format.html { redirect_to restaurants_url, notice: 'Restaurant was successfully destroyed.' }
        format.json { head :no_content }
      end
    end
  
    private
      # Use callbacks to share common setup or constraints between actions.
      def set_restaurant
        @restaurant = Restaurant.find(params[:id])
      end
  
      # Never trust parameters from the scary internet, only allow the white list through.
      def restaurant_params
        params.require(:restaurant).permit(:name, :address, :phone, :website, :image)
      end
  end
  </code></pre>
  
  <p>and my simple_form_for is super straight forward:</p>
  
  <pre><code>&lt;%= simple_form_for [@restaurant, @review] do |f| %&gt;
    &lt;%= f.error_notification %&gt;
  
    &lt;div class="form-inputs"&gt;
      &lt;%= f.input :rating %&gt;
      &lt;%= f.input :comment %&gt;
    &lt;/div&gt;
  
    &lt;div class="form-actions"&gt;
      &lt;%= f.button :submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>So, I don't know why I am getting this error :(</p>