Class: Ninetails::SectionTemplatesController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Ninetails::SectionTemplatesController
- Defined in:
- app/controllers/ninetails/section_templates_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/controllers/ninetails/section_templates_controller.rb', line 4 def index templates = Rails.root.join("app", "components", "section_template").children.collect do |entry| entry.basename.to_s.sub(/(\..*)$/, '').classify end render json: { templates: templates } end |
#show ⇒ Object
12 13 14 |
# File 'app/controllers/ninetails/section_templates_controller.rb', line 12 def show render json: "SectionTemplate::#{params[:id]}".safe_constantize.new.serialize end |