Skip to content
Extraits de code Groupes Projets
Valider a7c6e22e rédigé par Daniel Vincent Grippi's avatar Daniel Vincent Grippi
Parcourir les fichiers

DG RS; passing around params[:aspect]. querying in application controller for current aspect.

parent 01b14a66
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -36,7 +36,12 @@ class ApplicationController < ActionController::Base
def set_friends_and_status
if current_user
@aspect = :all
if params[:aspect] == 'all' || params[:aspect] == nil
@aspect = :all
else
@aspect = current_user.aspect_by_id( params[:aspect])
end
@aspects = current_user.aspects
@friends = current_user.friends
end
......
......@@ -23,8 +23,8 @@ module ApplicationHelper
@aspect != :all && @aspect.id == aspect.id
end
def object_path(object)
eval("#{object.class.to_s.underscore}_path(object)")
def object_path(object, opts = {})
eval("#{object.class.to_s.underscore}_path(object, opts)")
end
def object_fields(object)
......
......@@ -17,17 +17,16 @@
-#
.album{:id => post.id, :class => ("mine" if current_user.owns?(post))}
%div.name
= link_to post.name, object_path(post)
= link_to post.name, object_path(post, :aspect => params[:aspect])
%div.time
by
= link_to ((current_user.person == post.person)? 'you' : post.person.real_name), person_path(post.person)
%br
= link_to(how_long_ago(post), object_path(post))
= link_to(how_long_ago(post), object_path(post, :aspect => params[:aspect]))
%div.image_cycle
- for photo in post.photos[0..3]
= link_to (image_tag photo.url(:thumb_large)), album_path(post)
= link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => params[:aspect])
......@@ -24,7 +24,7 @@
});
= content_for :page_title do
= link_to "◂ Home", aspects_path
= link_to "◂ Home", aspects_path, :aspect => params[:aspect]
- content_for :left_pane do
= render "shared/aspect_friends"
......
......@@ -25,7 +25,7 @@
});
= content_for :page_title do
= link_to "◂ Albums", albums_path
= link_to "◂ Albums", albums_path(:aspect => @aspect)
- content_for :left_pane do
= render "shared/aspect_friends"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter