<li><%= link_to "Yes", { :controller => 'application', :action => 'start_game', :human_is_first => true  }, :remote => true  %></li>
in my control开发者_StackOverflowler:
  def start_game
    respond_to do |format|
      format.js
    end
  end
in start_game.js.erb
$('.choose_options').fadeOut(1000);
my erb that calls start_game:
<div class="welcome">
  Hello!
  <div class="choose_turn">
    Would you like to go first?
    <ul class="choose_options">
      <li><%= link_to "Yes", { :controller => 'application', :action => 'start_game', :human_is_first => true  }, :remote => true  %></li>
      <li><%= link_to "No", { :controller => 'application', :action => 'start_game', :human_is_first => true  }, :remote => false  %></li>
    </ul>
  </div>
</div>
but when I click the link, the page redirects
Template is missing
Missing template application/start_game with {:locale=>[:en, :en], :handlers=>[:builder, :rjs, :rhtml, :rxml, :erb], :formats=>[:html]} in view paths "~/Documents/Aptana Studio 3 Workspace/tic-tac-toe-ai/tic-tac-toe-ai/app/views" 
Any help will be much appreciated.
(I'm using jQuery 1.4.3)
Rather than using respond_to, you might try using request.xhr? like so:
if request.xhr?
  render 'start_game.js.erb', :layout => false
end
Cody
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论