2011-12-03 9 views
0

レールで3.1のpaperclipを使用しようとしていますが、引き続きこのルーティングエラーが発生します。レールでペーパークリップを使用できません。3.1

Noルート一致{:アクション=> "ショー"、:コントローラ=> "ユーザー"}

私はgithubの上thoughtbot /クリップで指示に従いました。

<%= form_for :user, @user, :url => user_path, :html => { :multipart => true } do |f| %> 
    <% if @user.errors.any? %> 
    <div id="error_explanation"> 
     <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2> 

     <ul> 
     <% @user.errors.full_messages.each do |msg| %> 
     <li><%= msg %></li> 
     <% end %> 
     </ul> 
    </div> 
    <% end %> 

    <div class="field"> 
    <%= f.label :FirstName %><br /> 
    <%= f.text_field :FirstName %> 
    </div> 
    <div> 
    <%= f.label :avatar%> 
    <%= f.file_field :avatar %> 
    </div> 
    <div class="field"> 
    <%= f.label :LastName %><br /> 
    <%= f.text_field :LastName %> 
    </div> 
    <div class="field"> 
    <%= f.label :Email %><br /> 
    <%= f.text_field :Email %> 
    </div> 
    <div class="actions"> 
    <%= f.submit %> 
    </div> 
<% end %> 

User.rb

class User < ActiveRecord::Base 
    has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" } 
end 

routes.rbを

City::Application.routes.draw do 
    resources :users 
end 

show.html.erb

<p id="notice"> 
    <%= notice %> 
</p> 
<p> 
    <b>Firstname:</b> 
    <%= @user.FirstName %> 
</p> 
<p> 
    <b>Lastname:</b> 
    <%= @user.LastName %> 
</p> 
<p> 
    <b>Email:</b> 
    <%= @user.Email %> 
</p> 
<p> 
    <b>Avatar</b> 
    <%= image_tag @user.avatar.url %> 
    <%= image_tag @user.avatar.url(:medium) %> 
    <%= image_tag @user.avatar.url(:thumb) %> 
</p> 
<%= link_to 'Edit', edit_user_path(@user) %> | 
<%= link_to 'Back', users_path %> 

!UPDATE! > =アクション:{:アクション=> "インデックス":コントローラ=> "イベント"} POSTの/events(.:format){

$レーキ経路 イベントは/events(.:format)を取得します"create"、:controller => "events"} new_event GET
/events/new(.:format){:action => "new"、 :コントローラ=> "イベント"} edit_event GET/events /:id /編集(:フォーマット)
{:action => "edit"、:controller => "events"} イベントGET /events/:id(.:format){:action => "show"、:controller => "events"} PUT /events/:id(.:format){:action => "update"、:controller => "events"} DELETE /events/:id(.:f (/:アクション(/:コントローラー=>「イベント」):アクション=>「インデックス」} /id(。:format)))

答えて

2

users_path(複数形)を使用する必要があり、ユーザルートがレイク出力にないと思っていますが、ルートファイルを確認できますか?

1

あなたが持っているエラーは、ペーパークリップではありません。cosclipクリップは、あなたが持っているそのエラーメッセージとは関係ありません。あなたのルートをきちんとチェックして、あなたを再起動してみてください。

+0

これはルーティングエラーです。クリップクリップエラーではありません – Uchenna

+0

上記のコードにroute.rbファイルが貼り付けられています。 –

関連する問題