Class: Admin::TbRedirectsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::TbRedirectsController
- Defined in:
- app/controllers/admin/tb_redirects_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
22 23 24 25 26 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 22 def create @tb_redirect = TbRedirect.create_smart(tb_redirect_params.merge(created_by: 'user')) flash[:notice] = 'Redirect created successfully' if @tb_redirect.errors.none? respond_with @tb_redirect, location: admin_tb_redirects_path end |
#destroy ⇒ Object
39 40 41 42 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 39 def destroy flash[:notice] = 'Redirect deleted successfully' if @tb_redirect.destroy respond_with @tb_redirect, location: admin_tb_redirects_path end |
#edit ⇒ Object
28 29 30 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 28 def edit respond_with @tb_redirect end |
#index ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 7 def index @tb_redirects = TbRedirect.ordered.paginate(page: params[:page]) @tb_redirects = @tb_redirects.search(params[:search]) if params[:search] respond_with @tb_redirects end |
#new ⇒ Object
17 18 19 20 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 17 def new @tb_redirect = TbRedirect.new respond_with @tb_redirect end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 13 def show respond_with @tb_redirect end |
#update ⇒ Object
32 33 34 35 36 37 |
# File 'app/controllers/admin/tb_redirects_controller.rb', line 32 def update if @tb_redirect.update_attributes(tb_redirect_params) flash[:notice] = 'Redirect updated successfully' end respond_with @tb_redirect, location: admin_tb_redirects_path end |