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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:16:08+00:00 2026-05-22T18:16:08+00:00

I am newbie to rails and currently trying to build a REST api on

  • 0

I am newbie to rails and currently trying to build a REST api on Rails.I am trying to connect to the rest web service from my android app.
This is the controller code that i am routing the request to.

class SessionsController < ApplicationController

  def create
    user = User.authenticate(params[:userid],
                             params[:password])
    if user.nil?
      message="Invalid Username/Password"
      return message
    else
      sessionId=make_sessionId
      return sessionId
    end
  end

  def destroy
  end
end

I am trying to hit the create action in the SessionController.The problem is that the response i get is the html of the view whereas what i am looking forward to is the ‘message or the ‘sessionId‘ from the controller.I deleted the view files after which i am getting the html with exceptions inside it.

Can someone let me know what i should here to get the response from the controller rather than returning the html inside the view at the client.?

  • 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-22T18:16:09+00:00Added an answer on May 22, 2026 at 6:16 pm

    If you have no render in your Controller, then rails will use the view related to the action name. Try “render :text => message” for example. I hope I understood your question correctly.

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

Sidebar

Related Questions

I have moved from rails 3.0 to rails 2.3.4.So a newbie currently for this
Rails newbie here, trying to get a new controller working. When I try to
I'm a newbie to Rails and programming in general (currently learning from a book
Hi, I'm a Rails newbie and this is my first stackoverflow question. I'm currently
I am newbie to Rails and trying to write application with TDD and BDD.
I know I'm a newbie in Rails but this is the second day I'm
I am a newbie when it comes to Ruby On Rails (and web programming
I'm a newbie Rails developer who is getting the following error when trying to
So this is a newbie rails design question. Lets say I want some of
A rails newbie here I have 2 actions in my controller 1) index 2)

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.