Skip to content

My little contribution to a rails plugin (sort of)

June 14, 2009

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.

4 Comments leave one →
  1. darin permalink
    June 30, 2009 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 :onlick 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 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,

  2. June 30, 2009 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”, :onclick => “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. July 11, 2009 4:53 pm

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

  4. July 13, 2009 11:33 pm

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: