Giter Club home page Giter Club logo

render_component's People

Contributors

ameliatester avatar dpowell avatar lifo avatar vhochstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

render_component's Issues

rails 4.1

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

compatible versions for gem "railties"

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)

warden (devise) compatibility

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.

render_component fails when controller returns 304

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.