-
Notifications
You must be signed in to change notification settings - Fork 759
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
Allow component inline rendering from controller #329
Conversation
3086ab5
to
c5da4b2
Compare
c5da4b2
to
a3c1d7f
Compare
👍 |
@rmosolgo This is cool :) What is it missing to go on? |
I think it looks cool! This is @rmosolgo's show though so I'll let him take care of it. |
@@ -0,0 +1,18 @@ | |||
class React::ControllerRenderer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be named React::Rails::ControllerRenderer
? That would match the file path (and seems like the right name for it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops. Yup you're right. 👍
Sorry I'm behind, thanks for the nudge! Wow, this implementation is really nice. I never knew about the I had a couple of questions I left in line. Besides that, could you add a bit to the readme? |
a3c1d7f
to
ca644a0
Compare
@rmosolgo @borisrorsvort I believe that the issues when the PR have been resolved. 👪 |
💸 🎊 thanks! |
include ActionView::Helpers::TagHelper | ||
include ActionView::Helpers::TextHelper | ||
|
||
attr_accessor :output_buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw @garbles these few calls (include ActionView::...
+ attr_accessor :output_buffer
), is this what's required to make your custom object work with view rendering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I was trying to refactor the view helper a while back and got scared off by how things kept not working, maybe i'll give it another try
@rmosolgo Should I add something to the README? |
Yeah, that would be good. Can you include a note like |
@rmosolgo cool cool. I'll write that up tonight. 🎉 |
Allow component inline rendering from controller
Adds a
component
option to the controllerrender
method so that you can render a component in place ofyield
instead of a view.For example,
I had done something similar to this this before here, but there were problems with it.