RailsCasts Pro episodes are now free!

Learn more or hide this

Leonel Santos's Profile

GitHub User: leonels

Comments by Leonel Santos

Avatar

I tried restarting Unicorn and nginx hoping Unicorn will notice the new gems, but it wouldn't work. It seems that you have to STOP unicorn, then START it again, it worked for me.

Avatar

I get ArgumentError: wrong number of arguments (1 for 0) for this call:

ruby
first = date.beginning_of_month.beginning_of_week(START_DAY)

If I try it in the console it also gives me the same error. Date.today.beginning_of_month.beginning_of_week(:sunday)

Avatar

How did you make the HTML entities appear? I'm guessing you didn't used simple_format.

Avatar

Nevermind, simple mistake. Just had to change get "dashboard/index" to get "dashboard/index" => 'dashboard#index'. I would like to delete my comment but I can't access a delete button.

Avatar

I have followed all instructions and even copy/paste-d to make sure I made no mistakes. I'm at 6:16, right after adding default_url_options in the application controller and keep getting the same error when restarting the server.

ruby
gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/routing/mapper.rb:177:in `default_controller_and_action': missing :controller (ArgumentError)

whyyy?

Avatar

Two questions: 1) how to display debug current_user. I went inside the gem and tried to insert it on the views but it doesn't display anything. 2) how to preset a value in the controller. I already tried in the regular controller and in the active admin controller override and it doesn't work: something like @website.user_id = current_user.id

Avatar

I get same error. I even tried running the query from the console and I get nil.

ruby
User.find_by_auth_token("774d073fc2c48a8f18582c8efd1f0621")
  User Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."auth_token" = '774d073fc2c48a8f18582c8efd1f0621' LIMIT 1
 => nil 

I try find_by_email or find_by_first_name and it works. Only when running find_by_auth_token it returns nil.