Permalink
Browse files

Tweak routing and page flow

  • Loading branch information...
1 parent 0e12a43 commit b701bcee0e92f71f573b4cd6897e61a90c480bd1 @rwdaigle committed Oct 5, 2012
@@ -14,6 +14,6 @@ def search
def refresh
QC.enqueue("GistFetcher.fetch", current_user.id)
- redirect_to gists_path
+ redirect_to search_gists_path
end
end
@@ -12,6 +12,6 @@ def logout
def create
user = User.authenticate(request.env['omniauth.auth'])
log_in_user(user.id)
- redirect_to gists_path
+ redirect_to search_gists_path
end
end
@@ -36,6 +36,7 @@ def update_search_indices(user)
log({ns: self, fn: __method__}, user) do
user.gists.each { |gist| gist.update_index }
end
+ Gist.tire.index.refresh
end
private
@@ -1,5 +1,6 @@
%h4 Hi there
+%p Gisted lets you quickly get to your gists via search. You will need to log into GitHub via OAuth first.
-%p= link_to "My gists", gists_path
+%p= link_to "Search my gists", search_gists_path
%p= link_to "Login", login_path
%p= link_to "Logout", logout_path
View
@@ -7,9 +7,13 @@
match '/logout', to: 'sessions#logout', :as => :logout
match '/auth/github/callback', to: 'sessions#create', :via => [:post, :get], :as => :github_auth_callback
- resources :gists do
+ # Though this was an option at one time?
+ all = [:index, :show, :new, :create, :edit, :update, :destroy]
+
+ resources :gists, :except => all do
collection do
post 'refresh'
+ get 'refresh'
get 'search'
end
end

0 comments on commit b701bce

Please sign in to comment.