class CommonLisencesController < ApplicationController
+ before_filter :authenticate_author!, :only => [:index, :show]
+ before_filter :authenticate_admin!, :only => [:list, :browse, :new, :edit, :create, :update, :destroy]
+
# GET /common_lisences
# GET /common_lisences.json
def index
end
end
+ def list
+ @common_lisences = CommonLisence.all
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @common_lisences }
+ end
+ end
+
+ def browse
+ @common_lisence = CommonLisence.find(params[:id])
+
+ respond_to do |format|
+ format.html { render layout: 'system' }
+ format.json { render json: @common_lisence }
+ end
+ end
+
# GET /common_lisences/new
# GET /common_lisences/new.json
def new
respond_to do |format|
CommonLisence.transaction do
if @common_lisence.save_save
- format.html { redirect_to @common_lisence, notice: 'Common lisence was successfully created.' }
+ format.html { redirect_to :action => :browse, :id => @common_lisence.id, notice: 'Common lisence was successfully created.' }
format.json { render json: @common_lisence, status: :created, location: @common_lisence }
else
format.html { render action: "new" }
respond_to do |format|
if @common_lisence.update_attributes(params[:common_lisence])
- format.html { redirect_to @common_lisence, notice: 'Common lisence was successfully updated.' }
+ format.html { redirect_to :action => :browse, :id => @common_lisence.id, notice: 'Common lisence was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }