Skip to content
Browse files

make hearts smaller and redirect to item page on favorite!

  • Loading branch information...
1 parent 6f06fae commit 8d5cd5a4a2021780d019dde2b56d11733bb073b6 @blahed committed
Showing with 8 additions and 4 deletions.
  1. +3 −3 app/assets/stylesheets/application.css
  2. +5 −1 app/controllers/favorites_controller.rb
View
6 app/assets/stylesheets/application.css
@@ -18,10 +18,10 @@
h2 .favorite {
color: #FF50A1;
- font-size: 24px;
+ font-size: 14px;
position: absolute;
- top: 7px;
- left: -30px;
+ top: 3px;
+ left: -25px;
text-decoration: none;
}
View
6 app/controllers/favorites_controller.rb
@@ -12,7 +12,11 @@ def create
@item = get_item
current_user.favorite!(@item)
- redirect_to favorites_path, :notice => "#{@item.title} added to favorites"
+ if params[:item_type] =~ /Account\z/
+ redirect_to [ :accounts, @item ], :notice => "#{@item.title} added to favorites"
+ else
+ redirect_to @item, :notice => "#{@item.title} added to favorites"
+ end
end
def destroy

0 comments on commit 8d5cd5a

Please sign in to comment.
Something went wrong with that request. Please try again.