Skip to content

Conversation

@var114
Copy link

@var114 var114 commented Jan 14, 2014

No description provided.

api.rb Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since user can be nil, I think you could just do

@@log << LogRequest.new(time, text, execution_time, user)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(without the if/then)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn’t figure out how to do the last part. I’m going to work on it today…but any tips/hints.
On Jan 14, 2014, at 9:31 AM, Jesse Wolgamott notifications@github.com wrote:

In api.rb:

end

@@log = []

  • def self.log_request(time, text)
  • @@log << LogRequest.new(time, text)
  • end
  • def self.log_request(time, text, execution_time, user=nil)
  • if (user == nil)
  • @@log << LogRequest.new(time, text, execution_time, user=nil)
    (without the if/then)


Reply to this email directly or view it on GitHub.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure --- ok, so you have a user-id already. But now, when I visit "/" I only want to see THOSE items.

get '/hello/:userid' do
  user_id = params[:user_id]
  # return results for only that user
end

Finally -- the sinatra readme is SO MUCH BETTER NOW: http://www.sinatrarb.com/intro.html

@jwo
Copy link
Member

jwo commented Jan 14, 2014

Excellent job on this! 🎉 👍 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants