Keith

Age: 25

Jul
24
comment How do I use Ruby refinements inside Rails Controller/Action?
What version of ruby are you using? In Ruby 2.0, the docs aren't as explicit about where the 'using' clause may be placed. Here are the 2.0 docs: ruby-doc.org/core-2.0.0/doc/syntax/refinements_rdoc.html
Jul
24
answered How do I use Ruby refinements inside Rails Controller/Action?
Jul
24
awarded Informed
Jul
24
comment Finding closest ancestor
Can you post your current code you've tried?
Jul
23
comment In Rails what is the best way to get global data for specific user?
If this information can change, on the request that updates the information you can update the information in the session as well? If it's not that simple and there are other factors that update this information, maybe having some check in a before filter to check for updates is the best solution?
Jul
23
comment In Rails what is the best way to get global data for specific user?
Would storing this information in the session hash be acceptable?
Jun
13
awarded Yearling
Jun
13
awarded Yearling
Jun
13
comment Redirecting to edit_profile after devise sign up
Sorry I read it wrong initially. Do you want users to have just one profile or multiple profiles? If you want a user to have just one profile, you'll want to update your routes to say 'resource profile' instead of 'resources profiles'. See guides.rubyonrails.org/routing.html#singular-resources. The edit_user_profile_path(resource) should work after that.
Jun
11
comment How to differentiate these definition ? how to understand them in order to remember .
A similar question: stackoverflow.com/q/859634/1290374
Jun
11
answered highlight only works when in the first tab/window
Jun
11
comment highlight only works when in the first tab/window
You should be able to add the other type of files right in there: au BufNewFile, BufRead *.cpp,*.hpp,*.ipp ...
Jun
11
answered Redirecting to edit_profile after devise sign up
Jun
6
comment Different values for Time.now when using activerecord
Then the sql generated is correct. ActiveRecord is converting from local time to UTC before executing the statement on the database in order to be consistent with how the data is stored.
Jun
6
comment Array or array element in C?
The book's text is speaking in terms of 0 indexed to match the code.
Jun
6
comment Different values for Time.now when using activerecord
how are the values stored in your database, local time or UTC?
May
23
awarded Nice Answer
Dec
23
comment How :remote => true works in rails
Here is a good reference that helps break things down: alfajango.com/blog/rails-3-remote-links-and-forms
Oct
8
awarded Enthusiast
Sep
11
comment What's wrong with my delete method in Rails?
a side note, link_to :method => :delete will only create the expected result if javascript is enabled, as the javascript dynamically creates a form and submits it. If you want to always ensure a POST request is sent, use the button_to helper instead.
1 2