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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:43:30+00:00 2026-05-27T20:43:30+00:00

I have created a simple application and edited the index.erb file so that I

  • 0

I have created a simple application and edited the index.erb file so that I have a simple view with a text box and a button.

Now when i click on that button i want it to navigate to a new view.
I know that we can add models and in that models we have different .erb files.
but i want to create a single .erb file or add it to an existing model so that i can change edit the view and call that view as i press the button.

Is it like for every screen we have to create a model??

I dont know how to do the same, i tried searching but no help so far.

  • 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-27T20:43:31+00:00Added an answer on May 27, 2026 at 8:43 pm

    It is not that for every screen you’ve to create a model rather the reverse. Every model for which you need interfaces you’ll create views.

    Why don’t you start with this guide and move ahead understanding the basics.

    Other than CRUD interfaces? You can add a view file directly to the view folder of the controller this model is associated with. For example, if the model is post.rb in app/models and it has a corresponding controller posts_controller.rb in app/controllers and it has corresponding views in app/views/posts then you can add your view to app/views/posts folder with a corresponding method in the controller which will render that view provided there is a route for that in the config/routes.rb file.

    Say I want to add a landing_page.html.erb view to Post. I would add a method in posts_controller.rb (although, this is not mandatory. But, might be useful for you to check some conditions before rendering the view):

    class posts_controller < ApplicationController
      ...
      def landing_page
      end
    end
    

    Add a view in app/views/posts directory:

    # app/views/posts/landing_page.html.erb
    

    Add a route to the config/routes.rb file:

    map.resources do
      member do
        get :landing_page
      end
    end
    

    Now, you can access the page at http://localhost:3000/posts/:id/landing_page.

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

Sidebar

Related Questions

I have created a simple Facebook application in PHP, that greets user by there
I have created a simple API for a Rails application using token-based-authentication that supports
I have created simple application in windows sharepoint services. Now I want to deploy
I have created a simple silverlight application to display some text at realtime from
I have created a simple RMI application, that just send a message to RMI
Ok. Here is some background: I have created a simple APEX application that is
I have created a simple application of reading mail properties from a nsf file
I have created a simple JSF application, now must to connect to SQL Server
I have created a simple blog application with Ruby on Rails. The applications consists
I have created a simple win 32 application..in which it has a textbox and

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.