質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 3

Ruby on Rails3はRubyによって書かれたオープンソースのウェブフレームワークです。Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

Q&A

解決済

1回答

4134閲覧

Ruby on rails で"show"画面が開きません。

Tomoaki_Fukuda

総合スコア75

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 3

Ruby on Rails3はRubyによって書かれたオープンソースのウェブフレームワークです。Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

0グッド

0クリップ

投稿2016/02/07 16:07

###前提・実現したいこと
Ruby on railsを使用してサービスを開発中ですが、
「show」画面を開こうとすると下記のエラーが表示されます。
原因と対策をご教示頂けないでしょうか?

###発生している問題・エラーメッセージ
###下記の画像のリンクも貼って置きます(https://gyazo.com/2f754b9154742d80b65934b789175a38
Routing Error
No route matches [GET] "/show"

Rails.root: /Users/TOMOAKI/joinup-develop

Application Trace | Framework Trace | Full Trace
Routes

Routes match in priority from top to bottom

Helper HTTP Verb Path Controller#Action
Path / Url
Path Match
new_user_session_path GET /users/sign_in(.:format) devise/sessions#new
user_session_path POST /users/sign_in(.:format) devise/sessions#create
destroy_user_session_path DELETE /users/sign_out(.:format) devise/sessions#destroy
user_password_path POST /users/password(.:format) devise/passwords#create
new_user_password_path GET /users/password/new(.:format) devise/passwords#new
edit_user_password_path GET /users/password/edit(.:format) devise/passwords#edit
PATCH /users/password(.:format) devise/passwords#update
PUT /users/password(.:format) devise/passwords#update
cancel_user_registration_path GET /users/cancel(.:format) devise/registrations#cancel
user_registration_path POST /users(.:format) devise/registrations#create
new_user_registration_path GET /users/sign_up(.:format) devise/registrations#new
edit_user_registration_path GET /users/edit(.:format) devise/registrations#edit
PATCH /users(.:format) devise/registrations#update
PUT /users(.:format) devise/registrations#update
DELETE /users(.:format) devise/registrations#destroy
joinup_index_path GET /joinup/index(.:format) joinup#index
joinup_show_path GET /joinup/show(.:format) joinup#show
root_path GET / joinup#index
projects_path GET /projects(.:format) projects#index
POST /projects(.:format) projects#create
new_project_path GET /projects/new(.:format) projects#new
edit_project_path GET /projects/:id/edit(.:format) projects#edit
project_path GET /projects/:id(.:format) projects#show
PATCH /projects/:id(.:format) projects#update
PUT /projects/:id(.:format) projects#update
DELETE /projects/:id(.:format) projects#destroy
members_path GET /members(.:format) members#index
POST /members(.:format) members#create
new_member_path GET /members/new(.:format) members#new
edit_member_path GET /members/:id/edit(.:format) members#edit
member_path GET /members/:id(.:format) members#show
PATCH /members/:id(.:format) members#update
PUT /members/:id(.:format) members#update
DELETE /members/:id(.:format) members#destroy
users_path GET /users(.:format) users#index
POST /users(.:format) users#create
new_user_path GET /users/new(.:format) users#new
edit_user_path GET /users/:id/edit(.:format) users#edit
user_path GET /users/:id(.:format) users#show
PATCH /users/:id(.:format) users#update
PUT /users/:id(.:format) users#update
DELETE /users/:id(.:format) users#destroy
Request

Parameters:

None
Toggle session dump
Toggle env dump
Response

Headers:

None

###ソースコード app>view>joinup>show.html.erb

ruby

1<h1>Joinup#show</h1> 2<p>Find me in app/views/joinup/show.html.erb</p> 3

###ソースコード config>routes.rb

ruby

1Rails.application.routes.draw do 2 devise_for :users 3 get 'joinup/index' 4 5 get 'joinup/show' 6 7 #get 'joinup/index' 8 9 root to:'joinup#index' 10 11 resources :projects 12 resources :members 13 resources :users 14 # The priority is based upon order of creation: first created -> highest priority. 15 # See how all your routes lay out with "rake routes". 16 17 # You can have the root of your site routed with "root" 18 # root 'welcome#index' 19 20 # Example of regular route: 21 # get 'products/:id' => 'catalog#view' 22 23 # Example of named route that can be invoked with purchase_url(id: product.id) 24 # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 25 26 # Example resource route (maps HTTP verbs to controller actions automatically): 27 # resources :products 28 29 # Example resource route with options: 30 # resources :products do 31 # member do 32 # get 'short' 33 # post 'toggle' 34 # end 35 # 36 # collection do 37 # get 'sold' 38 # end 39 # end 40 41 # Example resource route with sub-resources: 42 # resources :products do 43 # resources :comments, :sales 44 # resource :seller 45 # end 46 47 # Example resource route with more complex sub-resources: 48 # resources :products do 49 # resources :comments 50 # resources :sales do 51 # get 'recent', on: :collection 52 # end 53 # end 54 55 # Example resource route with concerns: 56 # concern :toggleable do 57 # post 'toggle' 58 # end 59 # resources :posts, concerns: :toggleable 60 # resources :photos, concerns: :toggleable 61 62 # Example resource route within a namespace: 63 # namespace :admin do 64 # # Directs /admin/products/* to Admin::ProductsController 65 # # (app/controllers/admin/products_controller.rb) 66 # resources :products 67 # end 68end 69

###補足情報(言語/FW/ツール等のバージョンなど)
ruby on rails ver.2.3.0

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

joinup_show_path GET /joinup/show(.:format) joinup#show

にアクセスしたいということですよね?ということは、/joinup/show
にアクセスしなければなりません。

/showではなく/joinup/showにアクセスしてみてください。

投稿2016/02/07 23:43

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Tomoaki_Fukuda

2016/02/07 23:51

ご回答ありがとうございます。 /joinup/showに無事にアクセス出来ました^^
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問