Note that there are some explanatory texts on larger screens.

plurals
  1. POlocalhost:3000/my-scope/pages/new throws No route matches {:action=>"show", :controller=>"pages"}
    primarykey
    data
    text
    <p>I got it!</p> <pre><code> = link_to 'Zurück', page_path </code></pre> <p>That doesn't work in a new page. The page hasn't yet been created, so I can not go back to it... This sure works fine in "edit", where the page exists</p> <p>A good reason to spend the effort to get rspec to run :-)</p> <p>Anyway, thank for the comments!</p> <hr> <p>I got a little further....</p> <p><strong>The routing seems to work. But my form seems to be the problem?!</strong></p> <p>This is my view/pages/new.html.haml</p> <pre><code>= render 'form' </code></pre> <p>and it gets rendered if I do this: %p I should be a form for the new page... =# render 'form'</p> <p>So it seems to be a problem with my _form.html.haml - which works fine for "edit"</p> <pre><code>= javascript_include_tag "#{root_url}javascripts/tiny_mce_head.js" = form_for @page do |f| -if @page.errors.any? #error_explanation %h2= "#{pluralize(@page.errors.count, "error")} prohibited this page from being saved:" %ul - @page.errors.full_messages.each do |msg| %li= msg .field = f.text_area( :content, :class =&gt; 'mce_editor') .field = f.label :fan_only = f.check_box :fan_only .field = f.label :short_name %br = f.text_field :short_name .field = f.label :title %br = f.text_field :title .actions = f.submit 'Save' = link_to 'Zurück', page_path </code></pre> <p><strong>Any ideas???</strong></p> <p>I've already tried without the javascript_include_tag</p> <hr> <p><strong>original post</strong></p> <p>I can't create a new page anymore. It was working and I have no idea why it doesn't anymore!</p> <p>If I browse to <a href="http://localhost:3000/pages/new" rel="nofollow">http://localhost:3000/pages/new</a></p> <p>I get the following message:</p> <pre><code>No route matches {:action=&gt;"show", :controller=&gt;"pages"} </code></pre> <p>These are my routes</p> <pre><code> scope '/my-scope' do resources :pages do resources :articles end end root :to =&gt; 'pages#index' </code></pre> <p>rake routes</p> <pre><code> page_articles GET /my-scope/pages/:page_id/articles(.:format) {:action=&gt;"index", :controller=&gt;"articles"} POST /my-scope/pages/:page_id/articles(.:format) {:action=&gt;"create", :controller=&gt;"articles"} new_page_article GET /my-scope/pages/:page_id/articles/new(.:format) {:action=&gt;"new", :controller=&gt;"articles"} edit_page_article GET /my-scope/pages/:page_id/articles/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"articles"} page_article GET /my-scope/pages/:page_id/articles/:id(.:format) {:action=&gt;"show", :controller=&gt;"articles"} PUT /my-scope/pages/:page_id/articles/:id(.:format) {:action=&gt;"update", :controller=&gt;"articles"} DELETE /my-scope/pages/:page_id/articles/:id(.:format) {:action=&gt;"destroy", :controller=&gt;"articles"} pages GET /my-scope/pages(.:format) {:action=&gt;"index", :controller=&gt;"pages"} POST /my-scope/pages(.:format) {:action=&gt;"create", :controller=&gt;"pages"} new_page GET /my-scope/pages/new(.:format) {:action=&gt;"new", :controller=&gt;"pages"} edit_page GET /my-scope/pages/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"pages"} page GET /my-scope/pages/:id(.:format) {:action=&gt;"show", :controller=&gt;"pages"} PUT /my-scope/pages/:id(.:format) {:action=&gt;"update", :controller=&gt;"pages"} DELETE /my-scope/pages/:id(.:format) {:action=&gt;"destroy", :controller=&gt;"pages"} root / {:controller=&gt;"pages", :action=&gt;"index"} </code></pre> <p>controllers/pages_controller.rb methodes <em>show</em> and <em>new</em></p> <pre><code> # GET /pages/1 # GET /pages/1.json def show @page = Page.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @page } end end # GET /pages/new # GET /pages/new.json def new @page = Page.new respond_to do |format| format.html # new.html.erb format.json { render json: @page } end end </code></pre> <p>This is my view/pages.html.haml</p> <pre><code>%p#notice= notice %content.viewmode = raw parse_content @page.content -#if admin? = link_to 'Edit page', edit_page_path(@page) = link_to 'New page', new_page_path = link_to 'Destroy page', @page, :confirm =&gt; 'Are you sure to delete page #{@page.title}?', :method =&gt; :delete = link_to 'New article', new_page_article_path(@page) -if @page.articles.empty? / = "No articles for page #{@page.short_name}" - else %ul.article_list = show_articles </code></pre> <p>I'd be glad if anyone could just give me a few ideas where to start searching. I tried but I don't get any further.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload