diff options
author | re4k <re4k@re4k.info> | 2013-04-01 03:59:33 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-04-01 03:59:33 +0900 |
commit | 90d8845257404bb445d7611f9e9c7828ec25dc34 (patch) | |
tree | 6f3d19afa530f4e9d502e55c36d64202c2878ac5 /app/controllers | |
parent | 27bf5349f62ce11763441eb2aa8e69ee10bf9987 (diff) | |
download | aclog-90d8845257404bb445d7611f9e9c7828ec25dc34.tar.gz |
Add importing favs feature(partial: only status_activity).
Refactor models
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/users_controller.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e8ce485..5005000 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,7 +16,7 @@ class UsersController < ApplicationController end end - def recent + def recent @title = "@#{@user.screen_name}'s Recent Best Tweets" render_tweets do case order @@ -116,22 +116,24 @@ class UsersController < ApplicationController def show tweet_id = params[:id].to_i - @items = Tweet.where(:id => tweet_id).page + @item = Tweet.where(:id => tweet_id).first - item = @items.first - raise Aclog::Exceptions::TweetNotFound unless item - @user = item.user + raise Aclog::Exceptions::TweetNotFound unless @item + @user = @item.user + + # import 100 + if params[:import] == "force" && session[:account] + session[:account].import_favorites(@item.id) + end helpers = ApplicationController.helpers - @title = "\"#{helpers.strip_tags(helpers.format_tweet_text(item.text))[0...30]}\" from @#{@user.screen_name}" + @title = "\"#{helpers.strip_tags(helpers.format_tweet_text(@item.text))[0...30]}\" from @#{@user.screen_name}" @title_b = "@#{@user.screen_name}'s Tweet" respond_to do |format| - format.html do - render "shared/tweets" - end + format.html format.json do - render "shared/_tweet", :locals => {:item => item} + render "shared/_tweet", :locals => {:item => @item} end end end |