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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:45:14+00:00 2026-06-09T03:45:14+00:00

This is my first question to stackoverflow, and I feel a bit daft having

  • 0

This is my first question to stackoverflow, and I feel a bit daft having not been able to fix the bug myself, but here goes.

I’m attempting to connect a link on a pages index to an edit action and I get the following error:

No route matches {:action=>"edit", :controller=>"pages"}

So obviously I first checked the controller – there’s definitely an edit action in there!

Here’s my relevant rake routes output:

      pages GET    /pages(.:format)          pages#index
            POST   /pages(.:format)          pages#create
   new_page GET    /pages/new(.:format)      pages#new
  edit_page GET    /pages/:id/edit(.:format) pages#edit
       page GET    /pages/:id(.:format)      pages#show
            PUT    /pages/:id(.:format)      pages#update
            DELETE /pages/:id(.:format)      pages#destroy

And my config/routes.rb:

  Portfolio::Application.routes.draw do
  resources :pages
  resources :sessions, only: [:new, :create, :destroy]
  resources :users

  root to: 'pages#home'

  match '/signup',   to: 'users#new'
  match '/signin',   to: 'sessions#new'
  match '/signout',  to: 'sessions#destroy', via: :delete
  match '/admin',    to: 'admin#index'
  match '/new',      to: 'pages#new'
  match '/edit',     to: 'pages#edit'

  match '*path', :controller => 'redirect', :action => 'index'

And the controller action, just in case.

  def edit
    @page = Page.find(params[:id])
  end

I thought I’d also give the view, where the path is called:

 <% Page.where("parent_id IS NULL").each do |page| %>
   <li>
     <%= link_to page.title, page %>
     <%= link_to "Edit", page, edit_page_path  %>
     <%= link_to "Delete", page, method: :delete,
                                 data: { confirm: "You sure?" } %>
   </li>
 <% end %>

I do have an awful habit of not seeing my typos, so if I have made a silly one it would explain why I can’t fix this one.

Any help would be appreciated.

Thanks!

  • 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-06-09T03:45:16+00:00Added an answer on June 9, 2026 at 3:45 am

    Try:

     <%= link_to "Edit", edit_page_path(page)  %>
    

    If you look closer on your routes output:

    edit_page GET    /pages/:id/edit(.:format) pages#edit
    

    The route edit_page requires an :id to be passed to.

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

Sidebar

Related Questions

This is my first question on stackoverflow (I have usually been able to figure
this is my first question, but I've readed StackOverflow for years. Well the thing
this is my first question on stackOverflow. I'm working with Corona and I'm having
this is my first question on StackOverflow, but I think that we'll both come
This is my first question on StackOverflow.com and I'm not sure if this is
This is my first question on stackoverflow so I'll try to keep it concise
This is my first question on stackoverflow. I just wonder why my getJSON code
this is my first time asking a question on stackoverflow. I'm working on a
First of all, sorry if this isn't an appropriate question for StackOverflow. I've tried
This is my first post on stackoverflow, so please excuse me if my question

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.