RailsCasts Pro episodes are now free!

Learn more or hide this

Andrew S's Profile

GitHub User: andrewsyd

Comments by Andrew S

Avatar

For some reason when I click to confirm subscription at the very end, I get an "Unknown action.. The action 'update' could not be found for SubscriptionsController" error.

So on subscriptions#create, it's actually trying to point to the non-existent subscriptions#update. Any ideas why??

Avatar

Could someone please help me? I'm stuck early on in this Railscast. I cannot seem to get searching with multiple words working (as at approx 02:15 in the video) even though I am using the exact same code as below:

ruby
def self.text_search(query)
  if query.present?
    where("name @@ :q or content @@ :q", q: query)
  else
    scoped
  end
end

Single word searches work fine, just not two or more. I'm not getting any errors, just no results are returned. Any ideas why this could possibly be?

Avatar

If I'm using hstore and implementing the shirt_sizes example, how would I go about "handling the serialization manually" as suggested?

Avatar

I am also trying to work out how to use hstore with a multi tenant app. Any help would be appreciated!

Avatar

I'm getting the following error when I load any page of my app:

undefined method `scope_schema' for nil:NilClass

Any rough idea as to why this is?

Avatar

I'm pretty much a noobie when it comes to writing jQuery and am trying to fade out an item as it is deleted. I have tried the following in my destroy.js.erb file - the item is deleted but does not fade away so stays on the page until the page is reloaded.

ruby
$('#item_div').fadeOut("500").remove()

If I take out the fadeOut part, it successfully disappears from the page.

Would someone mind pointing me in the right direction?

Avatar

Just stumbled upon the solution: get rid of webrat from your Gemfile.

Fixed many other testing issues too.

Avatar

I ended up fixing this by rolling back my migrations and then migrating again. Anyone know why this would be necessary??

Avatar

I'm new to rails, stumbling along! I've followed this tutorial and #274 but am now getting a failed example that I can't work out:

''' ruby
Guard is now watching at '/Users/andrew/Sites/app_name'
Guard::RSpec is running, with RSpec 2!
Running all specs
DEPRECATION WARNING: ActiveRecord::Associations::AssociationCollection is deprecated! Use ActiveRecord::Associations::CollectionProxy instead. (called from at /Users/andrew/Sites/app_name/config/environment.rb:5)
.F

Failures:

1) PasswordResets should email user when requesting password reset
Failure/Error: current_path.should eq(root_path)

   expected "/"
        got nil

   (compared using ==)
 # ./spec/requests/password_resets_spec.rb:10:in `block (2 levels) in <top (required)>'

Finished in 0.71308 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/requests/password_resets_spec.rb:4 # PasswordResets should email user when requesting password reset
'''

This seems to come up no matter what I put in the "current_path.should..." line. The only way I can get it to pass is to go

''' ruby
current_path.should eq nil
'''

But when I try the form in my browser, it does redirect to the root_path.

Here's part of my test log:

''' ruby
To reset your password, click the URL below.

http://localhost:3000/password_resets/_CdAYKLafBbLyLVLvHaLpw/edit

If you did not request your password to be reset, just ignore this email and your password will continue to stay the same.
Redirected to http://www.example.com/
Completed 302 Found in 60ms

Started GET "/" for 127.0.0.1 at 2011-09-20 19:31:11 +1000
Processing by HomeController#index as HTML
Rendered home/index.html.erb within layouts/public (0.3ms)
Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms)
'''

Not sure why it says something about http://www.example.com. Did a search and none of my code appears to contain that domain, except for the Factories email address.

Also, does anyone know why I am getting a "Depreciation Warning" and how to resolve it? I'm running Rails 3.1.0 and Ruby 1.9.2.

Any help would be appreciated... thanks!

Avatar

I'm getting this too, I'm stuck!! Have compared my code with every file in the source code I can think of... Is it really working for everyone else following this screencast??

I'm running Rails 3.1.0, Ruby 1.9.2p290, sqlite3-ruby 1.3.3, Rake 0.8.7...