0
我有使用邪惡的內部命名空間的問題。我有命名的「夥伴」,這個命名空間,我可以添加汽車,所以我的路線是這樣的:邪惡使用裏面的命名空間
namespace :partners do
resources :cars
resources :car_steps
end
我控制器汽車:
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
創建也car_steps_controller.rb這個命名空間內:
module Partners
class CarStepsController < ApplicationController
skip_authorization_check
include Wicked::Wizard
steps :payment
def show
render_wizzard
end
end
end
而問題是,當我訪問:http://localhost:3000/partners/car_steps/payment?
我有錯誤:
undefined local variable or method `render_wizzard' for #<Partners::CarStepsController:0x007fac9032f5e8>
我不知道我做錯了什麼。任何人都知道的答案
OMG,我很愚蠢...謝謝的:) –