Search Results

Search found 6 results on 1 pages for 'doctororange'.

Page 1/1 | 1 

  • Tracking referrals between profiles on the same domain in Google Analytics

    - by doctororange
    I have a website at mydomain.com that uses Analytics. I have a blog that resides at mydomain.com/blog/, which also uses Analytics They are on different profiles. The main site uses something like: _gaq.push(['_setAccount', 'UA-XXXXXXXX-6']); While the blog uses: _gaq.push(['_setAccount', 'UA-XXXXXXXX-7']); _gaq.push(['_setCookiePath', '/blog/']); My issues is that this seems not to track referrals from the blog through to the main site when, for instance, the logo which links to the main site is clicked. Ideally, I would like the clicks of this logo to report that the source was mydomain.com/blog/, but because they are at the same domain they seem to register as direct traffic. Have I missed a step in my configuration, or will I have to resort to linking to something like mydomain.com?ref=blog? Thank you.

    Read the article

  • Passing multiple codeblocks as arguments

    - by doctororange
    I have a method which takes a code block. def opportunity @opportunities += 1 if yield @performances +=1 end end and I call it like this: opportunity { @some_array.empty? } But how do I pass it more than one code block so that I could use yield twice, something like this: def opportunity if yield_1 @opportunities += 1 end if yield_2 @performances +=1 end end and: opportunity {@some_other_array.empty?} { @some_array.empty? } I am aware that this example could be done without yield, but it's just to illustrate. Thanks.

    Read the article

  • How can I get Rails to interpret a text field as a datetime

    - by doctororange
    My database has a datetime field, and I want to be able to create new entries. Obviously the Rails datetime_select helper isn't the most user friendly thing to have in your form. I'd rather have a text field for the datetime (or one for the date, and one for the time) and interpret the inputs like PHP strtotime can. I might just be searching the wrong keywords. Surely this has been discussed in great depth somewhere. Thanks :0)

    Read the article

  • How to make sure a method returns an array, even when there is only one element in Ruby

    - by doctororange
    I have a Ruby method that searches an array of hashes and returns a subset of that array. def last_actions(type = 'all') actions = @actions if type == 'run' actions = actions.select {|a| a['type'] == "run" } end return actions end This works, except when there is only one action to return, in which case I don't think it is returning an array with one element, but just the element itself. This becomes problematic later. What's a good way to ensure it returns an array of 1 element in this case? Thanks.

    Read the article

1