title: Rails 3 No route matches {:action=>"show", error
body: <p>While there are similar questions on this error, most relate to how Rails route handle pluralisation, whereas this is different.</p>
  
  <p>I have a link on the 'show' view page within a controller called MemberPage which I need to link to the 'new' action within a controller called Post</p>
  
  <pre><code>&lt;%= link_to ((content_tag :i, "", :class =&gt; "icon-pencil") + content_tag(:span, 'create')), new_members_community_post_path %&gt;
  </code></pre>
  
  <p>Within routes I have</p>
  
  <pre><code>resources :post
  </code></pre>
  
  <p>which produces the following related line in rake routes</p>
  
  <pre><code>new_members_community_post GET        /members/community/post/new(.:format)                                  members/community/post#new
  </code></pre>
  
  <p>Hovering over the link shows</p>
  
  <pre><code>127.0.0.1:3000/members/community/post/new
  </code></pre>
  
  <p>Clicking on it produces the error</p>
  
  <pre><code>No route matches {:action=&gt;"show", :controller=&gt;"members/community/member_page"}
  </code></pre>
  
  <p>Rails is matching both the wrong controller and the wrong action from that shown in rake routes</p>
  
  <p>I've tried creating explicit match rules in routes.rb, eg (within the members/community namespace)</p>
  
  <pre><code>match '/new-post' =&gt; 'post#new'
  </code></pre>
  
  <p>and also replacing the link_to path with</p>
  
  <pre><code>:controller =&gt; :post, :action =&gt; :new
  </code></pre>
  
  <p>but cannot find anything that works</p>