app/controllers/spotlight/exhibits_controller.rb in blacklight-spotlight-0.1.0 vs app/controllers/spotlight/exhibits_controller.rb in blacklight-spotlight-0.2.0

- old
+ new

@@ -6,10 +6,13 @@ def new end def import + add_breadcrumb t(:'spotlight.exhibits.breadcrumb', title: @exhibit.title), @exhibit + add_breadcrumb t(:'spotlight.administration.sidebar.header'), exhibit_dashboard_path(@exhibit) + add_breadcrumb t(:'spotlight.administration.sidebar.import'), import_exhibit_path(@exhibit) end def process_import if @exhibit.import(JSON.parse(import_exhibit_params.read)) redirect_to spotlight.exhibit_dashboard_path(@exhibit), notice: t(:'helpers.submit.exhibit.updated', model: @exhibit.class.model_name.human.downcase) @@ -57,17 +60,18 @@ end protected def current_exhibit - @exhibit if @exhibit.persisted? + @exhibit if @exhibit and @exhibit.persisted? end def exhibit_params params.require(:exhibit).permit( :title, :subtitle, :description, + :published, contact_emails_attributes: [:id, :email] ) end def import_exhibit_params