app/controllers/archangel/backend/sites_controller.rb in archangel-0.3.0 vs app/controllers/archangel/backend/sites_controller.rb in archangel-0.4.0
- old
+ new
@@ -7,10 +7,12 @@
module Backend
##
# Backend sites controller
#
class SitesController < BackendController
+ helper Archangel::Backend::MetatagsHelper
+
##
# Backend site
#
# Formats
# HTML, JSON
@@ -37,16 +39,11 @@
# "url": "/uploads/small_file.png"
# },
# "tiny": {
# "url": "/uploads/tiny_file.png"
# }
- # },
- # "content": "</p>Content of the Widget</p>",
- # "template_id": 123,
- # "deleted_at": null,
- # "created_at": "YYYY-MM-DDTHH:MM:SS.MSZ",
- # "updated_at": "YYYY-MM-DDTHH:MM:SS.MSZ"
+ # }
# }
#
def show
site = resource_content
@@ -81,13 +78,11 @@
# "url": "/uploads/small_file.png"
# },
# "tiny": {
# "url": "/uploads/tiny_file.png"
# }
- # },
- # "content": "</p>Content of the Widget</p>",
- # "template_id": 123
+ # }
# }
#
def edit
site = resource_content
@@ -124,13 +119,11 @@
# "url": "/uploads/small_file.png"
# },
# "tiny": {
# "url": "/uploads/tiny_file.png"
# }
- # },
- # "content": "</p>Content of the Widget</p>",
- # "template_id": 123
+ # }
# }
# }
#
def update
site = resource_content
@@ -143,10 +136,11 @@
protected
def permitted_attributes
[
:locale, :logo, :name, :remove_logo, :theme,
+ :allow_registration, :homepage_redirect,
metatags_attributes: %i[id _destroy name content]
]
end
def resource_content
@@ -154,13 +148,13 @@
authorize @site
end
def resource_params
- params.require(resource_namespace).permit(permitted_attributes)
+ params.require(resource_scope).permit(permitted_attributes)
end
- def resource_namespace
+ def resource_scope
controller_name.singularize.to_sym
end
def location_after_update
location_after_save