ruby on rails - Generating a link within a controller with an HTTP verb -


Using a comfortable resource in the rail, I would like to be able to insert a link in my flash hash that users can click The only problem for eliminating the object in question is that I can not find the link generated to work with the Receivable Controller!

At first I tried

  link_to "Change your reservation", reservation_path (@exising_ration) ,: method = & gt; :  

This did not work because link_to ActionView has a helpful method, which is not available in administrators

find next url_for

  Url_for: controller = & gt; 'Reservation' ,: verb = & gt; 'Destroyed',: method = & gt; : Delete  

I have tried every combination of both of which I can get. . . But I can not seem to make a link in my controller which will slip into the delete method! Every action I generate generates a generic link (GET), which calls the show method.

Any thoughts?

ApplicationController.helpers.link_to Will allow, though I'm not sure that it is strictly following MVC, though sometimes I have received a requirement, i.e. calling number_to_currency

Another problem arises when you use it: The delete option in that particular assistant will fail it, after a quick look at the source code, I can actually see immediate improvements.

First of all, I suggest that if possible, insert somewhere else delete link on that page. If you need actually to flash it then you can modify the flash in the scene.

Flash in the Ie Admin Setup:

  Flash [: Notice] = "Flash Message with Delay Link in"  

Then Modify it in the scene Flash before displaying it:

  & lt;% = Flash [: notice] .gsub (/ remove link /, link_to ("delete", resource_path,: method = & Gt ;: delete))%>  

You probably want to make it in your own assistant, if you do not like the text then I'm sure you can find another way, just linking the flash link How about?

Hope that helps :)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -