2012-01-06 8 views
1

jQuery単独またはインプレイスエディタ「Best In Place」を使用してインデックスからレコードを更新しようとしています。チェックボックスが表示されず、<THEAD>行の書式設定が失われています。私はガイドとしてthis rails castを使用していたが、私はチェックボックスで構文を使用したときライアンは言って、私はエラーを得た使用:Best In Placeを使用してインデックス内からレコードを更新しようとしています

更新:予想外のRuby 1.8.7

は、構文エラー、「:」、 '期待を「)

Code--

Application.js:

//= require jquery 
//= require jquery_ujs 
//= require_tree . 
//= require jquery.tablednd_0_5.js 
//= require jquery.tablesorter.js 
//= require jquery.purr 
//= require best_in_place 
件の

コメント、crb_agendaとpre_release_agendaコーヒースクリプト:

jQuery -> 
    $('.best_in_place').best_in_place() 

comments_controller.rb番号更新

def update 
    @comment = Comment.find(params[:id]) 

    respond_to do |format| 
     if @comment.update_attributes(params[:comment]) 
     Comment.add_comment_to_jira_ticket("MCTEST-293",@comment.user_comments) 
     format.html { redirect_to @comment, :notice => 'Comment was successfully updated.' } 
     format.json { head :ok } 
     else 
     format.html { render :action => "edit" } 
     format.json { render :json => @comment.errors, :status => :unprocessable_entity } 
     end 
    end 

CRBアジェンダindex.html.erb(best_in_placeヘルパーとTDまでのそれとはい

<table id="main_agenda" class="agenda_table"> 
     <thead> 
      <tr> 
      <th></th> 
      <th></th> 
      <th>Hide?</th> 
      <th>Comments</th> 
      <th title="Sub tasks due in the next three days">Sub-tasks</th> 
      <th>Project name</th> 
      <th>Change element</th> 
      <th>Issue type</th> 
      <th>Key</th> 
      <th>Issue links</th> 
      <th>Summary</th> 
      <th>Assignee</th> 
      <th>Reporter</th> 
      <th>Dev Lead/Resource Mgr.</th> 
      <th>Planned Rel. Dt</th> 
      <th>Due Dt</th> 
      <th>Approval Source</th> 
      <th>SOX</th> 
      <th>Dev</th> 
      <th>QA</th> 
      <th>SQE</th> 
      <th>ST</th> 
      <th>UX</th> 
      <th>App QA</th> 
      <th>Systest QA</th> 
      <th>SQE Test</th> 
      <th>Dependencies</th> 
      <th></th> 
      <th></th> 
      </tr> 
     </thead> 
     <tbody> 
      <% @crb_agendas.each do |crb_agenda| %> 
       <% @sub_tasks = [] %> 
       <% @linked_issues = SubTask.where(:pdms_key => crb_agenda.key).all %> 
       <% @pdms_comment = Comment.where(:jira_key => crb_agenda.key).order("updated_at DESC").first %> 
       <tr class="<%= cycle('a_row','b_row') %>" id="<%= crb_agenda.id %>"> 
       <% SubTask.select("`key`").where(:pdms_key => crb_agenda.key).where("`key` LIKE 'CR%'").where("due_date <= '#{@date_cutoff.to_s}'").each do |sub_key| @sub_tasks << sub_key.key end %> 
       <td class="mincell" title="This PDMS has an upcoming iCR on the Pre-Release Agenda"><%= if (@sub_tasks & @icr_key_list).any? == true then "*" end %></td> 
       <td><%= best_in_place @pdms_comment, :do_not_show, :type => :check_box, :collection => %w[No Yes] %></td> 

    end 

これはすべてをカバーしていますか?場所にベストを放棄し、解答を作成巻き上げ

+0

どのバージョンを記述する? ( 'ruby -v'コマンドラインから) – sethvargo

+0

@sethvargo Ruby 1.8.7;メインポストにも追加しました – ScottJShea

答えて

関連する問題