Skip to content

Conversation

@pedantic-git
Copy link

This is only partway finished - it worked OK on its own but I couldn't get it to play ball with ImplicitRender loaded into the same controller. I thought you'd be interested in my partial work anyway in case you fancy adding a feature like this to Phlexible in the future.

Effectively, it allows (or should allow) calling render :index or render "path/to/index" to load the view in the same way that ImplicitRender does implicitly.

This was originally so I could get the Wicked gem to play ball, but in the end I ended up monkeypatching one of its methods to call one of your private methods, which was less code and easier to understand:

  # Monkeypatch the wizard_value method. phlex_view is actually a private method
  # but it works well for converting action names to views - at least for now
  def wizard_value(step_name)
    orig = super(step_name)
    phlex_view(orig) || orig
  end

Thanks for all your work on this regardless!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant