Created
April 19, 2011 16:21
-
-
Save simi/928663 to your computer and use it in GitHub Desktop.
Routing problem :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rake routes: | |
| customer_zone_order_messages POST /zakaznicka_zona/orders/:order_id/messages(.:format) {:action=>"create", :controller=>"customer_zone/messages"} | |
| # routes.rb: | |
| scope(:path => 'my_path', :module => :customer_zone, :as => 'customer_zone') do | |
| resources :orders, :only => :show do | |
| resources :messages, :only => :create | |
| end | |
| end | |
| # Controller app/controllers/customer_zone/messages_controller.rb | |
| module CustomerZone | |
| class MessagesController < ApplicationController | |
| before_filter :authenticate_zone_user! | |
| layout 'customer_zone' | |
| def create | |
| ... | |
| redirect_to customer_zone_order_path(@order) | |
| end | |
| end | |
| end | |
| # Form _form.html.erb | |
| <%= form_for(@message, :url => customer_zone_order_messages) do |f| %> | |
| # result | |
| ActionController::RoutingError: No route matches {:action=>"create", :controller=>"customer_zone/messages"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment