Class: Caboose::SocialController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Caboose::SocialController
- Defined in:
- app/controllers/caboose/social_controller.rb
Instance Method Summary collapse
-
#admin_edit ⇒ Object
GET /admin/social.
-
#admin_update ⇒ Object
PUT /admin/social.
- #analytics ⇒ Object
Methods inherited from ApplicationController
#add_ga_event, #admin_add, #admin_bulk_add, #admin_bulk_delete, #admin_bulk_update, #admin_delete, #admin_index, #admin_json, #admin_json_single, #before_action, #before_before_action, #hashify_query_string, #init_cart, #logged_in?, #logged_in_user, #login_user, #logout_user, #parse_url_params, #reject_param, #under_construction_or_forwarding_domain?, #user_is_allowed, #user_is_allowed_to, #validate_cookie, #validate_token, #var, #verify_logged_in
Instance Method Details
#admin_edit ⇒ Object
GET /admin/social
10 11 12 13 14 |
# File 'app/controllers/caboose/social_controller.rb', line 10 def admin_edit return if !user_is_allowed('social', 'edit') @social_config = @site. @social_config = SocialConfig.create(:site_id => @site.id) if @social_config.nil? end |
#admin_update ⇒ Object
PUT /admin/social
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/caboose/social_controller.rb', line 17 def admin_update return if !user_is_allowed('sites', 'edit') resp = StdClass.new sc = @site. sc = SocialConfig.create(:site_id => @site.id) if sc.nil? save = true params.each do |name,value| case name when 'site_id' then sc.site_id = value when 'facebook_page_id' then sc.facebook_page_id = value when 'twitter_username' then sc.twitter_username = value when 'instagram_username' then sc.instagram_username = value when 'youtube_url' then sc.youtube_url = value when 'pinterest_url' then sc.pinterest_url = value when 'vimeo_url' then sc.vimeo_url = value when 'rss_url' then sc.rss_url = value when 'google_plus_url' then sc.google_plus_url = value when 'linkedin_url' then sc.linkedin_url = value when 'google_analytics_id' then sc.google_analytics_id = value when 'google_analytics_id2' then sc.google_analytics_id2 = value when 'auto_ga_js' then sc.auto_ga_js = value end end resp.success = save && sc.save render :json => resp end |
#analytics ⇒ Object
5 6 7 |
# File 'app/controllers/caboose/social_controller.rb', line 5 def analytics end |