My little contribution to a rails plugin (sort of)

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

Tags: ,

4 Responses to “My little contribution to a rails plugin (sort of)”

  1. darin 30. Jun, 2009 at 5:52 am #

    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. Fadhli 30. Jun, 2009 at 9:44 am #

    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. Drogeidiolo 11. Jul, 2009 at 4:53 pm #

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

  4. Thymnmoneew 13. Jul, 2009 at 11:33 pm #

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

Leave a Reply