Skip to content
This repository has been archived by the owner on Jun 26, 2022. It is now read-only.

Commit

Permalink
Change to fit TINAMI gem version up
Browse files Browse the repository at this point in the history
  • Loading branch information
rummelonp committed Feb 16, 2014
1 parent 4679402 commit 983d1f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ class ApplicationController < ActionController::Base
def client
return @client if @client
if authenticated?
@client = TINAMI.client(auth_key: session[:auth_key])
@client = TINAMI.new(auth_key: session[:auth_key])
else
@client = TINAMI.client
@client = TINAMI.new
end

@client
Expand Down
9 changes: 1 addition & 8 deletions app/controllers/index_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ def ranking
end

def search
query_string = client.send(:keys_params).merge(page_params).map {|k, v|
if v.is_a? Array
v.map {|w| "#{k.to_s}[]=#{CGI.escape(w.to_s)}"}.join('&')
else
"#{k.to_s}=#{CGI.escape(v.to_s)}"
end
}.join('&')
data = client.get("/content/search?#{query_string}")
data = client.search(params)
@contents = data.contents
end

Expand Down

0 comments on commit 983d1f1

Please sign in to comment.