I'm new to wicked form and I was following the railcast episode on wicked forms but I keep receiving this error "Couldn't find Company with 'id'=info". So I know that the problem is clearly in my controllers somewhere. I know it's something super simple that I'm just racking my brain on so I know you guys will be a giant help. Here is the code, any and all help appreciated!
Code for companies Controller:
def create
@company = Company.new(company_params)
respond_to do |format|
if @company.save
@object = @company.id
format.html { redirect_to(company_steps_path(@company)) }
format.json { render :show, status: :created, location: @company }
else
format.html { render :new }
format.json { render json: @company.errors, status: :unprocessable_entity }
end
end
end
Code for company_steps Controller:
class CompanyStepsController < ApplicationController
include Wicked::Wizard
steps :info, :address, :quote
def show
@company = Company.find(params[:id])
render_wizard
end
def update
@company = Company.where(id: params[:id])
@company.attributes = params[:company]
render_wizard @company
end
end