I am trying to run a bloc in a js.erb script , but I don't get ir ...
debugger show that the test is true, so it should run ..

<% if (params[:blog_page].to_i > 0) do %>

alert("should redisplay the dashboard page");
window.location.href = <%= backoffice_url %>;
location.reload();
$('#blog-info').html( '<%= escape_javascript(render :partial =>
"backoffice/dashboards/lists/blog_info") %>');
$('#blogInfo').tab('show');

<% end %>

what's wring with tho writing ??

thanks for your feedback

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Jeffrey L. Taylor at May 29, 2012 at 4:30 pm

    Quoting Erwin <yves_dufour@mac.com>:
    I am trying to run a bloc in a js.erb script , but I don't get ir ...
    debugger show that the test is true, so it should run ..

    <% if (params[:blog_page].to_i > 0) do %>

    alert("should redisplay the dashboard page");
    window.location.href = <%= backoffice_url %>;
    location.reload();
    $('#blog-info').html( '<%= escape_javascript(render :partial =>
    "backoffice/dashboards/lists/blog_info") %>');
    $('#blogInfo').tab('show');

    <% end %>

    what's wring with tho writing ??
    The 'do' after the 'if' condition is incorrect. Remove it.

    HTH,
    Jeffrey

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 29, '12 at 3:12p
activeMay 29, '12 at 4:30p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Jeffrey L. Taylor: 1 post Erwin: 1 post

People

Translate

site design / logo © 2022 Grokbase