[LRUG] file-cached rails routes

Mr Jaba the.jaba at gmail.com
Wed Jan 25 07:02:53 PST 2012


Might not be quite what you're after, but Rails 3.2 has an entirely new
router called Journey (https://github.com/rails/journey) which is fairly
well decoupled from Rails, and you could perhaps use that and feed it your
routes file? Might be worth a look.

hope that helps a little.

Tom

On 25 January 2012 14:52, Lee Henson <lee.m.henson at gmail.com> wrote:

> Hi list
>
> I've got a ruby daemon chugging along doing all kinds of interesting
> offline-processingy things for me, but one thing I need it to do is be able
> to generate a url to a page in one of my rails websites:
>
> url_to_widget_page = "http://doodah.com/some/path/here"
>
> ...but that explicit path might go mouldy as the system evolves. It would
> be nice to be able to do:
>
> url_to_widget_page = "http://doodah.com#{widget_path}"
>
> much in the same way that you can do in rails. I'm already using the
> js-routes gem to generate a "file cache" of the routes in my web app, so I
> can do:
>
> Router.widget_path()    // returns '/some/path/here'
>
> from js, and the file is regenerated on every request in dev mode. I'd
> like the same capability from non-rails ruby code.
>
> My google-fu seems weak in this area - has anyone seen a gem like this or
> have any alternative ideas on how this goal might be achieved? I don't
> think porting the js-routes gem would be too hard, but I'd rather not
> reinvent the wheel.
>
> Cheers
> Lee
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20120125/fd0d0a68/attachment.html>


More information about the Chat mailing list