Note that there are some explanatory texts on larger screens.

plurals
  1. POUnderstanding about render :partial in rails 3?
    primarykey
    data
    text
    <p>When I change the content status on my application, background of database update works fine. But the <code>link_to :loading</code> operation is not working.</p> <p>View : _feedback_question_status.html.erb for an element in page</p> <pre><code>&lt;% if feedback_question.status == 1 %&gt; &lt;span id="feedback_question"&gt;enabled -- &lt;%= link_to "change", {:action=&gt;"feedback_question_status",:status =&gt; 0,:feedback_question=&gt;feedback_question.id}, :remote=&gt;true, :loading =&gt; "$('#feedback_question_disable_#{feedback_question.id}').replaceWith('&lt;p&gt;Loading..&lt;/p&gt;')", :update =&gt;"feedback_question"%&gt;&lt;/span&gt; &lt;% else %&gt; &lt;span id="feedback_question"&gt;disabled -- &lt;%= link_to "change",{:action=&gt;"feedback_question_status",:status =&gt; 1, :feedback_question=&gt;feedback_question.id }, :remote=&gt;true, :loading =&gt; "$('#feedback_question_enable_#{feedback_question.id}').replaceWith('&lt;p&gt;Loading..&lt;/p&gt;')", :update =&gt;"feedback_question"%&gt;&lt;/span&gt; &lt;% end %&gt; </code></pre> <p>Controller:</p> <p>has the <code>update_attributes</code> and <code>render :partial=&gt;'feedback_question_status'</code></p> <p>And on the Server:</p> <pre><code>Started GET "feedback/feedback_question_status?feedback_question=6&amp;status=1" for 127.0.0.1 at 2012-08-27 16:25:47 +0530 ... Snippet (0.2ms) BEGIN ... (30.7ms) COMMIT Rendered _feedback_question_status.html.erb (2.7ms) </code></pre> <p>the last line shows the partial was renderd. but no changes on the views. It means there nothing happen to the element on the page.</p> <p>rake routs for feedback_question:</p> <pre><code> feedback_feedback_question_status /feedback/feedback_question_status(.:format) feedback#feedback_question_status feedback_questions feedback/new_feedback_question(.:format) feedback#new_feedback_question edit_feedback_question /feedback/:id/edit_feedback_question(.:format) feedback#edit_feedback_question update_feedback_question /update_feedback_question/:id(.:format) feedback#update_feedback_question feedback_question_status /feedback_question_status(.:format) feedback#feedback_question_status </code></pre> <p>after refresh the page it shows the changes. but i don't want to load the page again.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload