Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized constant Admin::ResourceController #4

Open
laurobecker opened this issue Apr 2, 2013 · 0 comments
Open

Uninitialized constant Admin::ResourceController #4

laurobecker opened this issue Apr 2, 2013 · 0 comments

Comments

@laurobecker
Copy link

The generated code for the "cats" example didn't work. When I try to access http://localhost:3000/admin/cats, I have a Uninitialized constant Admin::ResourceController.

My controller code is:

class Admin::CatsController < Admin::ResourceController

  def index
    @cats = Cat.page(params[:page] || 1).per(50)
  end

  def new
    @cat = Cat.new
  end

  def create
    @cat = Cat.new(params[:cat])
    if @cat.save
      flash[:notice] = "Successfully created Cat."
      redirect_to admin_cats_url
    else
      render :action => 'new'
    end
  end

  def edit
    @cat = Cat.find(params[:id])
  end

  def update
    @page = Cat.find(params[:id])
    if @cat.update_attributes(params[:cat])
      flash[:notice] = "Successfully updated Cat."
      redirect_to admin_cats_url
    else
      render :action => 'edit'
    end
  end

  def destroy
    @cat = Cat.find(params[:id])
    @cat.destroy
    flash[:notice] = "Successfully destroyed Cat."
    redirect_to admin_cats_url
  end

end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant