Class: Interact::Admin::StarsController
- Inherits:
-
BaseController
- Object
- BaseController
- Interact::Admin::StarsController
- Defined in:
- app/controllers/interact/admin/stars_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
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 13 def create @star = Star.new(star_params) if @star.save redirect_to admin_stars_url, notice: 'Star was successfully created.' else render :new end end |
#destroy ⇒ Object
37 38 39 40 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 37 def destroy @star.destroy redirect_to admin_stars_url, notice: 'Star was successfully destroyed.' end |
#edit ⇒ Object
26 27 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 26 def edit end |
#index ⇒ Object
4 5 6 7 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 4 def index q_params = params.permit(:user_id, :starred_type, :starred_id) @stars = Star.default_where(q_params).page(params[:page]) end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 9 def new @star = Star.new end |
#show ⇒ Object
23 24 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 23 def show end |
#update ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/interact/admin/stars_controller.rb', line 29 def update if @star.update(star_params) redirect_to admin_stars_url, notice: 'Star was successfully updated.' else render :edit end end |