jeudi 13 août 2015

Ruby on Rails link middle click

I have multiple links in my project for example:

_index.html.erb:

<%= link_to('New Project', new_project_path, :remote => true) if Project.create_authorized? %>

controller:

def new
  @project = Account.root_account.nil? ? Project.new : Account.root_account.projects.new
end

new.js.erb:

$("#right-panel").html("<%= escape_javascript(render(:partial => 'projects/form', :locals => {:project => @project}) ) -%>");

My problem is that when I am doing mouse middle click(I mean, I want to open a new tab) on the link then it raises a error as:

Template is missing Missing template projects/new, application/new with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee, :arb]}. Searched in: * "/home/raj/workspace/papayaheaderlabs.banana/app/views" * "/home/raj/.rvm/gems/ruby-2.0.0-p598@banana/gems/doorkeeper-2.2.1/app/views" * "/home/raj/.rvm/gems/ruby-2.0.0-p598@banana/bundler/gems/activeadmin-655e2be7a351/app/views" * "/home/raj/.rvm/gems/ruby-2.0.0-p598@banana/gems/kaminari-0.16.3/app/views"

Plese help how to solve this issue



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire