2011-02-01 02:46:26 +00:00
|
|
|
class Admin::UserRoleModelsController < ApplicationController
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
layout "admin"
|
|
|
|
before_filter :authenticate_user!
|
|
|
|
before_filter :is_admin?
|
|
|
|
|
|
|
|
def index
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_models = UserRoleModel.all.entries
|
2011-04-13 10:19:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model = UserRoleModel.find(params[:id])
|
2011-04-13 10:19:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def new
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model = UserRoleModel.new
|
|
|
|
session[:last_page] = get_go_back || admin_user_role_models_url
|
2011-04-13 10:19:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def edit
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model = UserRoleModel.find(params[:id])
|
|
|
|
@i18n_variable = @user_role_model.i18n_variable
|
|
|
|
session[:last_page] = get_go_back || admin_user_role_models_url
|
2011-04-13 10:19:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model = UserRoleModel.new(params[:user_role_model])
|
|
|
|
@user_role_model.save
|
2011-04-13 10:19:51 +00:00
|
|
|
redirect_to :action => :index
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model = UserRoleModel.find(params[:id])
|
|
|
|
@user_role_model.update_attributes(params[:user_role_model])
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
redirect_to :action => :index
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model = UserRoleModel.find(params[:id])
|
|
|
|
@user_role_model.destroy
|
2011-04-13 10:19:51 +00:00
|
|
|
|
2011-02-01 02:46:26 +00:00
|
|
|
@user_role_model.destroy_i18n_variables
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
redirect_to :action => :index
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|