Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

JPN's Profile

GitHub User: jonathanng

Site: teamjotty.com

Comments by JPN

Avatar

Hi John,
I'm in the same boat. Did you ever get this working?

Avatar

Tire has been retired. Read the explanation here:

https://github.com/karmi/retire

Looks like there is a replacement:

https://github.com/elasticsearch/elasticsearch-ruby

Would love a Railscast for this, especially since this Tire railscast is almost 2 years old.

Avatar

It looks like shortly after this podcast was made, they added deploy:cleanup by default:

https://github.com/capistrano/capistrano/wiki/Capistrano-Tasks#deploycleanup

So need to call it explicitly anymore.

Avatar

Turbolinks is like an electric car...it's so smooth, you don't even know it's working. And from a UI perspective, that can be bad.

The git page in one of it's examples has this:

javascript
document.addEventListener("page:fetch", startSpinner);
document.addEventListener("page:receive", stopSpinner);

I'm not sure if I like this. It's like adding a fake engine noise that is louder than a regular engine.

I'm curious if anyone has any good solutions.

Avatar

Not sure if this is the most elegant, but this works if you want permission.rb working with Carrierwave.

in def initialize(user)
allow_nested_param :post, :photos_attributes, [:image]
added method in permission.rb
def allow_nested_param(resources, attribute, nested_attributes)
  @allowed_params ||= {}
  Array(resources).each do |resource|
    @allowed_params[resource.to_s] ||= []
    @allowed_params[resource.to_s] += [{ attribute.to_s => Array(nested_attributes).map(&:to_s)}]
  end
end

References:
strong parameter example for hashes with integer keys
strong_parameters#nested-parameters