vhochstein / render_component Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rails/render_component
Rails 3 Version of render_component
Home Page: http://rubyonrails.com/
License: MIT License
This project forked from rails/render_component
Rails 3 Version of render_component
Home Page: http://rubyonrails.com/
License: MIT License
it looks like this fork has the most recent version of this gem.. supporting rails 3.0
quickly, I could not find a more active one... but let me know if you think I am wrong...
I am actually in the progress of porting an rails 1.1.6 application to rails 4.1.4
which is using components extensively... is there a better solution nowadays? or should I attempt to create yet another fork of this attempting to make it work with 4.1 ?
thanks
can you fix this issue to support rails 3.1 rc4?
Bundler could not find compatible versions for gem "railties":
In Gemfile:
render_component_vho depends on
railties (~> 3.1.0)
rails (= 3.1.0.rc4) depends on
railties (3.1.0.rc4)
If render_component is used alongside with devise (or warden) it can lead to no method error "authenticate!" for nil:NilClass
.
This is due that the rendered controller will try to enforce authentication looking into the request.env['warden']
object to call authenticate!
on it.
To fix this particular case we need to add on line 121 of
# render_component/lib/components.rb +121
request_env["warden"] = request.env['warden'] if request.env['warden']
I think that for a more broad compatibilty, more variables from the request.env
should be copied.
When my controller returns 304 result, the render_component fails with this error:
undefined method `redirect_url' for []:Array
on this line:
response = component_response(options, true)[2]
** if response.redirect_url **
redirect_to response.redirect_url
else
render :text => response.body, :status => response.status
end
The reason is because controller.dispatch(action, request)
returns an array with:
[304, {"ETag"=>"....", "Cache-Control"=>"max-age=0, private, must-revalidate"}, []]
instead of the 200 result which looks like:
[200, {"Content-Type"=>"text/html; charset=utf-8", "ETag"=>"\"...\"", "Cache-Control"=>"max-age=0, private, must-revalidate }, #<ActionDispatch::Response:0x007f8eee1918b8 @writer=...
Tried to add request_env["Cache-Control"] = "no-store, no-cache, must-revalidate"
as a header but no luck.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.