Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Format extensions (.xml or .json) should be optional in request urls generated in ActiveResource

#1114

Per REST, the http request headers provide the definitive information on what type of data to return ie "Accept:application/json" or "Accept:application/xml", so adding this information to the request urls should be optional. I added a configuration option to do so ie ActiveResource::Base.use_format_extension = false.

This patch maintains backwards-compatibility and by-default continues to build urls which include the format extensions. You can turn off the extensions in the urls by doing something like

Person.use_format_extension = false

OR

class FooBar < ActiveResource::Base self.use_format_extension = false end

Reported by rbpandey · September 25th, 2008 @ 07:21 PM

State: stale
Milestone: 3.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik

    Looks good. The patch is missing docs.

    January 5th, 2009 @ 06:35 PM

  2. rbpandey
  3. rbpandey
    rbpandey

    Pratik, can you also have a look at tickets 1150 and 1098 here http://rails.lighthouseapp.com/p...

    Thx, rbp

    January 6th, 2009 @ 05:56 PM

  4. rbpandey
    rbpandey

    Just wanted to touch this as a reminder that the patch was updated recently to include the requested documentation and rebased...

    January 29th, 2009 @ 04:17 PM

  5. Ryan Bigg
    Ryan Bigg
    • Assigned user set to Pratik

    Seems like your move on this one Pratik.

    April 10th, 2010 @ 11:45 AM

  6. Nathaniel Bibler
    Nathaniel Bibler

    Just a word of warning that relying on Accept headers alone may be quite misleading. Both Internet Explorer (pretty much all versions) and Webkit-based browsers often have incorrect Accept request headers.

    Webkit actually prefers (or at least did if it hasn't yet been patched) XML before XHTML before HTML for general requests. And IE is just, well, retarded about life and Accepts image formats and even application/msword MIMEs before HTML. Way to go, IE.

    April 11th, 2010 @ 03:57 AM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  8. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 05:04 PM

  9. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 05:04 PM