Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9188285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:58:10+00:00 2026-06-17T19:58:10+00:00

Beginning Rack dev here. I have the basic blog app built found at http://guides.rubyonrails.org/getting_started.html

  • 0

Beginning Rack dev here.

I have the basic blog app built found at http://guides.rubyonrails.org/getting_started.html

I can create a post, make changes….fine.

now…

I’m learning how to use Rack and I’m trying to create some middleware…

I’ve followed railscast #150 and #151…you can see my code here on github…

https://github.com/thefonso/form_challenge

when I do this at the url line in chrome…..http://localhost:3000/?name=foo

I get the desired result on my command line.

aleph@mage:~/Projects/form_challenge git:master$ rails s
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-01-23 17:01:30] INFO  WEBrick 1.3.1
[2013-01-23 17:01:30] INFO  ruby 1.9.2 (2012-04-20) [x86_64-darwin12.2.0]
[2013-01-23 17:01:30] INFO  WEBrick::HTTPServer#start: pid=32068 port=3000
{"name"=>"foo"}

Awesome, I can see data I send..So I expect that when I send data from my blog “create a post”
page…I should be able to capture that data.

BUT HOW do I get the rest of the app to work normally?

When I go to ……http://localhost:3000/

I get the Rack app…I want the Rails app

Now that I have this Rack middleware running….it “takes over” the rest of the app. I can not get to the ‘beginning’ of the Rails app or for that matter the form that I desire to receive data from.

Again the entire app is located here….

https://github.com/thefonso/form_challenge

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:58:12+00:00Added an answer on June 17, 2026 at 7:58 pm

    When writing middleware you have the responsibility to call through to the next middleware or the application. What your middleware does right now is simply respond with an empty response to every request, you never call through so that rails ever even sees the request.
    You can fix it with this line:

    @app.call(env)

    That is the critical line that continues the call chain through all the middleware.

    So in your middleware, do @app.call(env) instead of return response.

    If you want to manipulate the response that comes from rails, do

    @status, @headers, @response = @app.call(env)
    

    And be sure to

    return [@status, @headers, @response]
    

    When you are done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a beginning programmer on a mac (so I don't have ie) and built
Since beginning to use VB.NET some years ago I have become slowly familiar with
I am beginning Facebook App development and am following the Recipe Box App Tutorial
I'm beginning development on a Rails app and before I start heading in the
Just beginning my journey in ASP.Net MVC and I have a query about something
At the beginning of my python program I have the following line: sys.stdout =
I'm a beginning programmer who is trying to capture data from this source Here's
I'm beginning to program in C# 2.0, so I have never used lambda expressions,
In the beginning i built my site - bemcapaz.net - on Wordpress. But after
At the beginning of the bootstrap.js code file they have this !function($) { what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.