{"issue":{"milestone":null,"user":{"id":231924,"login":"PsychoPhobic","url":"https://api.github.com/users/PsychoPhobic","avatar_url":"https://secure.gravatar.com/avatar/9449890b97b727c11a8491936ec3f801?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"9449890b97b727c11a8491936ec3f801"},"created_at":"2011-09-21T18:29:48Z","title":"link_to_function does not work with do block","state":"open","updated_at":"2011-12-17T15:23:02Z","labels":[],"id":1703457,"html_url":"https://github.com/rails/rails/issues/3093","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"Hi, \r\ni am missing \"do block\" nottation on link_to_function. I wrote some code which is working fine for me atm.\r\n\r\n\r\n  def link_to_function(*args, &block)\r\n    #(name, function, html_options={})\r\n    if block_given?\r\n      options      = args.first || {}\r\n      html_options = args.second\r\n      link_to_function(capture(&block), options, html_options)\r\n    else\r\n      name         = args[0]\r\n      function     = args[1]\r\n      html_options = args[2] || {}\r\n\r\n      html_options = convert_options_to_data_attributes(options, html_options)\r\n\r\n      onclick = \"#{\"#{html_options[:onclick]}; \" if html_options[:onclick]}#{function}; return false;\"\r\n      href = html_options[:href] || '#'\r\n \r\n      content_tag(:a, name, html_options.merge(:href => href, :onclick => onclick))\r\n    end\r\n  end\r\n\r\ncause i dont realy know github and and bugtesting maybe somebody can test and push this code\r\n\r\nthx","number":3093,"url":"https://api.github.com/repos/rails/rails/issues/3093","comments":2,"assignee":null},"comment":{"user":{"id":3948,"login":"arunagw","url":"https://api.github.com/users/arunagw","avatar_url":"https://secure.gravatar.com/avatar/ee85853909657f47c8a68e8a9bc7d992?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ee85853909657f47c8a68e8a9bc7d992"},"created_at":"2011-12-17T15:23:00Z","updated_at":"2011-12-17T15:23:00Z","id":3189808,"body":"@Ninju Can you paste the Pull Request URL. If  merged then we can close this.","url":"https://api.github.com/repos/rails/rails/issues/comments/3189808"},"action":"created"}