RailsCasts Pro episodes are now free!

Learn more or hide this

Alex Hawkins's Profile

GitHub User: alexhawkins

Comments by Alex Hawkins

Avatar

Thanks for this. Much more straight forward. I think you may have a typo at the very end though. This is what worked for me:

ruby
render "activities/#{activity.trackable_type.underscore}/#{activity.action}", activity.trackable_type.underscore.to_sym => activity.trackable
Avatar

I ran into the same issue. Had to add the following strong params to the books_controller

ruby
def book_params
      params.require(:book).permit(:name, { :author_ids => [] })
end
Avatar

Thanks for another great tutorial Ryan! Works great with Rails 4.

For anyone that is interested, here's a slick way to replace the generic loading text with an animated gif.

Replace

coffeescript
$('.pagination').text("Fetching more products...")

with

coffeescript
$('.pagination').html("<img src='/assets/ajax-loader.gif' alt='Loading...' title='Loading...' />")

You can create and download your own loading animation here:
Link

You can add the downloaded gif to your images directory under assets. Rails knows to look there.