diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7a033b3..972d944 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -22,6 +22,7 @@ stored_location_for(resource) || root_path end end + rescue_from CanCan::AccessDenied do |exception| if user_signed_in? @@ -37,6 +38,7 @@ end + def get_theme if ThemesForRails.available_theme_names.include?(params[:theme]) params[:theme] diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb index c18ce41..1b3c444 100755 --- a/app/views/neuigkeiten/show.html.erb +++ b/app/views/neuigkeiten/show.html.erb @@ -1,8 +1,13 @@ <%= content_for :header do %> Fetsite - <%= @neuigkeit.title %> (<%= @neuigkeit.rubrik.name %>) <% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %> +<% unless @neuigkeit.picture.url.nil? + picture_url=URI(root_url) + picture_url.path=@neuigkeit.picture.url +end +%> <% set_meta_tags :og => { - :image => image_url(@neuigkeit.picture.to_s,:theme=>nil), + :image => picture_url.to_s, :title => @neuigkeit.title.to_s + " (" + @neuigkeit.rubrik.name.to_s + ")", :type => "article", :description =>@neuigkeit.text_first_words,