views:

393

answers:

1

Hello ! I'm trying to use this example but it doesn't work. I guess it's because I use a shallow nested model ! I get this error : Template is missing

Missing template pprojects/create with {:formats=>[:html], :handlers=>[:builder, :erb, :haml, :rjs, :rhtml, :rxml], :locale=>[:en, :en]}

It looks like my app is trying to do HTML and no JS because my server console says the following:

Processing by ProjectController#create as HTML

Maybe I have a problem here :

<%= form_for([@organization, @project], :remote => true) do |f| %>

or because in my controller my load method isn't compatible with create and update :

def load
    @projects = Project.all
    @project = Project.new
  end

def create
    @project = @organization.projects.new(params[:project])
    if @project.save
      flash[:notice] = "Successfully created project."
      @projects = Project.all
    end
  end

  def update
    @project = Project.find(params[:id])
    if @project.update_attributes(params[:project])
      flash[:notice] = "Successfully updated project."
      @projects = Project.all
    end

Do you have a clue? Thanks in advance

A: 

i'm willing to bet you have your javascript_include_tags the wrong way round

try putting them like this:

// include jquery before you include rails.js file - it's very important!!
javascript_include_tag 'path/to/jquery'
javascript_include_tag 'path/to/rails'

It worked for me.

stephenmurdoch
Hello, thanks for your response but my tags are working.
Fabien