My little contribution to a rails plugin (sort of)

2009 June 14
by Fadhli

Getting your bug fix/code pulled into the main repo really gets you excited & satisfied.

I never thought it could give me this much sense of enjoyment. Check it out.

http://github.com/dmix/weekly_builder/tree/master

4 Responses leave one →
  1. 2009 June 30
    darin permalink

    Hi, and thanks for your contribution. I think i love it… It is exactly what I was looking for.

    Could you please clarify something for me?

    On (or about) line 63 of weekly_builder/lib/weekly_calendar.rb in the concat(…) section, I am trying to edit the :o nlick function to do something else, and can’t seem to get any syntax to work (at all, not even an a page.alert ‘Why won’t this change’).

    I need it to show/hide a partial instead of going to an href. I have accomplished this on the event.name with ‘edit’, :locals => {:event => event } } -%> in the view, but the whole div is perfectly clickable, and I would like to control the action on that instead of only being able to click on the name.

    I have googled and cannot seem to find a solution. Everything I try either throws a javascript error, or does nothing once I fix that error…

    Any help or direction would be greatly appreciated.
    Thanks in advance,
    D

  2. 2009 June 30

    Hi, darin. Thanks for commenting. To solve your problem, I suggest you could simply put a javascript function call on the onclick option. For example:

    concat(content_tag(“div”, ”, :id => “click_hour”, :o nclick => “click_me();”))

    And in your view, you could do a simple script like so

    function click_me() {
    //do some funky stuff
    }

    This is the simplest solution I can think of. I hope this could at least help you on your use case.

  3. 2009 July 11

    I am sorry, it not absolutely approaches me. Perhaps there are still variants?

  4. 2009 July 13

    In it something is. Now all is clear, I thank for the help in this question.

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS