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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:46:28+00:00 2026-05-30T21:46:28+00:00

Hi Im new to Ruby On Rails, but have experience building iPhone apps. So

  • 0

Hi Im new to Ruby On Rails, but have experience building iPhone apps. So far my iPhone apps have been built natively and they all have had a PHP back end. I simply used to invoke a PHP script from a Http request from the iPhone to communicate with the server.

Now I want to use RoR for the back end. However, RoR as a MVC architecture. The part thats confusing is, Since my “View” is not really a Html page, since its a native iPhone app, can I still use RoR as the back end. If so, then in place of the Html files in RoR’s folders what should I put, since there is no view to render. The only thing that I want the controller to do after it receives a HttP request from a client is respond with a JSON object to the iPhone.

ANy ideas/suggestions. Could someone please give me some links or names of books that deal with this scenario. I tried searching online, but couldn’t find this situation, maybe I was searching using the wrong keywords.

  • 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-30T21:46:29+00:00Added an answer on May 30, 2026 at 9:46 pm

    You won’t need the views at all for your iphone app. Your index action would have something like this…

    def index  
        @posts = Post.all
        respond_to do |format|
            format.html  # index.html.erb    
            format.json  { render :json => @posts }  
        end
    end
    

    in respons_do you see format.html would return your html view (if you don’t have a veiw just remove this line). The second line is what you are interested in. format.json will return a json response instead of rendering an html view. Calling http://example.com/posts.json would return your @posts as json.

    You can see the full example here http://guides.rubyonrails.org/getting_started.html

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

Sidebar

Related Questions

I'm new to Ruby on Rails, I know things but now I have to
I'm a PHP dev and I'm new to Rails but have been getting on
I'm new to Ruby and Rails, but my team is interested in using Redmine
I am new to Ruby and Rails so bear with me please. I have
I have 2 years of experience in Ruby on Rails. I have basic knowledge
I am a new Ruby on Rails user and had a question. I have
I am quite new to ruby on rails, but I find it phantastic. Anyway,
I am fairly new to Ruby on Rails, and I clearly have an active
First I'm quite new to ruby and rails... I have a little application working
New to both Ruby and Rails but I'm book educated by now (which apparently

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.