diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index b841064..96f032d 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -204,7 +204,7 @@ class CmsController < MyProfileController if params[:back_to] == 'control_panel' redirect_to :controller => 'profile_editor', :profile => @profile.identifier elsif params[:back_to] == 'public_view' - redirect_to @article.url.merge(:view => @article.image?) + redirect_to @article.view_url elsif @article.parent redirect_to :action => 'view', :id => @article.parent else @@ -217,7 +217,7 @@ class CmsController < MyProfileController referer.gsub!(/\?.*/, '') unless referer.nil? if (maybe_ssl(url_for(@article.url)).include?(referer)) || (@article == profile.home_page && maybe_ssl(url_for(profile.url)).include?(referer)) @back_to = 'public_view' - @back_url = @article.url.merge(:view => @article.image?) + @back_url = @article.view_url end end diff --git a/app/models/article.rb b/app/models/article.rb index 547bbe1..749df52 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -174,6 +174,10 @@ class Article < ActiveRecord::Base self.profile.url.merge(:page => path.split('/')) end + def view_url + image? ? url.merge(:view => true) : url + end + def allow_children? true end diff --git a/app/models/comment.rb b/app/models/comment.rb index 55be515..f1b90ef 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -36,7 +36,7 @@ class Comment < ActiveRecord::Base end def url - article.url.merge(:anchor => anchor) + article.view_url.merge(:anchor => anchor) end def anchor diff --git a/app/views/content_viewer/_comment_form.rhtml b/app/views/content_viewer/_comment_form.rhtml index c6731c1..f5232ee 100644 --- a/app/views/content_viewer/_comment_form.rhtml +++ b/app/views/content_viewer/_comment_form.rhtml @@ -17,7 +17,7 @@