This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for(@hash_create, :url => hashtags_path, :validate => :hashtag_validators, remote: true) do |f| %> | |
<div class="input-prepend input-append"> | |
<span class="add-on swag">#</span> | |
<%= f.text_field :hashtag ,class: "span4 swag_text_field", id:"appendedPrependedInput", data: {autocomplete_source: autocomplete_index_path} %> | |
<%= f.submit "VS!", class: "btn add-on-right swag_button" %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create | |
@hash_create = Hashtag.create_hashtag(params[:hashtag]) | |
Hashlog.create_hashlog(params[:hashtag]) | |
@random_hashtag_pull = Hashtag.random_hashtags_pull | |
@leaderboard = Hashtag.leaderboard_history_current | |
respond_to do |format| | |
if @hash_create | |
format.html { redirect_to root_path } | |
format.js | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_hashtag(hashtag) #creates new tweetvstweet for inputed hashtag with # for guests | |
dash = "#" | |
@hashtag_scrubbed = [dash, hashtag].join.downcase | |
if User.current_user | |
User.current_user.twitter.search("%#{@hashtag_scrubbed}", :lang => "en", :count => 100, :result_type => "mixed").results.map do |tweet| | |
unless exists?(tweet_id: tweet.id) | |
create!( | |
tweet_id: tweet.id, | |
text: tweet.text, | |
profile_image_url: tweet.user.profile_image_url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Completed 500 Internal Server Error in 772ms | |
NoMethodError (undefined method `+' for nil:NilClass): | |
app/models/hashlog.rb:24:in `create_hashlog' | |
app/controllers/hashtags_controller.rb:32:in `create' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag(hashtags_path, :method => :vote) do %> | |
<div id="hashtags" class="twitter-hashtag-voting-block-v1"> | |
<% @random_hashtag_pull.each do |hashtag| %> | |
<div class="span4 twitter-spans-v1" id="<%= hashtag.id %>"> | |
<div id="tweet-block-v1" class="hashtag-tweet-database-container"> | |
<div class="tweet-block-border-v1"> | |
<div class="tweet-block-spacing-v1"> | |
<div class="twitter-block-author-v1"> | |
<a class="twitter-block-user-v1" target="_blank" href="https://twitter.com/<%= hashtag.from_user %>"> | |
<span class="twitter-author-image-v1"><img alt="" class="twitter-author-image-photo-v1" src="<%= hashtag.profile_image_url %>"></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Completed 500 Internal Server Error in 299ms | |
ActionView::Template::Error (undefined method `+' for nil:NilClass): | |
1: <div id="hashtags" class="twitter-hashtag-voting-block-v1"> | |
2: <% @random_hashtag_pull.each do |hashtag| %> | |
3: <div class="span4 twitter-spans-v1" id="<%= hashtag.id %>"> | |
4: <div id="tweet-block-v1" class="hashtag-tweet-database-container"> | |
5: <div class="tweet-block-border-v1"> | |
app/models/hashtag.rb:46:in `update_view_count' | |
app/views/shared/_vote_tweets.html.erb:2:in `_app_views_shared__vote_tweets_html_erb__2738953379660121418_70243350609340' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started POST "/hashtags" for 127.0.0.1 at 2012-12-02 22:41:48 -0800 | |
Processing by HashtagsController#create as JS | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"knGCscj0fV+LfVsi0mXKrmRtK+g8mog6kRrOH6XSEmo=", "hashtag"=>"#tweetvstweet", "commit"=>"Swag!"} | |
Hashtag Exists (0.3ms) SELECT 1 AS one FROM "hashtags" WHERE "hashtags"."tweet_id" = 274371071875108864 LIMIT 1 | |
Hashtag Exists (0.3ms) SELECT 1 AS one FROM "hashtags" WHERE "hashtags"."tweet_id" = 273165002188390400 LIMIT 1 | |
Hashtag Load (0.3ms) SELECT "hashtags".* FROM "hashtags" WHERE "hashtags"."hashtag" ILIKE []("params"."hashtag") LIMIT 12 | |
PG::Error: ERROR: syntax error at or near "[" | |
LINE 1: ...FROM "hashtags" WHERE "hashtags"."hashtag" ILIKE []("params... | |
^ | |
: SELECT "hashtags".* FROM "hashtags" WHERE "hashtags"."hashtag" ILIKE []("params"."hashtag") LIMIT 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @random_hashtags.each do |hashtag| %> | |
<div class="span4 twitter-spans-v1"> | |
<div id="tweet-block-v1" class="hashtag-tweet-database-container"> | |
<div class="tweet-block-border-v1"> | |
<div class="tweet-block-spacing-v1"> | |
<div class="twitter-block-author-v1"> | |
<a class="twitter-block-user-v1" target="_blank" href="https://twitter.com/<%= hashtag.from_user %>"> | |
<span class="twitter-author-image-v1"><img alt="" class="twitter-author-image-photo-v1" src="<%= hashtag.profile_image_url %>"></span> | |
<span class="twitter-author-name-v1"><%= hashtag.from_user_name %></span> | |
<span class="twitter-author-nickname-v1">@<%= hashtag.from_user %></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Second Run - Passing through the :hashtag param of #espn - but its still entering #google and running the Model with #google | |
Started POST "/hashtags" for 127.0.0.1 at 2012-12-01 19:56:11 -0800 | |
Processing by HashtagsController#create as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"S+zHymXZNf8MeCxbtHqPIr+n4KEXj7XUQzZQoUWCTus=", "hashtag"=>"#espn", "commit"=>"Swag!"} | |
Hashtag Exists (0.2ms) SELECT 1 AS one FROM "hashtags" WHERE "hashtags"."tweet_id" = 275085566339608576 LIMIT 1 | |
(0.2ms) BEGIN | |
SQL (0.4ms) INSERT INTO "hashtags" ("created_at", "from_user", "hashtag", "profile_image_url", "text", "tweet_id", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["created_at", 2012-12-01 19:54:44 -0800], ["from_user", "PascalC"], ["hashtag", "#google"], ["profile_image_url", "http://si0.twimg.com/profile_images/584147642/voilier_normal.jpg"], ["text", "RT @allthingsd: Google’s SEM Platform is Mediocre, Which is Fine… for Google http://t.co/3AMMvS2w #kenshoo #Google"], ["tweet_id", 27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveModel::MassAssignmentSecurity::Error in HashtagsController#create | |
Can't mass-assign protected attributes: content, profile_image, screen_name, tweet_date |
NewerOlder