ruby - link_to_remote wants to render a template - how not to? rails -


If some conditions are met then I want to delete my work Ajax style. The thing I do with the help of link_to_remote is that link_to_remote wants to render a template and I do not want it.

In my view (_task_sth.html.erb):

   

In my controller (tasks_controller.rb):

def delete_task task_pers = functionalization. Search (params [task_pers_id]) horse_task = task_pers.task task_pers if horse_task task_personalizations.empty? Horses_stascorestore and end

The work is removed, but I get an error saying: Visual path / task / deleted_task template in the scene. ARB is unavailable.

How can I not find it for a template? I tried to add: Delete method at the end of method =>: link_to_remote and to add my name, I also added the render: nothing => true. I also played a bit with the routes but still I get the same error.

The question is how can I not look for a template because I do not want to present it to anything?

Many thanks, no answer, stop

Do you get an error when adding render: nothing =>. True ? It's weird

The rail is trying to search for a template because there is no rendered in your operation so to avoid it, you need to call the method explicitly. :

  def delete_task task_pers = actuation. Search (params [task_pers_id]) horse_task = task_pers.task task_pers.destroy if horse_task.task_personalizations empty? Horse_task.destroy End Render: None = & gt; True: Position = & gt; 200 End  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -