personal_plugin_generator/template_generator/app/controllers/admin/plugin_template_relateds_co...

43 lines
1.1 KiB
Ruby
Raw Normal View History

2021-02-27 04:19:24 +00:00
class Admin::PluginTemplateRelatedsController < OrbitMemberController
def index
end
def new
@plugin_template_related = PluginTemplateRelated.new
2021-03-01 15:44:52 +00:00
@url = admin_plugin_template_relateds_path
2021-02-27 04:19:24 +00:00
end
def edit
@plugin_template_related = PluginTemplateRelated.find(params[:id])
@url = admin_plugin_template_related_path(@plugin_template_related)
end
def create
plugin_template_related = PluginTemplateRelated.create(plugin_template_related_params)
@plugin_template_relateds = PluginTemplateRelated.all
end
def update
plugin_template_related = PluginTemplateRelated.find(params[:id]) rescue nil
if !plugin_template_related.nil?
2021-03-01 15:44:52 +00:00
plugin_template_related.update_attributes(plugin_template_related_params)
2021-02-27 04:19:24 +00:00
end
@plugin_template_relateds = PluginTemplateRelated.all
end
def destroy
plugin_template_related = PluginTemplateRelated.find(params[:id]) rescue nil
if !plugin_template_related.nil?
plugin_template_related.destroy
end
@plugin_template_relateds = PluginTemplateRelated.all
end
private
def plugin_template_related_params
params.require(:plugin_template_related).permit!
end
end