Friday, 15 May 2015

ruby on rails - Using if .present? redirect -


I think this is easy, but I'm peating my head against the wall. I am trying to tell my rail app that if there is a parameter (signature in this example), then I want to redirect the house. Here's my code:

  & lt;% = if @ pc.signature.present? % & Gt; & Lt;% redirect_to "Pages # Home"% & gt; & Lt;% end% & gt;  

I am running in a syntax error. The way it is in the edit.html.erb file

Perhaps your administrator did not define your PP Was it? Also, use the path instead of 'pages # home', it should look like this:

  DIF editing @ pc = pcfind (param [: id]) # or whatever Also your argument is redirection_t root_path if @ pc # Otherwise the 'edit' template will end in  

No comments:

Post a Comment