Sha256: 5bec84164a853bcb2b0d5963235d449af325fefe11a767bcc03d8451ba633959

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 KB

Contents

module Mokio
  module Concerns
    module Controllers
      #
      # Concern for MovGalleriesController
      #
      module MovGalleries
        extend ActiveSupport::Concern

        included do
        end

        #
        # Overriten create from CommonController#create (Mokio::Concerns::Controllers::Common)
        #
        def create
          @mov_gallery = Mokio::MovGallery.new(mov_gallery_params)

          respond_to do |format|
            if @mov_gallery.save
              if !params[:save_and_new].blank?
                format.html { redirect_to new_mov_gallery_path, notice: t("mov_galleries.created_and_new", title: @mov_gallery.title) }
              else
                format.html { redirect_to edit_content_path(@mov_gallery), notice: t("mov_galleries.created", title: @mov_gallery.title) }
              end
            else
              format.html { render "new", notice: t("mov_galleries.not_created", title: @mov_gallery) }
            end
          end
        end

        private
          #
          # Never trust parameters from the scary internet, only allow the white list through.
          #
          def mov_gallery_params #:doc:
            params.require(:mov_gallery).permit(:title, :type, :active, :home_page ,:intro, :content, :display_from, :display_to, :lang_id, :main_pic, :tag_list, :menu_ids => [], :data_file => [], 
              :meta_attributes => Mokio::Meta.meta_attributes)
          end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mokio-0.0.6 lib/mokio/concerns/controllers/mov_galleries.rb
mokio-0.0.5 lib/mokio/concerns/controllers/mov_galleries.rb