• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 617
  • Last Modified:

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

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
jwright9
Asked:
jwright9
  • 2
1 Solution
 
JESiiCommented:
I believe your match statement should look like this:
  match 'manage', :to => 'businesses#manage'
0
 
jwright9Author Commented:
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
 
JESiiCommented:
Sure; check this out - http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/

And thanks for the points!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now