Q:

Rails rendering, it doesn't show the same url as before

I have a problem getting render to work, my path is 
/dashboard/models/new

If the verification fails, it's supposed to render that page using 
render :new

, but the url changes to 
/models/new

Without proper layout. Using 
render :new, :layout => 'dashboard'

brings the layout back, but not the path.
My routes.rb
match '/dashboard' => 'home#dashboard', as: :dashboard_home
scope '/dashboard' do
    resources :models, only: :new
end
root :to => 'home#index'

Any one can help me with this? 
Thanks in advance

My controller has a lot of code, the part that makes this is :
if model.save
    redirect_to "/dashboard/#{@model_type.to_s.downcase}s"
else
    flash.now[:error] = model.error.messages[:title]
    render :new, :layout => "dashboard"
end

A:

You can try to used namespace instead.
you route file will look like this
namespace :dashboard do
  resources :models, :only => :new
end

and in form_for tag you should send namespace to it like this
<%= form_for [:dashboard, @model] do |f| %>

Not sure is this answers your questions.

