fixing up public image show

This commit is contained in:
maxwell 2010-12-03 15:48:27 -08:00
parent f4fa3191bc
commit b8ece9381a
3 changed files with 14 additions and 6 deletions

View file

@ -10,9 +10,17 @@ class PostsController < ApplicationController
def show def show
@post = Post.first(:id => params[:id], :public => true) @post = Post.first(:id => params[:id], :public => true)
@landing_page = true
if @post if @post
render "posts/#{@post.class.to_s.underscore}", :layout => true @landing_page = true
@person = @post.person
if @person.owner_id
I18n.locale = @person.owner.language
render "posts/#{@post.class.to_s.underscore}", :layout => true
else
flash[:error] = "that post does not exsist!"
redirect_to root_url
end
else else
flash[:error] = "that post does not exsist!" flash[:error] = "that post does not exsist!"
redirect_to root_url redirect_to root_url

View file

@ -6,10 +6,10 @@
= include_javascripts :photos = include_javascripts :photos
#author_info #author_info
= person_image_link(@post.person) = person_image_link(@person)
.from .from
%h2 %h2
= @post.person.name = @person.name
.span-14.append-1.last .span-14.append-1.last
#show_photo{:data=>{:guid=>@post.id}} #show_photo{:data=>{:guid=>@post.id}}
= image_tag @post.url(:scaled_full) = image_tag @post.url(:scaled_full)

View file

@ -3,10 +3,10 @@
-# the COPYRIGHT file. -# the COPYRIGHT file.
#author_info #author_info
= person_image_link(@post.person) = person_image_link(@person)
.from .from
%h2 %h2
= @post.person.name = @person.name
.span-14.append-1.last .span-14.append-1.last
#show_text #show_text