I have this in routes.rb
root :to => "posts#index"
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
resources :users, :only => :show
resources :boards
resources :posts do
resources :comments
end
namespace :users do
resources :posts do
get :posts, :on => :member
end
resources :boards do
get :boards, :on => :member
end
end
rake routes:
boards_users_board GET /users/boards/:id/boards(.:format) {:action=>"boards", :controller=>"users/boards"}
users_boards GET /users/boards(.:format) {:action=>"index", :controller=>"users/boards"}
POST /users/boards(.:format) {:action=>"create", :controller=>"users/boards"}
new_users_board GET /users/boards/new(.:format) {:action=>"new", :controller=>"users/boards"}
edit_users_board GET /users/boards/:id/edit(.:format) {:action=>"edit", :controller=>"users/boards"}
users_board GET /users/boards/:id(.:format) {:action=>"show", :controller=>"users/boards"}
If I put this link with 2 parameters:
<% @posts.each do |post| %>
<%= link_to post.board.name, users_board_path(post.user, post.board) %>
<% end %>
I get the next url with a dot:
http://localhost:3000/users/boards/hyperrjas.board-2
- hyperrjas is the user_id that I have put with slug :username.
- I use namespace because are nested resources and I have a panel for users.
My question is: How can I change the dot for slash / in my generated url? should look and work as follows: