Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Admin::CategoriesController < ApplicationController
- layout "admin"
- def index
- render :template => "admin/categories/index"
- end
- def new
- @category = Category.new
- render :template => "admin/categories/new"
- end
- def create
- @category = Category.new(category_params)
- if @category.save
- redirect_to admin_category
- else
- render 'new'
- end
- end
- private
- def category_params
- params.require(:category).permit(:title)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment