Class: Portfolio::Admin::SiteSocialLinksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Portfolio::Admin::SiteSocialLinksController
- Defined in:
- app/controllers/portfolio/admin/site_social_links_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
-
#index ⇒ Object
TODO: replace horrible method paths with [res, res, …] format (not working for some reason).
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 23 def create @link = SiteSocialLink.new(link_params) respond_to do |format| if @link.save format.html { redirect_to [:admin, @site, :site_social_links], notice: 'Social link was successfully created.' } else format.html { render :new } end end end |
#destroy ⇒ Object
45 46 47 48 49 50 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 45 def destroy @link.destroy respond_to do |format| format.html { redirect_to [:admin, @site, :site_social_links], notice: 'Social link was successfully destroyed.' } end end |
#edit ⇒ Object
20 21 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 20 def edit end |
#index ⇒ Object
TODO: replace horrible method paths with [res, res, …] format (not working for some reason)
9 10 11 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 9 def index @links = @site. end |
#new ⇒ Object
16 17 18 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 16 def new @link = SiteSocialLink.new site: @site end |
#show ⇒ Object
13 14 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 13 def show end |
#update ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/portfolio/admin/site_social_links_controller.rb', line 35 def update respond_to do |format| if @link.update(link_params) format.html { redirect_to [:admin, @site, :site_social_links], notice: 'Social link was successfully updated.' } else format.html { render :edit } end end end |