SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [RoR] Calling render methods from a command line script

    I have a command-line management system set in place for a product im working on and for one of the features I need to see what variables are being called in a view. I have a system in place to do this but it requires the template being rendered, so i use render_to_string. But with the command line, I can't call this because it doesnt exist, obviously because im not in a controller.

    How can I maybe simulate a request or get a controller setup to do this?
    To load the RoR environment I just include environment.rb, which works fine for everything else.

  2. #2
    SitePoint Addict SRTech's Avatar
    Join Date
    Mar 2005
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't have a positive answer for you, but have you tried the script/runner program in your rails project?

    You might also look at how Webrick gets called and try to figure out how it interfaces with the project.

  3. #3
    SitePoint Addict SRTech's Avatar
    Join Date
    Mar 2005
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ran across this, and think it should probably do the job for you:
    http://www.bigbold.com/snippets/posts/show/600


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •