Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 825 Bytes
1 | class Admin::PreferencesController < ApplicationController |
2 | before_filter :load_user |
3 | |
4 | def initialize |
5 | @controller_name = 'user' |
6 | @template_name = 'preferences' |
7 | end |
8 | |
9 | def show |
10 | set_standard_body_style |
11 | render :edit |
12 | end |
13 | |
14 | def edit |
15 | render |
16 | end |
17 | |
18 | def update |
19 | if valid_params? |
20 | if @user.update_attributes(params[:user]) |
21 | redirect_to :action => 'show' |
22 | else |
23 | flash[:error] = t('preferences_controller.error_updating') |
24 | render :edit |
25 | end |
26 | else |
27 | announce_bad_data |
28 | render :edit |
29 | end |
30 | end |
31 | |
32 | private |
33 | |
34 | def load_user |
35 | @user = current_user |
36 | end |
37 | |
38 | def valid_params? |
39 | hash = (params[:user] || {}).symbolize_keys |
40 | (hash.keys - User.unprotected_attributes).size == 0 |
41 | end |
42 | |
43 | def announce_bad_data |
44 | flash[:error] = 'Bad form data.' |
45 | end |
46 | end |