Commit da9bf73dd673df50ea10dc2a3521d93555302ae2
1 parent
c8036845
Exists in
master
and in
27 other branches
[template-welcome-page] Add back_to to welcome_page edition
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/profile_editor_controller.rb
... | ... | @@ -4,6 +4,7 @@ class ProfileEditorController < MyProfileController |
4 | 4 | protect 'destroy_profile', :profile, :only => [:destroy_profile] |
5 | 5 | |
6 | 6 | before_filter :access_welcome_page, :only => [:welcome_page] |
7 | + before_filter :back_to | |
7 | 8 | helper_method :has_welcome_page |
8 | 9 | |
9 | 10 | def index |
... | ... | @@ -108,4 +109,9 @@ class ProfileEditorController < MyProfileController |
108 | 109 | render_access_denied |
109 | 110 | end |
110 | 111 | end |
112 | + | |
113 | + #TODO Consider using this as a general controller feature to be available on every action. | |
114 | + def back_to | |
115 | + @back_to = params[:back_to] || request.referer | |
116 | + end | |
111 | 117 | end | ... | ... |
app/views/profile_editor/welcome_page.html.erb