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

  • SEARCH
  • Home
  • 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 7628039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:32:32+00:00 2026-05-31T05:32:32+00:00

The app i am working on use the API from TrackMania 2/Maniaplanet The current

  • 0

The app i am working on use the API from TrackMania 2/Maniaplanet

The current part i am trying to use is the request to return one player data :

http://ws.maniaplanet.com/players/sylario/

where sylario is the user name. Removing the last “/” return a 404.

Currenrly I have managed to make active resource generate the following request by asking "#{playername}/" :

http://ws.maniaplanet.com:80/players/sylario/.json

I’d like to remove the .json as the API return a 404.

Here is my model class :

class Player < ActiveResource::Base
  self.site = "http://ws.maniaplanet.com/"
  self.user="********"
  self.password="************"
end

The request from a controller:

Player.find("sylario/")

I also forsee problem when rails will receive the HTML formated answer, but one thing at a time.

So, how to remove the .json?

  • 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-31T05:32:32+00:00Added an answer on May 31, 2026 at 5:32 am

    UPDATE Player.find(:one, :from => “/players/sylario/”) will skip the generated element path and not append the .json to your URL.

    Can you post the code for your controller or wherever you are making the actual request to the service?

    Also, if you need to strip the extension from the URL I believe you will have to monkey patch ActiveResource. You could do the following in an initializer file:

    class ActiveResource::Base
      def element_path(id, prefix_options = {}, query_options = nil)
        check_prefix_options(prefix_options)
    
        prefix_options, query_options = split_options(prefix_options) if query_options.nil?
        "#{prefix(prefix_options)}#{collection_name}/#{URI.parser.escape id.to_s}#{query_string(query_options)}"
      end
    end
    

    This overrides the method ActiveResource uses to generate the URL and does not append the format extension.

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

Sidebar

Related Questions

I have a small app I'm working on where I'm trying to use Django's
I'm working on a PHP web app and I'm trying to use the MVC
I am working on one sample app in which I need to use Google
I am working on a web app which makes use of a 3rd party
I'm working on an Android app in which I would like to use multi-touch.
I'm currently working on building a java web app. I've been looking to use
Whilst trying to get our app working in Firefox (I'm a big proponent of
I'm trying to get a web app working based on the S#arp Architecture. At
I'm working on an android app that has to send and receive information from
I'm trying to use application settings with a C#.NET project I am working on.

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.