RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: alexhawkins
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:
render "activities/#{activity.trackable_type.underscore}/#{activity.action}", activity.trackable_type.underscore.to_sym => activity.trackable
I ran into the same issue. Had to add the following strong params to the books_controller
def book_params params.require(:book).permit(:name, { :author_ids => [] }) end
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
$('.pagination').text("Fetching more products...")
with
$('.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.
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:
render "activities/#{activity.trackable_type.underscore}/#{activity.action}", activity.trackable_type.underscore.to_sym => activity.trackable
I ran into the same issue. Had to add the following strong params to the books_controller
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
with
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.