Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I add a new view page (web page) to my Ruby on Rails applicartion?

Posted on 2011-09-04
3
Medium Priority
?
592 Views
Last Modified: 2012-06-21
I have created a ruby on rails applications using scaffolding.  It runs fine.  I want to add a new view page to my application by hand but I am having no luck so far.  I added a reference to the page in routes.rb and added an entry in the controller.  I am not real familiar with this aspect of rails.

The entry in the route.db looks like this:

Msp1::Application.routes.draw do
  resources :businesses
match 'manage' => 'businesses#manage'
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

The entry in my controller:
def manage
    @businesses = Business.all

    respond_to do |format|
      format.html # manage.html.erb
      format.xml  { render :xml => @businesses }
    end
  end

Thanks.
0
Comment
Question by:jwright9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
JESii earned 2000 total points
ID: 36483900
I believe your match statement should look like this:
  match 'manage', :to => 'businesses#manage'
0
 

Author Closing Comment

by:jwright9
ID: 36490393
JESii,  Do you know of any good tutorials that show you the programmer how to add routes, views, etc. to an existing RoR project?
0
 
LVL 12

Expert Comment

by:JESii
ID: 36492583
Sure; check this out - http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/

And thanks for the points!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi,    When I first started to learn Hibernate I found it pretty easy, but integrating it with Spring took me around 2 weeks. Not pretty cool. So I came up with the idea of writing this article which guides you simply towards the integration. NO…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question