Some strange action when edit .rb file in #824!

def calendar_for(field_id)
    javascript_tag(%Q{
    $(function() {
$("##{field_id}").datepicker({showOn: 'button', buttonImage: 'calendar.gif', buttonImageOnly: true});
});
    })
    #image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
    #javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
  end

I defined a method in my application_helper.rb,and I want to modify the string 'calendar.gif' to 'calendar.png',but I can't modify it,I even  can't select the string 'calendar.gif',I can't describe it very well,if you copy this method to your .rb file,you will find it so strange!
And more,if I type '%Q',it will give me '%QQ',not '%Q{}' or some orther thing like '%Q[]'.

1 comment
Comment actions Permalink

Hello Wu,


def calendar_for(field_id)     javascript_tag(%Q{     $(function() { $("##{field_id}").datepicker({showOn: 'button', buttonImage: 'calendar.gif', buttonImageOnly: true}); });     })     #image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +     #javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")   end

I defined a method in my application_helper.rb,and I want to modify the string 'calendar.gif' to 'calendar.png',but I can't modify it,I even  can't select the string 'calendar.gif',I can't describe it very well,if you copy this method to your .rb file,you will find it so strange!

Works fine for me, cannot reproduce. I was able to change 'calendar.gif' to 'calendar.png'.

And more,if I type '%Q',it will give me '%QQ',not '%Q{}' or some orther thing like '%Q[]'.

Thanks for the issue, I've filled bug:http://www.jetbrains.net/jira/browse/RUBY-3651
Feel free to comment, vote and track progress on it.

Regards,
Oleg

0

Please sign in to leave a comment.