Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

David Fisher's Profile

GitHub User: tibbon

Site: whatisnoise.com

Comments by David Fisher

Avatar

I can't get the javascript to load. I mean, the javascript file I see in my code, but then I can't get anything to call the best_in_place thing properly. Everything errors saying it isn't there.

Bashing head into wall. Debugging Javascript is impossible.

Avatar

I'm having problems with chosen.

jQuery ->
$('#resource_tag_ids').chosen()

is returning

Uncaught TypeError: Object [object Object] has no method 'chosen' in Chrome.

(Putting tags on a resource instead of authors on a book, but that shouldn't matter)

I can see that for some reason the chosen javascript file is being included twice, one with code, and the other is a blank 4 lines... which is really odd.

Avatar

Can you expand on when you should and shouldn't use polymorphic associations? I was thinking of using them for :imagable photos on my applications (users, events, classes, projects, etc all have many photos each via Paperclip). Seems like a great way to make some very DRY code.

Avatar

I'd love to see this. My Textmate-fu is weak compared to Ryan's and I'm constantly picking up little tips from him. I'd love to see more in the same place.

Avatar

It would appear that the FactoryGirl syntax has changed a bit. Instead of

Factory.define :user do |f|
f.sequence(:email) { |n| "foo#{n}@example.com" }
f.password "secret"
end

You now need something more like

FactoryGirl.define do
factory :user do
sequence :email do |n|
"foo#{n}@example.com"
end
password "secret"
end
end

Also then use FactoryGirl.create(:user) instead of Factory(:user)

Avatar

I'm seeing:

AbstractController::DoubleRenderError (Render and/or redirect were called multiple 
times in this action. Please note that you may only call render OR redirect, and at most 
once per action. Also note that neither redirect nor render terminate execution of the 
action, so if you want to exit an action after redirecting, you need to do something like
 "redirect_to(...) and return".):

  app/controllers/posts_controller.rb:39:in `show' 
Avatar

Probably not any difference- but SEO isn't everything. If you're reading off a URL to a person, saying "one dash my..." doesn't make much sense.

Avatar

What was the other thing? I'm having the same issue.

Avatar

I'm using acts-as-taggable-on and was wondering how I might go about creating a new tag if one wasn't found already. I've tried several things and I keep getting an error where its searching for a tag with an id of 0 whenever it doesn't know about the tag already