Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete SeeMore Project -- NinjaParty #10

Open
wants to merge 163 commits into
base: ninjaparty/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
c51ccfd
styles
wangg131 Aug 9, 2015
62d7654
twitter feed displaying all tweets in order. need to reverse it though
wangg131 Aug 9, 2015
4ca0faf
WIP: sessions controller tests, completed sessions#create tests, work…
acmei Aug 9, 2015
783ddfe
completed sessions controller tests
acmei Aug 9, 2015
6dd2a0a
added login required testing for instagrams controller
acmei Aug 9, 2015
a901464
added login required testing for tweetss controller
acmei Aug 9, 2015
285ba7b
fixed search action methods to redirect to search page if no username…
acmei Aug 9, 2015
b9e282c
changing twit class so can call more easily
acmei Aug 9, 2015
6b359c5
Generated TweetPost model, wrote self.find_or_create model method. Pu…
ElsaTKO Aug 9, 2015
e1b2953
Ensure presence of tweet_id foreign key.
ElsaTKO Aug 9, 2015
93cab64
Pseudo-coded plan for implementing tweets saved to db in feed.
ElsaTKO Aug 9, 2015
2996340
added delete#destroy for both tweets and isntagrams controller tests
acmei Aug 9, 2015
fb4c7de
removed extraneous code in instagrams controller
acmei Aug 10, 2015
d67746f
feeds controller tests in progress
acmei Aug 10, 2015
8869cbb
centered feeds#people and added home button to make it easier on us
wangg131 Aug 10, 2015
3825842
Merge pull request #12 from acmei/ig-feed
sallyamoore Aug 10, 2015
dde8f1c
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 10, 2015
78de188
Merge pull request #13 from acmei/rspec
acmei Aug 10, 2015
2376c8d
twitter feed on feed#index
wangg131 Aug 10, 2015
19f5349
mergin
wangg131 Aug 10, 2015
223965c
Merge pull request #14 from acmei/feed-display2
wangg131 Aug 10, 2015
5b6590f
Cleaned up my TweetPosts model comments before pulling in master.
ElsaTKO Aug 10, 2015
8e66a09
Fixed merge conflicts.
ElsaTKO Aug 10, 2015
7bc317d
Merge pull request #15 from acmei/tweets-to-db/edm
Aug 10, 2015
62d0345
end
wangg131 Aug 10, 2015
7531313
Refactoring based on jnf feedback.
ElsaTKO Aug 10, 2015
1e4dd65
Only logged in users can search social people.
ElsaTKO Aug 10, 2015
51886b5
Added uniqueness constraint for join tables (instagram/tweet to user…
sallyamoore Aug 10, 2015
360e46b
fixed syntax error in tweet_post model
acmei Aug 10, 2015
794bf88
Finished fixing problem where you could add the same instagram/twitte…
sallyamoore Aug 10, 2015
39337af
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
sallyamoore Aug 10, 2015
2851ee9
Added image_url to IGPosts, displaying image via db record. Gross que…
ElsaTKO Aug 10, 2015
2f02f61
Fixed merge conflict.
ElsaTKO Aug 10, 2015
cdc5796
reverting to old twitter call in Twit model
acmei Aug 10, 2015
9c9c01a
changing Twit to @twitter.client
acmei Aug 10, 2015
675dba5
WIP fetching tweets from api. Reverting Twitter gem format.
ElsaTKO Aug 10, 2015
fa16434
search people and results styling
wangg131 Aug 10, 2015
2e031a9
Reformatted twitter gem implementation.
ElsaTKO Aug 10, 2015
a89677c
Merge branch 'css' into ninjaparty/master
wangg131 Aug 11, 2015
70b75e2
Saving tweets to db. Hells yes.
ElsaTKO Aug 11, 2015
0d70cc5
Merge pull request #16 from acmei/ig-image-url
Aug 11, 2015
0ebc9ca
Merge pull request #17 from acmei/tweet-posts-db
Aug 11, 2015
2a97d7b
Fixed failing instagrams_controller spec.
sallyamoore Aug 11, 2015
c7f2b93
mergin css
wangg131 Aug 11, 2015
cdc3948
integrated feed with both providers
wangg131 Aug 11, 2015
8e7e781
Added specs for instagram_post and tweet_post models. Cleaned up a co…
sallyamoore Aug 11, 2015
7a4fb96
removed refresh instagram link
acmei Aug 11, 2015
3f92a20
added twitter omniauth
acmei Aug 11, 2015
ede6c89
fixed access token instagram
acmei Aug 11, 2015
3a8b690
Con't working on tests. Also added back '@user &&' to create methods …
sallyamoore Aug 11, 2015
63d49a8
Nothing big here; just preparing to merge in.
sallyamoore Aug 11, 2015
834cb64
fixin feed index with both media posts
wangg131 Aug 11, 2015
d544d7f
Merge pull request #19 from acmei/sm-specs
sallyamoore Aug 11, 2015
5397268
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 11, 2015
6bea55e
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 11, 2015
3745c96
Merge pull request #21 from acmei/omniauth-twitter
acmei Aug 11, 2015
84e8501
Merge pull request #20 from acmei/auto-refresh
acmei Aug 11, 2015
039256c
instagram button back
acmei Aug 11, 2015
1dea492
removed commented out lines
acmei Aug 11, 2015
22d2a8c
fixed error in instagram_posts controller
acmei Aug 11, 2015
ace5d80
refactoring feed from api to querying the db
wangg131 Aug 11, 2015
0b3c42a
slight refactor of feeds#index
wangg131 Aug 11, 2015
5d487ed
merging working feed with both providers
wangg131 Aug 11, 2015
9d665c9
fixing an end tag
wangg131 Aug 11, 2015
66efc94
Merge pull request #18 from acmei/feeds-mergin
wangg131 Aug 11, 2015
fe56b77
feed display
wangg131 Aug 11, 2015
0ba8887
deleting user association with instagramer
acmei Aug 11, 2015
96d480e
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 11, 2015
820557e
fixed merge conflict
acmei Aug 11, 2015
ab0f3a3
removed tweet_posts/instagram_posts controllers, moved methods to fee…
acmei Aug 11, 2015
05a25e6
Merge pull request #22 from acmei/auto-refresh
acmei Aug 11, 2015
202e180
tweet avatar
wangg131 Aug 12, 2015
f0b6391
added follow and delete buttons to nav
wangg131 Aug 12, 2015
2530735
adding social media icons to identify user and post provider type
wangg131 Aug 12, 2015
cec6e51
nav bar styles. color wip
wangg131 Aug 12, 2015
ef79578
moar nav bar stuff
wangg131 Aug 12, 2015
cdbb840
Merge pull request #23 from acmei/tweet-posts
wangg131 Aug 12, 2015
f4a7321
Use VCR to start writing specs that query APIs. Having trouble with t…
sallyamoore Aug 12, 2015
817d884
added posted_at, post_link columns to TweetPosts and InstagramPosts, …
acmei Aug 12, 2015
d3a7689
fixed twitter post_url ref
acmei Aug 12, 2015
770d8d1
changed counts for posts to 15
acmei Aug 12, 2015
3e4e5fd
time zone update
acmei Aug 12, 2015
80d96da
added error messages if no search results found
acmei Aug 12, 2015
4734d02
fixed bug with blank instagram search
acmei Aug 12, 2015
5af301f
Merge pull request #24 from acmei/feeds-controller
acmei Aug 12, 2015
5fff926
Removed airborne from Gemfile.
sallyamoore Aug 12, 2015
7e4a489
Started feeds controller tests, stuck on api request.
ElsaTKO Aug 12, 2015
7892744
Fixed merge conflicts.
ElsaTKO Aug 12, 2015
64eccde
Resolves merge conflicts.
sallyamoore Aug 12, 2015
753ac5c
Merge pull request #25 from acmei/vcr-tryout
sallyamoore Aug 12, 2015
17a3ac5
Added refresh button to feed.
ElsaTKO Aug 12, 2015
8f0edf3
Fixed merge conflicts.
ElsaTKO Aug 12, 2015
07fcde4
stylin feed#index
wangg131 Aug 12, 2015
ed69289
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
wangg131 Aug 12, 2015
a2884d4
Tuned button states and feed edges.
ElsaTKO Aug 12, 2015
d179eb9
Merge pull request #26 from acmei/refresh-button
Aug 12, 2015
9572386
find user in feeds#search
wangg131 Aug 12, 2015
c99d759
Got some of the instagram post tests to work in feeds_controller_spec.
sallyamoore Aug 12, 2015
173bf21
styling links
wangg131 Aug 12, 2015
dd65a12
add people if not stalking already
wangg131 Aug 12, 2015
6f4c1a2
added testing for instagrams/tweets controller methods
acmei Aug 12, 2015
738d8a1
added twitter omniauth tests
acmei Aug 12, 2015
e49f4eb
Merge pull request #27 from acmei/rspec-controllers
acmei Aug 12, 2015
9004efa
styling and centering
wangg131 Aug 12, 2015
0eef6ae
merge
wangg131 Aug 12, 2015
0a6fc32
stragglin merge conflicts fixed
wangg131 Aug 12, 2015
89e13bb
all major styling issues seems to be done
wangg131 Aug 12, 2015
7e1c2e0
WIP - trying to get specs for #tweet_post_create to work.
sallyamoore Aug 12, 2015
b39c846
minor end div
wangg131 Aug 12, 2015
a9bbc1d
Fixed problem with tweet post spec.
sallyamoore Aug 12, 2015
5602f0e
updated tweet controller spec with new factory info.
sallyamoore Aug 12, 2015
6c9c1e3
resolves merge conflicts with master.
sallyamoore Aug 12, 2015
18e8aed
Merge pull request #28 from acmei/sm-vcr-specs
sallyamoore Aug 12, 2015
c141cb5
back to top link
wangg131 Aug 12, 2015
c6a775a
Merge branch 'wang-8-12' into ninjaparty/master
wangg131 Aug 12, 2015
5713bf5
updating specs after merging. Added model validations that were missi…
sallyamoore Aug 12, 2015
6a34c13
forgot to save this and put it in the last commit
sallyamoore Aug 12, 2015
18b30a6
feeds#search test
wangg131 Aug 12, 2015
fe67c0a
added logging in with twitter tests for user model
acmei Aug 12, 2015
b602b66
removed extraneous code
acmei Aug 12, 2015
a921bbb
Adds unless production line to omniauth.rb for the developer strategy.
sallyamoore Aug 12, 2015
7c484d0
Resolves merge conflicts.
sallyamoore Aug 12, 2015
0e3958e
Fixed failing test.
sallyamoore Aug 12, 2015
46d9a44
Doesn't display dev login button in production (maybe). We can't test…
sallyamoore Aug 12, 2015
ada9396
removed rescue from SQLite error
acmei Aug 12, 2015
e1e665c
squash bug where it throws an error if ig user is private or has no p…
sallyamoore Aug 13, 2015
e4aa0a8
fixing google font and commenting out SQLite refrence
acmei Aug 13, 2015
f202189
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 13, 2015
d9b8090
make dev login link not show in production (again).
sallyamoore Aug 13, 2015
ded3826
dev login won't appear in production... for realz this time.
sallyamoore Aug 13, 2015
fdae059
ok, that last commit partly hid the dev login in production, and this…
sallyamoore Aug 13, 2015
f1434f0
fixing the thing some more.
sallyamoore Aug 13, 2015
8dfb49e
centering stuff
wangg131 Aug 13, 2015
46a6ff0
Merge branch 'centering' into ninjaparty/master
wangg131 Aug 13, 2015
2849517
fixed instagram search page to center
wangg131 Aug 13, 2015
35883bf
removed reference to SQLite error by adding conditional to create met…
acmei Aug 13, 2015
6e77d23
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 13, 2015
38ba0ef
centered search people for ig & twittter, and for unfollowing people
wangg131 Aug 13, 2015
257d9e7
Merge branch 'styles-dont-save' into ninjaparty/master
wangg131 Aug 13, 2015
2114ed0
ninja photo on blank pages, more styling, made headers black
wangg131 Aug 13, 2015
bd1a7bf
Merge branch 'styles-dont-save' into ninjaparty/master
wangg131 Aug 13, 2015
40db40a
Private users on ig return error; private users on twitter do not app…
sallyamoore Aug 13, 2015
84a7023
Clicking on the ninja returns you to the homepage.
sallyamoore Aug 13, 2015
1f3184b
changed time display
acmei Aug 13, 2015
2d660a0
Added fun if trying dev login on production... test.
ElsaTKO Aug 13, 2015
9d0a832
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
ElsaTKO Aug 13, 2015
87f6af4
Fixed scrolling issue.
ElsaTKO Aug 13, 2015
8f8189b
404 page testing
acmei Aug 13, 2015
4e209f1
removed 404 page edits
acmei Aug 13, 2015
e306561
Stripped white space from instagram user searches.
ElsaTKO Aug 13, 2015
26ac723
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
ElsaTKO Aug 13, 2015
310e83e
added custom error messages
acmei Aug 13, 2015
b899626
files generated for errors controller
acmei Aug 13, 2015
d6c0ba4
Refactor and fixing specs.
sallyamoore Aug 13, 2015
021a72c
Merge pull request #29 from acmei/404
acmei Aug 13, 2015
8000943
Merge pull request #30 from acmei/sm-feeds-index
sallyamoore Aug 13, 2015
887a940
removed gsub for instagram params
acmei Aug 13, 2015
856bdfb
Revert "Refactor and fixing specs."
sallyamoore Aug 13, 2015
a2cf0b6
Merge pull request #31 from acmei/revert-30-sm-feeds-index
sallyamoore Aug 13, 2015
38c954d
Added instagram access token to all logins other than instagram. Also…
sallyamoore Aug 13, 2015
4db538e
Added back refactor in feeds#index. Took binding.pry out of instagram…
sallyamoore Aug 13, 2015
64a1e69
fixed merge conflicts
sallyamoore Aug 13, 2015
e4bb4cb
Merge branch 'ninjaparty/master' of github.com:acmei/C3Projects--SeeM…
acmei Aug 14, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
coverage
.DS_Store
.env

# Ignore vcr spec directory because it contains SECRETS!
spec/vcr/*
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ gem 'httparty'
# OmniAuth Gems
gem 'omniauth'
gem 'omniauth-instagram'
gem 'omniauth-twitter'

# OAuth
gem 'twitter'
Expand Down Expand Up @@ -72,6 +73,14 @@ group :development, :test do

# Test coverage
gem 'simplecov', require: false

# VCR for API requests
gem 'vcr', '~> 2.9.3'

end

group :test do
gem 'webmock'
end

group :production do
Expand Down
17 changes: 17 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ GEM
execjs
coffee-script-source (1.9.1.1)
columnize (0.9.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
debug_inspector (0.0.2)
diff-lcs (1.2.5)
docile (1.1.5)
Expand Down Expand Up @@ -115,6 +117,7 @@ GEM
naught (1.0.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
oauth (0.4.7)
oauth2 (1.0.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0)
Expand All @@ -127,9 +130,15 @@ GEM
omniauth-instagram (1.0.1)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.0)
omniauth-oauth (1.1.0)
oauth
omniauth (~> 1.0)
omniauth-oauth2 (1.3.1)
oauth2 (~> 1.0)
omniauth (~> 1.2)
omniauth-twitter (1.2.1)
json (~> 1.3)
omniauth-oauth (~> 1.1)
pg (0.18.2)
pry (0.10.1)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -183,6 +192,7 @@ GEM
rspec-mocks (~> 3.3.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
safe_yaml (1.0.4)
sass (3.4.16)
sass-rails (5.0.3)
railties (>= 4.0.0, < 5.0)
Expand Down Expand Up @@ -229,11 +239,15 @@ GEM
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
vcr (2.9.3)
web-console (2.2.1)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
webmock (1.21.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)

PLATFORMS
ruby
Expand All @@ -251,6 +265,7 @@ DEPENDENCIES
jquery-rails
omniauth
omniauth-instagram
omniauth-twitter
pg
pry-rails
rails (= 4.2.3)
Expand All @@ -263,7 +278,9 @@ DEPENDENCIES
turbolinks
twitter
uglifier (>= 1.3.0)
vcr (~> 2.9.3)
web-console (~> 2.0)
webmock

BUNDLED WITH
1.10.6
Binary file added app/assets/images/bamboo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/bamboo2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
197 changes: 193 additions & 4 deletions app/assets/stylesheets/custom.css.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@

@import "bootstrap-sprockets";
@import "bootstrap";

// body

// .jumbotron {
// background: image-url("notso-2.png") no-repeat;
// padding-bottom: 150px;
// margin-bottom: 100px;
// }

body {
background: image-url("bamboo.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-size: 16px;
height: 100%;
vertical-align: middle;
}

.content {
padding-top: 35px;
// background: image-url("notso-2.png") no-repeat;
}

.center {
Expand All @@ -12,10 +31,180 @@
float: none;
}

.header {
font-size: 60px;
.container {
height: 100%;
}

.feed {
margin: 20px auto;
background-color: rgba(0,0,0,.7);
background-repeat: repeat;
width: 500px;
padding: 10px 10px;
}


// typography

h1 {
font-size: 6em;
}

a:hover {
h1, h2, h3, h4, .page-links a,{
font-family: 'Orbitron', sans-serif;
text-align: center;
color: #000;

}

.no-targets a, .navbar-default .navbar-text,
.navbar-default .navbar-nav > li > a {
font-family: 'Orbitron', sans-serif;
text-align: center;
color: rgb(255,255,255);
}

.navbar {
margin-bottom: 0;
width: 100%;
}

.navbar-inverse, .error-message {
background-color: rgba(0,0,0,.5);
border: none;
font-family: 'Orbitron', sans-serif;
}

.page-links a:hover, .no-targets a:hover {
text-decoration: none;
color: #F00;
}

.search-header {
margin-top: 20px;
font-family: 'Orbitron', sans-serif;
text-align: center;
color: #000;
font-size: 1.5em;
}

.tweet-post a:hover {
color: #F00;
text-decoration: none;
}

.posted-at {
font-size: 0.7em;
font-style: italic;
}

// search results

.search-results {
padding-top: 30px;
}

.well {
background-color: rgba(0,0,0,.7);
text-align: center;
padding: 5px;
width: 240px;
margin: 10px;
font-size: 14px;
color: rgb(255,255,255);
}

.row-centered {
text-align:center;
}
.col-centered {
display:inline-block;
float:none;
}

// photos & icons

.photo-size {
width: 72px;
}

.ninja {
position: fixed;
left: 50px;
bottom: 100px;
}

.avatar {
width: 50px;
padding-top: 0;
float: left;
}

.shift-left {
padding-right: 70px;
}

.twitter {
margin-top: 10px;
}

.left {
float: left;
}

.ig-icon{
margin-right: 20px;
}

.twitter-icon {
margin-left: 10px;
}

.ig_image {
width: 250px;
}

.login-header {
padding-top: 30px;
}

.page-links {
font-size: 1em;
}

.error-message {
max-width: 75%;
color: #F00;
border-radius: 10%;
margin: 0 auto;
letter-spacing: 2px;
}

/* accessing developer strategy in production env */
.animated {
-webkit-animation-duration: 3s;
animation-duration: 3s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
}

@-webkit-keyframes hinge {
0% { -webkit-transform: rotate(0); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
20%, 60% { -webkit-transform: rotate(80deg); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
40% { -webkit-transform: rotate(60deg); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
80% { -webkit-transform: rotate(60deg) translateY(0); opacity: 1; -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
100% { -webkit-transform: translateY(700px); opacity: 0; }
}
@keyframes hinge {
0% { transform: rotate(0); transform-origin: top left; animation-timing-function: ease-in-out; }
20%, 60% { transform: rotate(80deg); transform-origin: top left; animation-timing-function: ease-in-out; }
40% { transform: rotate(60deg); transform-origin: top left; animation-timing-function: ease-in-out; }
80% { transform: rotate(60deg) translateY(0); opacity: 1; transform-origin: top left; animation-timing-function: ease-in-out; }
100% { transform: translateY(700px); opacity: 0; }
}
.hinge {
-webkit-animation-name: hinge;
animation-name: hinge;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Place all the styles related to the InstagramPosts controller here.
// Place all the styles related to the Errors controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
29 changes: 27 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'twitter'
require 'twit'

class ApplicationController < ActionController::Base
Expand All @@ -12,16 +11,42 @@ class ApplicationController < ActionController::Base
no_username: "There's no user by that name. Search again.",
success: "Success!",
follow_error: "Oops. Something went wrong.",
login_required: "You have to be logged in to do that!"
login_required: "You have to be logged in to do that!",
target_eliminated: "Target eliminated!",
already_following_error: "Oops! You are already following that person."
}

def twit
@twitter ||= Twit.new
end

private

def require_login
unless session[:user_id]
redirect_to root_path, flash: { error: MESSAGES[:login_required] }
end
end

def already_following
params[:instagram] = nil
params[:tweet] = nil

flash.now[:error] = MESSAGES[:already_following_error]
render "feeds/search"
end

def private_ig_user(response)
params[:instagram] = nil

flash[:error] = "This user is private: " + response["meta"]["error_message"]
render "feeds/search"
end

def private_twitter_user(response)
params[:twitter] = nil

flash[:error] = "This user is private: " + response["meta"]["error_message"]
render "feeds/search"
end
end
22 changes: 22 additions & 0 deletions app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class ErrorsController < ApplicationController
def file_not_found
respond_to do |format|
format.html { render template: 'errors/file_not_found', layout: 'layouts/application', status: 404 }
format.all { render nothing: true, status: 404 }
end
end

def unprocessable
respond_to do |format|
format.html { render template: 'errors/unprocessable', layout: 'layouts/application', status: 422 }
format.all { render nothing: true, status: 422}
end
end

def internal_server_error
respond_to do |format|
format.html { render partial: 'errors/internal_server_error', layout: 'layouts/application', status: 500 }
format.all { render nothing: true, status: 500}
end
end
end
Loading