dynamic action_name option #26

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@lacco
Contributor
lacco commented Jan 20, 2012

I have a controller with one single action that delivers different static pages (terms of services etc.). I want to track those pages with different action_name so that I have to set the action name dynamically. I extended ImpressionistController#impressionist with one additional option action_name that may be a string or a block. An example for its usage:

class WelcomeController < ApplicationController
  impressionist :action_name => Proc.new{|c| c.params[:page]}

  def static
    #render params[:page]
  end
end

Might this be interesting for others? I changed the signature of ImpressionController::InstanceMethods#impressionist_subapp_filter from actions = nil, unique_opts = nilto opts = {}, is there any code out there that rely on this?

@lacco
Contributor
lacco commented Apr 15, 2012

Any chance for getting this merged?

@enriclluelles

+1 on this. Seems like a very useful addition

@acnalesso acnalesso closed this Aug 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment