Sunday 15 March 2015

Action Destroy redirect to Show Action in Rails -


I am creating a link at delete : I tried 3 variants but all of them Redirect to Show Actions:

  1. & lt;% = link_to 'Delete', {: Controller = & gt; 'Admin / Brand',: Action => 'Destroyed',: id = & gt; Brand.id}%>

  2. & lt;% = link_to 'Delete', brand ,: method = & gt; : Remove% & gt;

  3. & lt;% = link_to 'Delete' ,: id = & gt; Brand.id ,: method = & gt; : Remove% & gt;

    The problem occurs when I click on the deleted link that redirects it to the Show operation. And something like this is found:

      // = jquery_ujs is required to be added in aplication.js - right! Metatags have been added to the layout:  
      & lt;% = stylesheet_link_tag "application" ,: media = & gt;   

    "All"% & gt; & Lt;% = javascript_include_tag "Application"% & gt; & Lt;% = csrf_meta_tags% & gt;

    Correct!

    I also found this option:

      config.serve_static_assets = false   

    i development environment ( I think) and this option was not found; So I do not know when I redirect the deleted link app to show the action.

    UPDATE:

    My routes are:

      Delay / AN / Admin / Page / ED (.: Format ) Administrator / Page # Blast {: Locale = & gt; "N"} Delete / admin / pages /: id (.format) Admin / Page # Delete {: Locale = & gt; "Pt-BR"}   

    When I click on any delete link it redirects me to take action Show

    Resolve this execution rock assets: clean , all Thank you.

No comments:

Post a Comment