Question

I have problem with using wicked inside namespace. I have namespace "partners", in this namespace I can add cars so my routes looks like this:

  namespace :partners do
    resources :cars
    resources :car_steps
  end

I have controller cars:

 module Partners
  class CarsController < ApplicationController
    load_and_authorize_resource

    def index  
    end

    def new
    end

    def create
      if @car.save
        flash[:notice] = t("cars.created")
        redirect_to action: :index
      else
        render :new
      end
    end

    def show
    end

    def edit
    end

    def update
      if @car.update(car_params)
        flash[:notice] = t("cars.updated")
        redirect_to action: :index
      else
        render :edit
      end
    end

    def destroy
      @car.destroy
      flash[:error] = t("cars.destroy")
      redirect_to action: :index
    end
   private
    def car_params
      params.require(:car).permit(:plates, :seats, :doors,
        :transmission, :fuel, :air_condition, :radio, :driving_license_min_time,
        :min_driver_age, :credit_card, :credit_card_count)
    end
  end
end

I create also car_steps_controller.rb inside this namespace:

module Partners
  class CarStepsController < ApplicationController
    skip_authorization_check
    include Wicked::Wizard
    steps :payment
    def show
      render_wizzard  
    end
  end
end

And the problem is when I visit: http://localhost:3000/partners/car_steps/payment? I have the error:

undefined local variable or method `render_wizzard' for #<Partners::CarStepsController:0x007fac9032f5e8>

I don't know what I'am doing wrong. Anyone know's the answer

Was it helpful?

Solution

You have a typo.

render_wizzard

should be:

render_wizard
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top