Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenderAction #1

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

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