Sha256: 5b0f1ceaa87ac22f7d1873e9cd90d7907f2143699328be0b3bef0ea193d440f1
Contents?: true
Size: 1.05 KB
Versions: 15
Compression:
Stored size: 1.05 KB
Contents
class Admin::PreferencesController < AdminController layout 'admin' def index @preferences = Preference.sys(_sid).all end def show @preference = Preference.find_sid_id(_sid, params[:id]) end def new @preference = Preference.new end def create @preference = Preference.new(params[:preference]) @preference.system_id = _sid if @preference.save redirect_to [:admin, @preference], :notice => "Successfully created preference." else render :action => 'new' end end def edit @preference = Preference.find_sid_id(_sid, params[:id]) end def update @preference = Preference.find_sid_id(_sid, params[:id]) if @preference.update_attributes(params[:preference]) redirect_to [:admin, @preference], :notice => "Successfully updated preference." else render :action => 'edit' end end def destroy @preference = Preference.find_sid_id(_sid,params[:id]) @preference.destroy redirect_to admin_preferences_url, :notice => "Successfully destroyed preference." end end
Version data entries
15 entries across 15 versions & 1 rubygems