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 6787211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:20:20+00:00 2026-05-26T17:20:20+00:00

When an HTTP request comes into the server (in this case I’m running rails

  • 0

When an HTTP request comes into the server (in this case I’m running rails s which defaults to webrick) the message looks something like:

Started POST "/cards" for 127.0.0.1 at 2011-11-05 15:04:29 -0400
  Processing by CardsController#create as JS

I’m wondering how to get the value JS in this case, or HTML. Sorry I can’t be more explicit, I’m not sure what that value is called. Anyone have any ideas?

Thanks

  • 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-05-26T17:20:20+00:00Added an answer on May 26, 2026 at 5:20 pm

    You can use request.format to get the format. It’ll return “text/javascript” for JS requests, “text/html” for HTML, “application/json” for JSON, etc.

    Also, you would typically use this in a respond_to block:

    respond_to do |format|
      format.html { do something }
      format.js { do something else }
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In ruby, if muliple HTTP request comes for single action/method then how ruby handles
I am making an http request which ends up taking more than 8 mins.
I'm building an application with a self-contained HTTP server which can be either accessed
Was experimenting with some basic http post stuff with php and ran into this
consider the following http request: GET /defects?group-by=priority I would like the returned collection(feed) of
I have long HTTP request ( generating large Excel file - about 60K records
How to send an http request with either post/get method using javascript as an
I need loging all HTTP request (from any application). I have Delphi 7.0. Anybody
From an HTTP request all the way to my files (like .asmx)... what are
I have an HTTP Request Dispatcher class that works most of the time, but

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.