Skip to main content

Posts

Showing posts from 2017

Set Hidden field value by "onclick" - jquery

sometime we have some data to send with onclick function , in genral onclick event function works like this:- $('id or class').on("click", function(){   // codes goes here }); here is example of call onclick function on any link, or div:- example -1  <input type="radio" id="1_star<%= val %>" name="rating<%= val %>" value="5" onclick = "set_rating(this,'<%= val %>');"/>     <%= vote.hidden_field :rating, value: "", id: "rating_param_#{val}" %>    <script type="text/javascript>       function set_rating(elem, application_id){          //code goes here          $('#rating_param_'+ application_id).get(0).value = rating;        };       // ajax request          $.ajax({       url: "/admin/dashboard/show_tickets",       type: "GET", ...

Undefined method `stringify_keys' for " ": String

<%= link_to 'NAME_OF_LINK ', URL_OF_LINK_path, class: "XXX", remote: true do %>      #here comes wrapping code  <% end %> This gives error of  Undefined method `stringify_keys'  for " ": String,  Reason being :-   its not good practice to write NAME_OF_LINK,  with link_to .. do   block Typically this is used when you want to have images or other tags as the contents of the link. It's purely for display purposes  here i have given few examples for ............