« Back to channel list

#RubyOnRails - 05 July 2013

« Back 1 day Forward 1 day »
[00:00:58] crankharder: elaptics: nah, new dev box i'm deploying from.
[00:03:57] kara_sweets: Radar: ahh thanks that did it
[00:04:03] Radar: kara_sweets: \o./
[00:04:15] Radar: The . is an bonus FREE extra
[00:04:22] kara_sweets: now the edit_survey_path on the show page is throwing an undefined method error, so i took the same approach but still no cigar
[00:04:28] kara_sweets: <%= link_to 'Edit', edit_survey_path([@company, @survey]) %> |
[00:04:35] Radar: edit_company_survey_path
[00:05:02] kara_sweets: thank you mucho
[00:07:04] w32stuxnet: hey guys, does anyone know what the best resource for writing rails 4 plugins (not gems) is?
[00:07:21] helpa: w32stuxnet: http://guides.rubyonrails.org/engines.html - Engines Guide - Written by Ryan Bigg
[00:07:21] Radar: w32stuxnet: !engines
[00:07:28] Radar: w32stuxnet: depends on what you want the plugin to do, really.
[00:07:48] w32stuxnet: thank you :)
[00:08:04] w32stuxnet: Basically a modular rails app that runs alongside another but shares the database
[00:08:07] w32stuxnet: essentially an engine
[00:09:24] Radar: ACTION commits a non-insignificant change to codebase, git push origin master --force and leaves
[00:10:54] _bart: Radar: don't forget cap production deploy
[00:19:32] w32stuxnet: Thanks Radar
[00:23:35] garbagecollectio: what does this line do
[00:23:37] garbagecollectio: ActiveAdmin.register Person do
[00:25:49] Radar: garbagecollectio: leads you into the pit of Hell that is ActiveAdmin.
[00:36:54] w32stuxnet: garbagecollectio, I am experiencing the symptoms that Radar describes
[00:37:15] w32stuxnet: I have to thank the people who wrote this documentation, it's great
[00:37:27] garbagecollectio: why is it so bad
[00:40:03] Radar: garbagecollectio: because it lures you into this false sense of security and then the moment you try to do something different from the standard it turns on you and eats your very soul
[00:40:14] Radar: garbagecollectio: please just write your own custom admin interface as the rest of us sane people are doing.
[00:40:15] garbagecollectio: thats all of rails
[00:40:33] garbagecollectio: and the type of ppl who use rails generally are conformist
[00:40:52] kara_sweets: when showing a list of associated resources like @company.surveys.each
[00:41:32] kara_sweets: I'm using this for routes
[00:41:33] kara_sweets: company_survey_path([@company, survey]
[00:41:47] kara_sweets: but its generating this <a href="/companies/11/13/surveys/11">Show</a>
[00:41:59] brownies: that's odd.
[00:42:08] brownies: stop generating that.
[00:42:09] Radar: What is @company?
[00:42:41] kara_sweets: @company = Company.find(params[:id])
[00:43:04] kara_sweets: and the list is showing at http://localhost:3000/companies/11
[00:43:33] Radar: kara_sweets: show us the complete code for the view please
[00:44:05] kara_sweets: view : https://gist.github.com/anonymous/fc683b6cfc6454b77bd1
[00:44:26] Radar: why are they in []?
[00:44:31] Radar: company_survey_path(@company, survey)
[00:44:32] helpa: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[00:44:38] helpa: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy
[00:44:38] Radar: !gettingstarted also covers that
[00:45:50] garbagecollectio: how do i stop a page from rendering when an action method is called
[00:46:11] kara_sweets: Radar: ahh syntax error sorry, thanks for the patience though, help is much appreciated
[00:46:29] Radar: garbagecollectio: return
[00:46:40] Radar: garbagecollectio: why do you want it to stop rendering?
[00:46:49] kara_sweets: I've sort of started thinking that any rails helper that accepts multiple arguments takes them as an array
[00:46:59] garbagecollectio: idk i was just wondering
[00:47:02] garbagecollectio: what does :row do
[00:47:11] Radar: garbagecollectio: seriously?
[00:47:32] Radar: garbagecollectio: please a) stop using ActiveAdmin. You will die if you keep using it. It's that bad. b) learn the basics of Ruby.
[00:47:44] garbagecollectio: to teach me the basics
[00:48:02] Radar: garbagecollectio: Teaching you what a Symbol is is tooooooo basic.
[00:48:15] Radar: garbagecollectio: there are plenty of good books out there that teach you these very basics of Ruby.
[00:48:25] Radar: If you're not going to put any effort into researching for yourself first, then we will not help you.
[00:48:33] Radar: After all, that *is* rule 1 of this channel.
[00:48:35] helpa: Do your research before hand. Your question may be answerable with a quick Google search or by simply experimenting. If you're using a method in Rails, look it up in the API Docs or in the Official Guides.
[00:48:49] brownies: this channel has rules?
[00:48:53] helpa: brownies: https://gist.github.com/996779
[00:48:53] Radar: brownies: !rules
[00:48:55] helpa: brownies: Radar is the GodKing of #rubyonrails. Obey him and all shall go well.
[00:48:55] Radar: brownies: !rule0
[00:48:57] Radar: brownies: !rule14
[00:49:00] helpa: brownies: Don't piss off Radar.
[00:49:00] Radar: brownies: !rule13
[00:49:15] Radar: Admittedly they are a little biased towards those who are helping.
[00:49:47] brownies: Radar: if people actually followed these rules, the world would be a magical and happy place
[00:50:00] Radar: brownies: yes
[00:50:13] garbagecollectio: i can't find ago ogle search on :row
[00:51:08] garbagecollectio: ok ok i hav ea better question
[00:51:16] garbagecollectio: when can "self" be used and what does it do
[00:52:07] brownies: every man must come to know his self.
[00:52:11] Radar: garbagecollectio: if you're going to continue asking basic questions without doing research then I will have to mute you.
[00:52:16] sam113101: read a book
[00:52:17] Radar: garbagecollectio: please read a book on Ruby.
[00:52:26] sam113101: finish it, then
[00:52:27] Radar: I am not Jesus.
[00:52:37] sam113101: Radar: he was refering to me I think
[00:52:39] garbagecollectio: http://ruby.railstutorial.org/chapters/static-pages#top
[00:52:54] brownies: that's not a Ruby book -_-
[00:53:20] brownies: does helpa have a !thing for the programming ruby book?
[00:53:28] helpa: For a whole slew of sites for learning Ruby, which is a tremendous aid to learning Rails, see http://iwanttolearnruby.com
[00:53:28] Radar: !iwanttolearnruby
[00:58:22] brownies: hm... so many handy tips in here.
[00:58:32] brownies: there needs to be a "greatest hits" summary of these
[00:58:56] garbagecollectio: yeah real helpful
[01:01:05] garbagecollectio: bigger question is how does rails work
[01:01:26] garbagecollectio: how do instance members get shown in the view
[01:01:44] garbagecollectio: how is the view actually processed, as a template and the appropriate vars filled in or other things executing
[01:01:55] garbagecollectio: are there two interpreters, a view interpreter a controller interpreter, etc
[01:05:09] Radar: garbagecollectio: that is quite a big question. Rails is a series of components that are bundled together.
[01:05:22] Radar: instance variables are passed to the view by some hackery that I won't go into because it's too deep
[01:05:31] Radar: views are processed using ActionView methods, controllers by ActionPack.
[01:05:35] Radar: Now GO RESEARCH.
[01:12:59] garbagecollectio: Radar, can u please go into it?
[01:13:21] garbagecollectio: and can you help me know what to search for: what are these ActiveAdmin, ActionView, ActionPack, ActionController? things
[01:13:50] TheMoonMaster: ActiveAdmin is a gem.
[01:18:01] sebastianb: he's annoying
[01:19:06] brownies: if only there were some sort of "engine" that let you "search" the internet for information, then he could use that
[01:19:09] garbagecollectio: whats ActionView and ActoinPack and stuff
[01:19:25] garbagecollectio: guys its not weird to ask to discuss things
[01:19:31] garbagecollectio: even if i could read about it
[01:19:38] garbagecollectio: its not the same as talking through it with someone
[01:20:01] sebastianb: how about you actually read about it, and ask about things you don't understand
[01:20:25] garbagecollectio: how about u get psyched about teaching someone?
[01:20:48] garbagecollectio: it's pathetic to not want to teach you might as well be some low life programmer, maybe you are a low life programmer
[01:20:57] sebastianb: well, there are websites that will teach you
[01:21:38] sebastianb: video courses etc
[01:21:42] bratsche: Settle down everyone. :)
[01:21:42] sebastianb: but you have to pay for that
[01:21:42] brownies: ACTION pokes Radar 
[01:22:12] sebastianb: afair it's not #we_will_teach_you_rails_from_a_to_z
[01:26:08] garbagecollectio: sebastianb I'm not asking for that i asked wtf actoinpack is
[01:26:58] sebastianb: and they said: go research
[01:27:16] garbagecollectio: is action pack the base ruby classes?
[01:27:17] bratsche: garbagecollectio: https://github.com/rails/rails/tree/master/actionpack <-- read the README here, it's a decent overview.
[01:27:26] garbagecollectio: but is that how the core is built
[01:27:33] garbagecollectio: and gets interpreters by the ruby interpreter
[01:27:39] garbagecollectio: to make all this happen
[01:28:06] bratsche: btw, you're still missing an 'n'
[01:30:31] garbagecollectio: is this the base ruby classes that enables the "rails" syntax
[01:32:02] sevenseacat: what 'rails syntax'?
[01:32:15] sevenseacat: garbagecollectio: people would answer you better if you asked questions that made sense.
[01:33:28] garbagecollectio: what rails syntax?
[01:33:46] garbagecollectio: how about .empty?
[01:33:48] garbagecollectio: thats not a ruby thing
[01:34:26] Radar: is chanserv down?
[01:34:27] bratsche: That's from active support.
[01:34:35] garbagecollectio: sevenseacat, what does that do?
[01:34:42] garbagecollectio: I'm asking what are the classes that enable that
[01:34:47] garbagecollectio: is that actionpack
[01:34:58] garbagecollectio: where are the base files for the language
[01:34:59] bratsche: activesupport
[01:35:14] sevenseacat: asking questions, not listening to the answers
[01:35:43] bratsche: garbagecollectio: The base classes for Ruby are in Ruby.
[01:35:53] Radar: garbagecollectio: final warning
[01:36:03] Radar: garbagecollectio: please do your research before asking questions
[01:36:04] garbagecollectio: active support does what?
[01:36:19] garbagecollectio: radar, any suggestions where this is talked about?
[01:36:24] bratsche: Google knows.
[01:36:25] Radar: garbagecollectio: read the README for activesupport
[01:36:26] Radar: jesus man
[01:36:32] garbagecollectio: Radar, already did
[01:36:43] sebastianb: I think he's... special
[01:36:45] Radar: garbagecollectio: cool so you know what it does
[01:37:22] garbagecollectio: Radar, I guess you aren't familiar with the extent of the documentation regarding ActiveSupport: https://github.com/rails/rails/tree/master/activesupport
[01:37:51] Radar: garbagecollectio: and? Doesn't that answer your question?
[01:38:02] Radar: The core extensions are documented here also: http://guides.rubyonrails.org/active_support_core_extensions.html
[01:38:16] Radar: you're wasting the channel's time by making us do the research for it
[01:38:22] Radar: You are not a dumb person
[01:38:26] garbagecollectio: neither of those answer the question of how ruby is compiled
[01:38:28] Radar: Please don't act like a child.
[01:38:35] Radar: Ruby is interpreted
[01:38:39] garbagecollectio: sorry interpreted
[01:38:56] garbagecollectio: but its technically JITTed
[01:39:13] bratsche: That has nothing to do with whether it's compiled or interpreted.
[01:39:29] bratsche: No it doesn't.
[01:39:49] Radar: garbagecollectio: now I remember why I banned you in the first place
[01:39:56] Radar: http://logs.ryanbigg.com/RubyOnRails?date=2013-02-17#590062
[01:40:00] Radar: Same problem, 5 months ago
[01:40:25] garbagecollectio: http://en.wikipedia.org/wiki/Just-in-time_compilation
[01:40:44] garbagecollectio: bratsche, it has a big effect on performance and thus you can't truly say its purely interpreted or compiled
[01:40:46] Radar: http://logs.ryanbigg.com/RubyOnRails?date=2013-02-16#586924
[01:40:49] Radar: http://logs.ryanbigg.com/RubyOnRails?date=2013-02-16#586909
[01:40:52] Radar: further examples
[01:40:57] bratsche: garbagecollectio: Yes you can.
[01:41:05] Radar: Everyone: please ignore garbagecollectio
[01:41:09] Radar: He is nothing but a troll.
[01:41:59] garbagecollectio: how can you say its an interpreted language if it is running partially off its pre compiled state
[01:42:33] sevenseacat: aye aye captain Radar.
[01:42:51] bratsche: So how's everyone doing tonight? :)
[01:42:57] linusoleander: How do I combine a scope with a namespace?
[01:42:58] linusoleander: I want /user/channels call User::ChannelsController
[01:43:08] Radar: linusoleander: namespace :user
[01:43:52] linusoleander: Radar: That only calls ChannelsController
[01:44:14] Radar: linusoleander: no it doesn't.
[01:44:30] Radar: linusoleander: namespace :user do; resources :channels
[01:44:39] Radar: routes to user/channelscontroller
[01:45:22] linusoleander: Strange, if User::ChannelsController doesn't exist, then just ChannelsController is called
[01:45:34] linusoleander: That's why I didn't' got it to work
[01:49:25] bratsche: Radar: I have a question for you.. in the Rails guide under scopes, it says when passing a parameter using a class method is the preferred way (instead of a scope). It looks like you wrote that, so just curious what's the rationale behind that or if it's even still up-to-date (it's from 2010)
[01:49:50] Radar: bratsche: having a scope that takes arguments meant that the syntax was quite ugly.
[01:50:23] Radar: scope :between, lambda { |start_date, end_date| where("date >= ? and date <= ?", start_date, end_date)
[01:50:49] Radar: Having it as a class method means it's: def self.between(start_date, end_date); where("date >= ? and date <= ?", start_date, end_date); end
[01:50:57] bratsche: Yeah, I still prefer scopes personally. But maybe it's just me. scope just conveys something that a method alone doesn't, at least to me.
[01:51:17] sevenseacat: scopes are always chainable, thats the #1 reason for me to use them
[01:51:28] bratsche: Radar: Right.. but if you have a conditional in there for some reason then it may return nil and a scope won't
[01:51:43] bratsche: sevenseacat: Right, that's what I was just getting to..
[01:52:02] Radar: class methods are chainable also
[01:52:18] sevenseacat: Radar: not guaranteed
[01:52:19] Radar: imagine that between is on the Post model and the Post model is associated with a user
[01:52:20] bratsche: Radar: But if you have a conditional it may break it.
[01:52:27] Radar: bratsche: Then don't have a conditional that breaks it!
[01:52:28] bratsche: where(some condition) if is_admin?
[01:52:34] Radar: bratsche: that's just poor coding
[01:52:43] Radar: and it's more likely that you would scope further if the user isn't an admin
[01:52:56] Radar: otherwise just return the current scope, which you can do with the `scoped` method.
[01:53:35] _bart: Error(440): NickServ Services are currently unavailable ?
[01:53:57] bratsche: Radar: Right, but what I mean is just that people are reading the Rails guides and thinking that scopes are *exactly* the same as class methods. I got into an argument with someone at work about this recently who was insisting that they will always work the same, and they won't.
[01:54:19] bratsche: My example was really contrived, I admit.
[01:55:04] Radar: _bart: yes
[01:55:32] Radar: bratsche: I agree they won't work the same way if the class method is set up so that it returns anything but an ActiveRecord::Relation object.
[01:55:50] Radar: I suspect you can get lambda scopes to not return an ActiveRecord::Relation object as well, although I haven't tried that to be sure,.
[01:56:22] bratsche: def self.tagged_as(tag); where(tag: tag); end
[01:56:42] bratsche: Err.. where(tag: tag) unless tag.blank?
[01:56:56] sevenseacat: http://blog.plataformatec.com.br/2013/02/active-record-scopes-vs-class-methods/
[01:57:00] bratsche: Anyway, whatever.
[01:57:40] bratsche: ACTION reads
[01:58:36] bratsche: sevenseacat: Yeah, this is exactly what I was talking about. But described better, so thanks. :)
[02:09:24] garbagecollectio: so if i have a symbol i can call it from everywhere, in that sense its a constant
[02:15:11] pontiki: except you don't assign to a symbol
[02:15:25] Radar: pontiki: please ignore garbagecollectio. They are in time out.
[02:16:23] Zesty: could someone tell me why nickserv won't reply? i started IRC and none of my chats connect, and i cant identify
[02:16:27] Zesty: this is the only one that works, for some reason
[02:16:36] sevenseacat: services are down.
[02:16:46] pontiki: sorry, will do
[02:17:00] pontiki: Zesty: try #freenode
[02:17:20] Radar: thank you pontiki
[02:17:22] Radar: bbl lunch
[02:17:29] pontiki: mmmm lunch!
[02:20:44] pontiki: i see why they are on a timeout
[02:27:31] zeromodulus: bitbucket will be having scheduled maintenance for about 6 hours.
[02:31:56] garbagecollectio: any other rails channels?
[02:32:01] pontiki: that's a long time
[02:32:01] pontiki: maybe they're setting off fireworks in the NOC
[02:34:34] garbagecollectio: how can you just rails symbols like anywhere
[02:34:43] garbagecollectio: but thats true right
[02:35:02] garbagecollectio: if i did person1 = { :blah => 'string' }
[02:35:11] garbagecollectio: it would output string?
[02:38:12] Fire-Dragon-DoL: mhhh I use rvm for development, should I use rvm or rbenv for production? I have no idea about the differences
[02:39:21] brownies: Fire-Dragon-DoL: be consistent. try to maintain the same tools across dev and production, as much as you can.
[02:40:08] garbagecollectio: how come sometimes people can just use the symbol without linking it to anything
[02:40:55] brownies: ACTION pokes Radar some more
[02:41:45] zeromodulus: Radar, sevenseacat: I am now stalking you on Twitter. :P
[02:42:02] sevenseacat: zeromodulus: awesome.
[02:42:33] Fire-Dragon-DoL: brownies: I agree with you, but I have no problems moving to rbenv if I should use that for production... just, I have no idea why should I choose one over another. I've chosen RVM just because I've heared about it earlier
[02:42:41] Fire-Dragon-DoL: zeromodulus: !!!!
[02:42:54] brownies: Fire-Dragon-DoL: i use rbenv. some people use rvm. such is life.
[02:42:54] Fire-Dragon-DoL: sevenseacat: I'm stalking them too now!
[02:43:07] sevenseacat: zeromodulus: enjoy my football-and-other-sports rants with bits of programming mixed in.
[02:43:21] brownies: i have my reasons. they have theirs. presumably, anyway.
[02:44:18] Fire-Dragon-DoL: sevenseacat: you are easy to find, radar looks like it's a common word on twitter, however xD
[02:49:51] sevenseacat: brownies: some of us use neither :p
[02:51:10] Fire-Dragon-DoL: sevenseacat: tracking you now
[02:51:23] Fire-Dragon-DoL: sevenseacat: or stalking as you prefer
[02:52:17] sevenseacat: i'm used to it.
[02:52:59] Fire-Dragon-DoL: I can't really work today
[02:53:04] Fire-Dragon-DoL: my mind stop after every line
[02:53:20] Fire-Dragon-DoL: and by stop I mean becomes disabled for ~10 minutes
[02:54:29] brownies: then stop hitting enter. just write one really big line with semicolons.
[02:54:34] brownies: ACTION is a productivity genius
[02:57:36] zeromodulus: https://www.youtube.com/watch?v=5aQ3Hnn3gXc
[02:58:28] Fire-Dragon-DoL: oh please keep linking distracting things
[02:58:31] Fire-Dragon-DoL: I can't work at all xD
[02:59:15] sevenseacat: http://www.youtube.com/watch?v=I7bAuzNTIBs
[03:00:36] zeromodulus: This should keep you entertained: http://www.youtube.com/watch?v=V9dRz2gDzLI
[03:00:58] zeromodulus: It gets funnier the more you watch it.
[03:01:33] Fire-Dragon-DoL: I didn't laugh :S
[03:05:00] zeromodulus: ACTION checks Fire-Dragon-DoL's temperature.
[03:05:41] Fire-Dragon-DoL: I'm ok, maybe it's not fun because I don't know the game
[03:06:04] zeromodulus: I haven't even played that game and I find it hilarious.
[03:06:06] zeromodulus: Cracks me up every time.
[03:06:16] zeromodulus: You don't need to know what game it is to find it funny.
[03:06:38] zeromodulus: It's 'merica day here in 'merica.
[03:06:54] zeromodulus: The whirlygigs are beginning to explode outside.
[03:07:02] sevenseacat: 'murrica. fk yeah.
[03:09:26] Fire-Dragon-DoL: zeromodulus: http://www.youtube.com/watch?v=LrOIgxQ--Tc I prefer this (and I didn't play the game)
[03:09:57] zeromodulus: that's awesome
[03:11:04] Fire-Dragon-DoL: no sorry this is even better zeromodulus: http://www.youtube.com/watch?v=FOaGhE_sejI
[03:11:11] Fire-Dragon-DoL: that was the one I was looking for
[03:11:20] Fire-Dragon-DoL: I laughed a lot because of the music (and the weapon) xD
[03:12:28] zeromodulus: Battlefield is so fun.
[03:12:42] zeromodulus: But they're jerks when it comes to product keys.
[03:12:50] zeromodulus: Er, EA, I mean.
[03:13:26] zeromodulus: "Oh, if you delete the PS3 profile on which you registered your game, your key becomes invalid. Nevermind that you still have the key on paper, in your hardcopy of the game."
[03:13:44] zeromodulus: "One registration only. Ever."
[03:14:32] zeromodulus: My ex registered the game on her profile, and so when I went to delete her profile I invalidated my registration key and I can't play it online again unless I pay $10.00 for a new key.
[03:18:03] Fire-Dragon-DoL: I didn't buy a single ea game last year
[03:18:16] Fire-Dragon-DoL: I'll try to keep doing this
[03:29:09] rswolff: Is the asset pipeline still the preferred method for dealing with serving assets in Rails 4?
[03:30:06] rswolff: Though sprockets has been moved into a plugin?
[03:30:39] sevenseacat: sprockets has always been a separate gem
[03:30:40] Fire-Dragon-DoL: rswolff: you can actually use sprockets without rails
[03:31:15] Fire-Dragon-DoL: but I obtained more or less the same result without it, just used guard and some nice guard plugins
[03:32:20] rswolff: I am getting an error when I try to deploy my Rails 4 application using capistrano. During the asset precompilation task, my rake db:migrate fails stating that a table doesn't exist. Why is rake db:migrate related to asset precompile?
[03:32:31] rswolff: The specific error is: Mysql2::Error: Table 'helpinghands_production.units' doesn't exist: SHOW FULL FIELDS FROM `units`
[03:33:14] Radar: rswolff: Did you not migrate the table?
[03:33:24] rswolff: It fails on cap deploy:cold
[03:33:26] Radar: rswolff: and what is the remainder of the error message?
[03:34:11] rswolff: I can see that the database is created, however the migrations are failing.
[03:34:44] rswolff: The whole message is: rake aborted! Mysql2::Error: Table 'helpinghands_production.units' doesn't exist: SHOW FULL FIELDS FROM `units`
[03:35:37] Fire-Dragon-DoL: damn I faced that issue a lot of times
[03:35:43] Fire-Dragon-DoL: but I definitely don't remember how do I fix
[03:38:59] Radar: rswolff: Any way that you could get the command to generate more output than that?
[03:39:05] Radar: rswolff: maybe with rake <task> --trace?
[03:39:22] rswolff: Let me check.
[03:39:49] rswolff: Actually, it's the capistrano task that is throwing the error message
[03:51:40] Fire-Dragon-DoL: I think it's time to go bed for me
[03:53:13] Fire-Dragon-DoL: ok, good night everyone
[04:17:53] bobbobbins: hey, newbie question here…i have a sort of convoluted product set up…products links to product_option_values, which links to option_values, which links to options, which links to option_types…..so for each product, I want to be able to access it from the opposite direction, since thats easier to cycle through…how can i do something like that?
[04:18:20] bobbobbins: like, product.options.option_values
[04:19:41] bobbobbins: what would you want to see? the models?
[04:19:57] Radar: bobbobbins: sounds like you're using Spree.
[04:20:38] bobbobbins: Radar: maybe its similar, i just did it myself though
[04:20:44] Radar: bobbobbins: why? :)
[04:21:09] bobbobbins: Radar: just to learn
[04:21:15] Radar: " access it from the opposite direction" is where you lost me btw
[04:21:49] sevenseacat: 'links to' is where he lost me, because that could mean anything
[04:22:00] bobbobbins: sevenseacat: joins
[04:22:28] sevenseacat: youre writing joins in your code?
[04:22:47] bobbobbins: I'm just explaining how the db is set up
[04:22:47] sevenseacat: guess you didnt mean joins then
[04:23:19] bobbobbins: they're joined in the model…has_many, belongs_to…all that
[04:25:19] Oak: ACTION waves
[04:25:41] bobbobbins: they're all joined, but not all joined to one another…they follow the sequence i explained
[04:26:41] bobbobbins: products has many product_option_values, has many option_values, belongs to options, belongs to option_types
[04:26:53] sevenseacat: hey there we go, now we're getting close to something resembling code
[04:27:29] bobbobbins: but i'd kind of like to be able to do products.options.option_values….because its easier to loop through
[04:29:36] bobbobbins: i guess i just suck at explaining it
[04:31:04] bobbobbins: well ok, how about this…if i have a product object, based on that, how would i access all option_values of a certain option_type
[04:31:29] Radar: THE POWERRRRRR
[04:31:47] Radar: +b garbagecollectio!*@*
[04:32:07] Oak: Radar you could kick me to make sure its working. i'll come back.
[04:32:22] Oak: sweet offer i must add.
[04:32:35] Radar: Radar kicked Oak: done
[04:32:54] sevenseacat: hey Radar could you ban Oak just to make sure its working. >_>
[04:34:37] bobbobbins: does that still not make sense?
[04:34:40] Radar: garbagecollectio's ban is for 2 weeks.
[04:34:42] Radar: bobbobbins: yes
[04:34:55] bobbobbins: yes it does make sense, or yes it still doesn't?
[04:35:01] Radar: [14:31:04] <bobbobbins> well ok, how about this…if i have a product object, based on that, how would i access all option_values of a certain option_type
[04:35:10] Radar: all option_values of a certain option type for a specific product?
[04:35:14] Radar: step 1) use Spree
[04:35:43] sevenseacat: step 2) when people ask for code, provide code.
[04:36:01] Radar: Spree::Product.includes(:option_values => :option_types).where("option_types.name = ?", name)
[04:36:04] helpa: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[04:36:09] bobbobbins: i asked what code you wanted to see, the model?
[04:36:24] Radar: bobbobbins: modelS
[04:36:53] sevenseacat: you named a chain of like 5 models and their relationships and then ask what code i want to see?
[04:36:59] sevenseacat: well hum let me think about it
[04:43:05] bobbobbins: https://gist.github.com/anonymous/7a1cc243a55e50f7e603
[04:43:23] bobbobbins: ok…so i included category models too because its actually on a category page what I'm trying to do
[04:43:32] Radar: ugggghhhh
[04:43:36] Radar: why do people not know how to use Gist?
[04:43:38] helpa: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[04:43:38] Radar: !gist-usage
[04:43:48] Radar: ACTION waits
[04:45:17] sevenseacat: ACTION eats lunch
[04:48:54] Oak: ACTION reading the "Using Gist"
[04:49:22] sevenseacat: i love https://raw.github.com/radar/guides/master//using-gist/add-another-file-gist.png
[04:51:30] Radar: bobbobbins: Still waiting FYI.
[04:52:22] bobbobbins: Radar: I'm just going to figure it out on my own, you guys do a great job of making someone inexperience and asking for help feel like shit
[04:52:43] Radar: bobbobbins: Thank you.
[04:52:58] Radar: We pride ourselves on our pedanticness and ability to infuriate even the most staunch of newbies.
[04:53:08] Radar: Now seriously, we are trying to help you.
[04:53:29] Radar: If we can't see your code, it makes it a bit hard for us to understand what it is you're talking about. If we see some code and some attempts at the problem then we can grok it and understand.
[04:53:33] Radar: CODE speaks better than ENGLISH
[04:56:08] Oak: bobbobbins, they are our seniors (knowledge wise i mean). they want us to learn, and each person has his/her methods to make us understand and learn things. i think they all try to find a middle path between spoon feeding and saying "go figure out yourself". Ruby community is very, very friendly. appreciate it.
[04:56:43] Oak: and do as you are told, until you become a teacher yourself.
[04:57:14] Radar: thanks Oak
[04:57:48] Oak: np. just helping him understand.
[05:00:48] pnomolos: Hi all, I'm wondering if anyone is around who knows the internals of ActiveRecord. I'm trying to figure out if there's a way to retrieve the association chain used to return a single result. As in, I have @record = Customer.where('name = ?').first and want to get at the "Customer.where('name = ?')" bit
[05:04:38] Radar: pnomolos: And do what with it?
[05:05:37] pnomolos: Radar: this actually pertains directly (I believe) to your by_star plugin - I want .next and .previous to operate on the scope used to return the record, not over the entire set
[05:06:35] esparkman: if only we understood....
[05:07:12] pnomolos: Sorry, given a record, I want to find other records that were generated using the same scope
[05:07:32] Oak: I am wondering if this is a typo or not. on the "Using Gist" guide, if you CTRL+F "The box directly underneath the" line and read the full sentence. Is that a typo? Under the "name this file..." box is the box for code, not the box for description.
[05:07:47] Radar: pnomolos: Oh nice :)
[05:07:55] Radar: Oak: probably a typo
[05:08:01] Radar: Oak: https://github.com/radar/guides patches welcome
[05:08:04] zeromodulus: https://en.wikipedia.org/wiki/HTTP_referer#Origin_of_the_term_referer
[05:08:07] esparkman: Oak: it's likely just a typo since the interface has changed
[05:08:13] Radar: pnomolos: You might have to write your own scopes for that.
[05:08:15] Oak: Ah. got it.
[05:09:01] zeromodulus: Damn you Phillip Hallam-Baker.
[05:09:22] pnomolos: Radar: OK, that likely means that doing this https://github.com/radar/by_star/issues/18 probably isn't possible, then?
[05:10:12] pnomolos: Radar: At least not without retooling by_star_field to accept some sort of default scope, I suppose?
[05:10:18] Radar: pnomolos: correct
[05:11:53] pnomolos: Radar: OK, thanks! I might try to come up with something and push a patch for by_star :)
[05:12:01] Radar: pnomolos: thank you :D
[05:14:12] bobbobbins: ok, how about this: https://github.com/bobbobbins/hydro
[05:14:15] bobbobbins: thats my entire project
[05:14:43] Radar: bobbobbins: ok and what's the problem again? Wanting to find option values for a product where the option values are related to a specific option type?
[05:15:40] bobbobbins: Yes…there is also product type which relates to product and option type…so i thought if i did product.product_type.option_type.options that would give me the list, but it breaks when i add .options
[05:16:03] bobbobbins: and if i go the other way. product.product_option_values.product_options, it breakson product_options
[05:16:16] bobbobbins: I'm sorry, product options should be option_values
[05:16:22] Radar: why product_type?
[05:16:31] Radar: I don't understand where product_type came into this
[05:16:48] bobbobbins: i forgot i had it…
[05:16:48] Radar: And there are no option models included.
[05:17:19] bobbobbins: dang it, hang on
[05:17:27] bobbobbins: i must not have added them
[05:22:16] spygame: hey, i'm using gem 'google_drive' for creating and reading/writing gdoc spreadsheets. i need to publish the spreadsheet to the web programatically. any ideas ?
[05:23:56] bobbobbins: ok, they're up there now, sorry about that
[05:25:13] bobbobbins: so i made a product type table to say, ok, this produce is of type table, so it has certain attributes…same with options, this option is type color, so it needs a hex color as one of its fields….
[05:25:44] Radar: bobbobbins: has_many :option_values, :through => :product_option_values on Product model
[05:26:03] Radar: bobbobbins: Product.includes(:option_values => :option_types).where("option_types.id = ?", id)
[05:26:20] Radar: oh, it's option and then option type
[05:26:26] Radar: holy complex schema batman
[05:26:37] bobbobbins: yeah, it got really convoluted really quick when i built it
[05:26:38] Radar: bobbobbins: Product.includes(:option_values => { :options => :option_types}).where("option_types.id = ?", id)
[05:27:11] bobbobbins: and i messed up and joined product type to option type, when it should be product_type to option i think
[05:28:22] Radar: bobbobbins: what are you trying to build with this? Seems insanely complex and it's only a few models
[05:28:29] Radar: I don't understand why you need both options and option types
[05:28:41] bobbobbins: then i could do product has_many :options through: :product_type, right?
[05:29:26] bobbobbins: well i wanted it to be flexible…so a product has a certain type, and that type has certain option sets…those option sets have some values, then the product says, these are the values i want for that option set...
[05:30:53] bobbobbins: like, product type Table, has an option set Finish,….with 3 options, oak, mahogany, cherry…product A is a table, so it gets the Finish option set, but only oak and mahogany…....
[05:31:11] Radar: Sounds incredibly complex still.
[05:31:17] bobbobbins: ACTION head explodes
[05:31:19] Radar: We have prototypes for that kind of thing in Spree.
[05:31:35] Radar: A product can be built from a prototype and the prototype includes many option types (which in turn have option values)
[05:31:45] Radar: so you could have a prototype be a "table" and then create a new product off that
[05:32:01] Radar: brb in 10-15
[05:32:14] bobbobbins: thanks though, what you said makes sense, I'll give that a whirl
[05:33:56] Radar: bob… is gone
[05:34:17] Radar: Was going to say he should read the Spree guides: http://guides.spreecommerce.com/developer/
[05:34:34] Radar: particularly http://guides.spreecommerce.com/developer/products.html
[05:36:01] Oak: oh well, if i see him again, and it does not slip my mind, i'll give him the links.
[05:39:41] rakl: hey all. just looking for some advice on how to do something that I think is fairly simple… bear with me while I type out the scenario
[05:40:21] rakl: I have a User model and an Organization model. Users are connected to Organizations through a Memberships table
[05:40:45] Oak: ACTION is learning Ruby using Well Grounded Rubyist... 
[05:41:01] imton: guys, what's a good way/gem/mechanism/pattern to notify an app about something ? think of inter-app notifications/signals…etc
[05:41:08] rakl: Memberships have a `membership_type` field. Right now it's just an integer. 1 == "member" and 2 == "admin"
[05:41:42] rakl: I want a User to be able to apply to upgrade their membership_type to admin. and the existing admins of that organizations can approve this
[05:42:07] rakl: How do I model this so that a User can only apply once?
[05:42:24] brownies: you'll need some model to hold that notion
[05:42:31] brownies: like MembershipApplication or MembershipRequest or somesuch
[05:42:34] rakl: I'm thinking a MembershipApplication model. Create a record and store the state of the application
[05:42:42] brownies: and then you can enforce uniqueness constraints on that table
[05:42:50] joelteon: data-confirm/data-method isn't a rails-specific thing, right?
[05:42:52] rakl: yeah that I was thinking too
[05:43:11] rakl: trying to persist that in the Membership model isn't a good idea is it?
[05:43:11] brownies: if the application has only two states, i guess you can get away with a pretty simple thing... if the application has more than that, i'd strongly recommend a proper state machine
[05:43:17] brownies: no, that is not a good idea.
[05:44:00] sevenseacat: joelteon: it is rails, yeah.
[05:44:08] joelteon: so I'll have to manually replicate that behavior
[05:44:11] rakl: ok thanks brownies. good to have some confirmation on that
[05:46:29] rakl: brownies, I can see the MembershipApplication model being used for regular/non-admin memberships too. Some organizations auto-approve memberships, some want finer control. Should I *always* use the MembershipApplication model and create the Membership record based on whatever business logic? Or would it be simpler to directly create the Membership record when they're being auto approved
[05:49:50] brownies: rakl: it depends
[05:50:28] brownies: rakl: just based on what you've said, i feel like it might be nice to have the MembershipApplication always created, and then have an after_create hook that auto-approves it if appropriate
[05:51:16] rakl: right. I think that would be overkill in some cases, but it would make the whole process standardized
[06:32:29] melvinram: Question RE: TDD. Let's say you're adding a chart to a page. Would you do that using TDD as well? If so, how?
[06:33:04] melvinram: If it matters, the chart might be implemented using HighCharts or some other js library
[06:37:02] Guest49557: what happens when i write code like this def role?(role)
[06:37:32] Guest49557: i saw it in a code
[06:37:37] tbuehlmann: Guest20835, you are defining a method named role? which takes one argument
[06:37:53] Guest49557: tbuehlmann: but y use the ?
[06:38:05] tbuehlmann: methods ending with a ? denote that they return a boolean
[06:38:17] tbuehlmann: by convention
[06:38:33] Guest49557: tbuehlmann: thanks now i get it
[06:39:15] melvinram: tbuehlmann: that's in an incorrect use of ! :D
[06:39:30] melvinram: doesn't mutate anything
[06:39:50] tbuehlmann: it mutates my inner state
[06:40:35] melvinram: I disagree. The inner state change caused the calling of welcome
[06:40:48] melvinram: :D anyway, i was just messing around
[06:40:48] tbuehlmann: like a callback?
[06:48:21] Radar: KNOCK OFF TIME
[06:49:19] hackeron_: hey, I'm getting these exceptions emailed to me: "Missing template info/home, application/home with {:locale=>[:en], :formats=>["NULL"], :handlers=>[:erb, :builder, :raw, :ruby, :slim, :coffee, :haml]}" -- What does that mean and how do I stop these?
[06:49:40] melvinram: hackeron_: it says it right in the error
[06:49:50] hackeron_: there is a template for info/home - but what is formats: ["NULL"]?
[06:51:04] hackeron_: melvinram: yes, but there is a template, but not for formats: ["NULL"] - what is that format?
[06:51:38] Radar: hackeron_: some info on how you're getting the error would be mightly helpful
[06:51:40] Radar: hackeron_: i.e. code
[06:51:42] melvinram: what's the code that is calling this?
[06:52:08] hackeron_: Radar: melvinram: I'm getting weird requests that aren't even coming from my domain - I'll pastebin
[06:52:57] helpa: hackeron_: Pastebin sucks! Use Gist (http://gist.github.com) instead, please!
[06:52:57] Radar: hackeron_: !pbsucks
[06:52:59] hackeron_: full error: http://pastie.org/8112030
[06:54:48] tagrudev: show me your gists
[06:55:05] tagrudev: (pick up line)
[06:56:43] hackeron_: tagrudev: well, this is the routed to the info#home controller: http://xanview.co.uk/home - so it is fine, my question is what is :formats=>["NULL"] and how is the spammer asking rails to give a format NULL?
[06:57:10] melvinram: hackeron_: format is determined based on HTTP Accept header
[06:57:18] melvinram: so they are probably messing with that
[06:57:30] hackeron_: ok, is there anyway to just prevent format NULL?
[06:58:34] melvinram: hackeron_: thinking / googling
[07:03:00] hackeron_: melvinram: I did - you don't know either? :(
[07:04:10] melvinram: hackeron_: if I did, I wouldn't be googling / thinking
[07:04:10] twinkleHood: Morning, railsists! :3
[07:10:58] hackeron_: melvinram: any luck?
[07:11:02] melvinram: hackeron_: try setting the format to default to html ie. http://stackoverflow.com/questions/4643738/rails-3-respond-to-default-format though I suspect it does that already… but it's worth a try
[07:11:41] melvinram: hackeron_: alternatively, you could just ban the spammer from accessing your site
[07:12:08] hackeron_: melvinram: well, it seems they set their domain to point to my IP, I guess I could ban the domain in nginx
[07:13:26] melvinram: or you could redirect all visitors that have a request.format.nil? to your home page.
[07:13:40] hackeron_: melvinram: how do you do that?
[07:14:42] melvinram: try: redirect_to root_path if request.format.nil?
[07:15:34] melvinram: btw, what's the mime type for the request that's coming in?
[07:16:24] hackeron_: melvinram: this is the full exception email: http://pastie.org/8112030
[07:16:39] hackeron_: I think this is the issue: HTTP_ACCEPT : NULL
[07:19:07] melvinram: hackeron_: http://stackoverflow.com/questions/6778368/ruby-on-rails-and-strange-http-accept-header-from-psp
[07:22:27] melvinram: that monkey patch looks like it will fix the issue at least until a better approach is put into place
[07:26:09] melvinram: hackeron_: looks like the issue was fixed in rails 3.2 and beyond. which version of rails are you using?
[07:26:22] hackeron_: melvinram: 4.0.0 :/ - my the format I'm seeing is "NULL"
[07:27:06] melvinram: well not familiar with rails 4 yet so good luck with that
[07:55:49] youl: how to NOT compile an asset ?
[07:56:17] youl: I use CKEditor who loads /skins/moono/editor.css
[07:56:31] youl: I need this css to not be compiled with all others
[08:06:59] Veejay: Hello everyone. I am sending an email from a model (the model has a state machine and once a given state is reached, the email is sent). Inside the ActionMailer though, the wrong locale is being used when the email is sent, i.e. even though the locale is set to FR, the email is being set to EN. Is there any way for me to override that?
[08:08:23] Veejay: Is the I18n.locale dynamic inside a mailer?
[08:09:23] Veejay: Man this is twisting my brains in all kinds of ways
[08:13:58] maloik: I believe there may be a different type of locale for emails
[08:14:17] maloik: afaik your model simply doesn't have access to the locale either
[08:14:53] Veejay: maloik: Indeed, but the model is simply calling the deliver method
[08:15:02] Veejay: Basically the locale has been set up prior to that
[08:15:11] Veejay: The whole app is based on that locale
[08:15:20] Veejay: And all the pages are displayed in the proper language
[08:15:32] Veejay: Once I reach that mailer method though, the language is :en
[08:15:43] Veejay: Even though my locale is set to :fr
[08:16:37] Veejay: As if something is overriding it along the way
[08:16:50] schopenhauer: Hi. When deploying an app to capistrano I get an error 'uninitialized constant PopulateStream' during migrations, but this doesn't happen locally when I run rake. I have a PopulateStreamObserver that's included in config.active_record.observers and since there is no PopulateStream model, in the observer class I have adde observe :model1 :model2 - this is on rails 2.3. Anyone have any experience with observers?
[08:16:59] Veejay: What is strange though is that if I keep on browsing the app after the mail is sent, it's still in the proper locale
[08:17:18] Veejay: I checked the contents of my emails too, I do have both French and English as templates
[08:40:59] Sylario|2: what is the english name for ">"
[08:42:11] GeorgesLeYeti: I have a question with bootstrap modal. Everytime i click outside of the popup box it close it and i want to close the modal only when user click on close.
[08:43:14] injekt: Sylario|2: greater than symbol
[08:43:37] Sylario|2: injekt > thx
[09:06:43] ziikutv: I am wondering
[09:06:57] ziikutv: Why I am getting an error when I do Bundle exec rspec spec
[09:09:17] ziikutv: Here is a paste: http://pastebin.com/TrhZaxK8
[09:13:39] Sylario|2: has anyone ever used backup : https://github.com/meskyanichi/backup ? when i try to trigger it with crontab it does nothing and the output file is created but empty
[09:14:46] geoffw8_: Hi rails, quick question
[09:14:48] ziikutv: https://gist.github.com/ziikutv/5933190 << Here is the error outputed by terminal.. I have added my Gemfile, the helper file and the test written.
[09:14:49] geoffw8_: "Download the disk image from wkhtmltopdf downloads list and copy the file to a directory where PDFKit can find it. Homebrew is also available, run brew install wkhtmltopdf."
[09:14:55] geoffw8_: "where it can find it", i.e. in my path?
[09:15:05] geoffw8_: *somewhere in my path
[09:15:23] geoffw8_: ziikutv: I'm just trying to get PDFKit working, I'm installing it
[09:15:39] geoffw8_: "where PDFKit can find it" is a bit ambiguous to me, all I can guess is it means the path
[09:16:13] ziikutv: https://github.com/pdfkit/pdfkit
[09:17:37] ziikutv: can anyone help me with my error? I have used google with no help.
[09:17:40] geoffw8_: ziikutv: yeah, thats where I was
[09:21:32] ziikutv: when I run rspec command
[09:21:37] ziikutv: it says something about nokigiri
[09:22:06] sakshi: Hi all. I am a newbie at Rails. I was trying to implement paperclip from Railscasts. I downloaded the source code. But I could not find the gemfile. How do we get the gemfile?? Please tell me.
[09:22:31] rvanlieshout: sakshi: you don't have to download paperclip
[09:22:34] rvanlieshout: you should create a new rails project
[09:23:09] ziikutv: hm let me try reisntalling this nokogiri gem.
[09:23:16] ziikutv: RASIKPs-MacBook-Pro:sample_app rasikp$ gem install nokogiri
[09:23:16] ziikutv: ERROR: While executing gem ... (Errno::EACCES)
[09:23:16] ziikutv: Permission denied - /usr/local/rvm/gems/ruby-2.0.0-p0/gems/nokogiri-1.6.0/.autotest
[09:23:48] sakshi: ok. I'll try to create a new rails project.
[09:24:23] ziikutv: Gemfile should be there..
[09:24:26] ziikutv: with the project you forked.
[09:28:13] ziikutv: Is a person names SpaceGhost still in this irc?
[09:28:28] ziikutv: Spaceghostc2c
[09:28:33] Scient: what about it :>
[09:29:11] ziikutv: iuno just remember him from a long time ago.
[09:50:27] geoffw8_: I've just taken over a project using HAML. Come on, own up, who uses it
[09:50:38] geoffw8_: AND WHY! WHY PEOPLE
[09:50:41] geoffw8_: do you hate your fellow coders
[09:51:22] rvanlieshout: haml is awesome
[09:51:25] elaptics: geoffw8_: haml is awesome
[09:51:40] geoffw8_: haha, no guyyzzzz
[09:52:03] geoffw8_: afaic its just an unnecessary layer of abstraction
[09:52:08] geoffw8_: writing ERB just isn't a big deal
[09:52:14] geoffw8_: are you guys proper hardcore coders?
[09:52:32] geoffw8_: thats the only reason I can think people would love HAML
[09:52:44] rvanlieshout: many people hate haml because they can't combine there ruby code that easily in it
[09:52:55] geoffw8_: for me its just awkward and ugly
[09:53:02] rvanlieshout: it's efficient and clean
[09:53:39] rvanlieshout: and if you reach the point where you need to add much code in your view you're just using mvc wrong
[09:53:46] geoffw8_: to be honest I should wait until I've finished this contract, because by then I'll know enough to be able to give a proper opinion
[09:54:05] geoffw8_: I just feel right now that I'm looking at view code and its just gibberish
[09:54:21] rvanlieshout: could also be somebody who wanted to use haml but wasn't ready to do that
[09:54:24] geoffw8_: I'm looking at a report, in a table, and as you can imagine its virtually unreadable
[09:54:27] rvanlieshout: and tried to include bunches of ruby code in it
[09:54:43] rvanlieshout: a proper table is really readable
[09:55:17] geoffw8_: rvanlieshout: yeah this not so much, to be honest its an outsourced product I've been brought in to "fix", so its probably not entirely HAML's fault I hate the code so much
[09:55:50] geoffw8_: how I wish there was a converter!!
[09:56:22] rvanlieshout: there are erb2haml convertors iirc :)
[09:56:42] geoffw8_: rvanlieshout: yeah! As I typed I thought hold on i should google this
[10:05:58] _JamieD_: anyone know how to correctly set the rails environment in whenever? nothing in the documentation or anything from SO is working
[10:06:20] _JamieD_: my whenever task is rake "-s sitemap:refresh"
[10:09:15] _JamieD_: https://gist.github.com/kernow/7f097b013db795f8da58 so the case statement is picking up the correct environment, however the generated cron task has RAILS_ENV=production in it
[10:09:49] mikecmpbll: where are you setting the environment? :/
[10:10:02] elaptics: geoffw8_: I tend to find now that erb has begun to be unreadable to me, but I do think if you're working on a project with designers they may be more comfortable with erb style because it's just html with the erb tags in
[10:12:02] mikecmpbll: _JamieD_: where's @stage getting set?
[10:12:13] _JamieD_: mikecmpbll: I've tried the way from the read me "set :whenever_environment, defer { stage }", that doesn't work
[10:12:38] _JamieD_: mikecmpbll: thats in the deploy file
[10:13:28] mikecmpbll: and it can access that? (i've never used whenever)
[10:14:12] twinkleHood: Okay, straaaange problem. After upgrading to 3.2 from 2.1, a few of my migrations suddenly break.. in wierd way. This, for instance https://gist.github.com/kholbekj/471969602134690e28ee breaks on line 11 with "syntax error: Unexpected tASSOC"
[10:15:37] twinkleHood: (and "destroy all" in a file about laser availability always makes me smile. :)
[10:16:22] mikecmpbll: twinkleHood: it's because of your love for whitespace
[10:16:56] twinkleHood: mikecmpbll: Huh?
[10:17:07] TvL2386: hi guys, with unit testing, should I test the validations, or should I just check 'assert object.valid?' not caring which validator causes it?
[10:17:10] mikecmpbll: between the method name and the parens
[10:17:57] TvL2386: I went into testing the validators, but it's kind of hard and feels like I should just trust the validations to do their work... Test the end result and not the implementation or something
[10:18:08] twinkleHood: mikecmpbll: Oh. I didn't write this, by the way, i have no such inclinations :)
[10:18:16] mikecmpbll: if you're going to format it like that you'll have to make it explicit that it's a hash, I think. for example: Whatever.create! ( {something: "here"} )
[10:18:25] mikecmpbll: twinkleHood: haha, it's all good.
[10:18:52] twinkleHood: mikecmpbll: Well, i can see that you're right. Removing the space is a fix. Thanks man!
[10:18:54] FooBarWidget: oops, there was a regression in phusion passenger 4.0.6
[10:18:56] FooBarWidget: fixed in 4.0.7
[10:18:58] mikecmpbll: I'm not even sure why that breaks it tbh, but it seems to.
[10:19:44] twinkleHood: mikecmpbll: Was this restriction imposed later in the language? These migrations are sorta old.
[10:21:06] mikecmpbll: i think they brought in a deprecation warning in 1.8
[10:21:13] mikecmpbll: and the in 1.9 they removed it
[10:21:23] mikecmpbll: (the ability to do this syntax)
[10:21:58] twinkleHood: Well, that fits perfectly. Oh well, time to get out the regexes.
[10:24:23] sakshi: after running this commad: rails plugin install git://github.com/thoughtbot/paperclip.git , I a getting this error :cannot load such file -- rails/commands/plugin (LoadError). Can somebody help??
[10:24:45] mikecmpbll: ruby version?
[10:25:14] sakshi: ruby 2.0.0p195 (2013-05-14 revision 40734) [i686-linux]
[10:25:16] mikecmpbll: rails version, sorry
[10:25:47] sakshi: Rails 4.0.0
[10:25:48] toretore: plugins are gone in r4
[10:25:50] mikecmpbll: plugins are deprecated.
[10:26:23] mikecmpbll: https://github.com/thoughtbot/paperclip#installation
[10:27:55] sakshi: Shall i do this?rails plugin install https://github.com/thoughtbot/paperclip#installation
[10:28:28] certainty: tagrudev: still sober?
[10:28:37] tagrudev: today is the day
[10:28:40] certainty: friday evening dude
[10:29:06] tagrudev: tomorrow me have birthday
[10:29:09] certainty: are your hands all sweaty yet?
[10:29:10] tagrudev: tomorrow very drunk :D
[10:29:17] certainty: tagrudev: oh nice
[10:39:34] manouch: hi, i have an application.haml in my host application... this is used by my engines... however there are paths that are not accessible from the engine since they are host app paths... how can i avoid this problem?
[11:09:14] FooBarWidget: where does the rails community hang out? what's an active community site?
[11:09:25] FooBarWidget: apart from reddit /r/ruby and /r/rails, and hacker news, I don't know any
[11:16:38] maloik: FooBarWidget: I've been wondering similar things actually, I have no clue
[11:16:56] FooBarWidget: and there's rubyflow, which also tends to get quite some traffic
[11:17:10] FooBarWidget: and peter cooper's curated sites, like rubyweekly
[11:17:11] FooBarWidget: but other than that?
[11:18:05] maloik: I don't even count those as communities, they're more personal (or company) blogs/newsletters
[11:18:20] maloik: by those I mean rubyweekly and what peter cooper does
[11:18:34] toretore: FooBarWidget: the ml probably
[11:18:46] toretore: other than that there's not much
[11:18:55] toretore: (that i know of)
[11:19:07] maloik: FooBarWidget: can I ask you something in pm real quick ?
[11:20:23] elaptics: FooBarWidget: there's the ruby rogues parlay mailing list
[11:28:02] sakshi: Can any1 tell me, why am I getting this error?? http://pastebin.com/XkJVpb6v
[11:29:29] sakshi: http://pastie.org/8112569
[11:36:26] elaptics: sakshi: as per the error message it's because you don't have a table called products in your database
[11:36:41] elaptics: you're trying to change a column in a table that doesn't exist
[11:39:14] sakshi: elaptics : Thanks. So what should I do now??
[11:41:03] elaptics: sakshi: well why are you trying to change a column on a table that doesn't exist?
[11:41:41] elaptics: sakshi: do you have an earlier migration that created the products table?
[11:42:51] sakshi: I had done this: rails generate paperclip product photo
[11:43:27] elaptics: sakshi: right, but do you have a products table?
[11:45:03] sakshi: I don't know. How to check it?
[11:45:33] elaptics: sakshi: do you have a model called Product ?
[11:46:13] sakshi: elaptics: No
[11:46:29] elaptics: btw, please don't PM me without asking first. I prefer to keep all comms in the main channel
[11:46:54] elaptics: sakshi: well that's why then. So why did you run that rails generate paperclip command?
[11:47:36] sakshi: ohh I'm sorry
[11:47:58] sakshi: I was following railscasts tutorials
[11:50:29] _str: hi, is there any way to use "user_signed_in?" in route file?
[11:50:46] _str: "user_signed_in" belongs to devise
[11:51:11] elaptics: _str: not easily since your routes are hit before the controller
[11:51:31] injekt: _str: devise provides 'authenticated do ... routes here'
[11:52:00] injekt: you can also check r.env["warden"].authenticate? but I recommend authenticated
[11:52:29] _str: injekt: that's great , let me check it. tnx
[11:53:03] sakshi: elaptics: How do I solve my problem then?
[11:53:20] elaptics: sakshi: which railscast are you following?
[11:53:49] sakshi: elaptics: http://railscasts.com/episodes/134-paperclip?view=asciicast
[11:54:27] injekt: sakshi: you need to create the model you want to add paperclip to first
[11:55:19] elaptics: sakshi: ^ that railscast has assumed you already have a product model
[11:56:11] sakshi: elaptics injekt: Thanks. I'll create a model then.
[12:00:09] _str: injekt: yeah, that worked , tnx a lot :)
[12:12:23] tagrudev: certainty, http://www.youtube.com/watch?v=PNO2yxuzm04
[12:18:23] maloik: Just started development of a gem and already getting an error, it seems one of my files isn't getting loaded
[12:18:26] maloik: https://gist.github.com/hannesfostie/035cc9ebb899276c9aaa
[12:18:38] maloik: if I remove the require it's failing at I can run the hi method just fine
[12:18:45] maloik: must be missing something super obvious but I dont see it
[12:36:57] Yakko: maloik: it's kinda hard without looking at the project as a whole :(
[12:37:54] Yakko: maloik: but here's something easy, your require httpparty has no reason to be in there, you should have all of your requires in the same place
[12:51:34] ziggurat81: trying to install arch using bootable CD, ethernet board is not recongnized (wifi is)
[12:51:34] ziggurat81: board is: broadcom netlink BMC57780
[12:51:34] Yakko: maloik: are you calling that from inside IRB?
[12:52:56] Ergo^: ziggurat81: and you are asking this on rails channel? :D
[13:20:11] AntelopeSalad: guess i picked a bad time to ask a question lol
[13:22:54] sparklr: can anyone help with adding a child node to json ? http://stackoverflow.com/questions/17489359/rabl-collection-under-a-child-node ??
[13:30:54] sparklr: can anyone help with adding a child node to json ? http://stackoverflow.com/questions/17489359/rabl-collection-under-a-child-node ???
[13:34:29] rushed: sparklr: you might find a working example helpful http://railscasts.com/episodes/322-rabl
[13:35:14] arthurnn: sparklr: you probably can use something like this? http://stackoverflow.com/q/10109963/534150
[13:35:36] sparklr: rushed: I have seen it. its working here. I just need to move collection inside a child node
[13:36:44] youl: is it possible to define a layout to use for a whole module ?
[13:37:11] youl: or for a whole controller
[13:37:11] sparklr: arthurnn: rushed: you probably have got my question wrong. I have a collection. It works perfect as a root node. What if I want to move this collection inside one of the children ?
[13:38:02] arthurnn: sparklr: than u have to create a child node.. and set that as the root.
[13:38:18] sparklr: youl: layout 'product'
[13:38:19] arthurnn: your have the right collection :root config, but the root doesnt exist as a child.
[13:39:23] sparklr: arthurnn: i created a child node, inside which im calling collection. but it does not seems to be working. can you check out the stackoverflow question ? youl:
[13:39:35] sparklr: ^ http://stackoverflow.com/questions/17489359/rabl-collection-under-a-child-node
[13:40:39] arthurnn: sparklr: i have never used RABL before, but i think your are missing one more child node. i will ansewer the question, u try that out, if dont work i will delete the ansewer
[13:41:03] sparklr: arthurnn: alright thanks :)
[13:41:25] youl: sparklr: worked :) thanks (was easy, as always in Rails)
[13:41:56] sparklr: youl: np. enjoy! im stuck in a bigger problem
[13:43:39] arthurnn: sparklr: chekc it out my response...
[13:43:52] arthurnn: that is a guess.. so lemme know if works or not
[13:44:52] sparklr: arthurnn: ok thanks. trying
[13:44:58] maloik: Hmm, we have a route which accepts something like hostname.tld as an 'id', which works fine if we append .json or whatever, but as soon as I want to hit /api/hostname.tld/something this won't work anymore
[13:45:07] maloik: Is there a way around that ?
[13:46:44] Fire-Dragon-DoL: I have an issue with an "untrackable" error... I mean, it works on development but not on production and the error returned is quite enigmatic. We are dealing with e-mail sending here: Net::SMTPSyntaxError (501 Syntax error)
[13:47:26] Fire-Dragon-DoL: https://gist.github.com/Fire-Dragon-DoL/5934607
[13:47:43] arthurnn: Fire-Dragon-DoL: I would guess you have a form for ppl input their email, and then your smtp server delivers that email, correct?
[13:48:14] Fire-Dragon-DoL: arthurnn: the "biggest" issue
[13:48:19] Fire-Dragon-DoL: is that test_email
[13:48:30] Fire-Dragon-DoL: and it's sent in the exact same way as the bulk email
[13:48:43] sparklr: arthurnn: thanks a lot bro. it works. I modified the code a bit. but it works .... :)
[13:48:52] arthurnn: Fire-Dragon-DoL: i see this happening before, usually what happens is that someone in production is typing a invalid email(UTF-8 chars probably) and than the SMTP dont accept that.
[13:49:02] arthurnn: sparklr: sweet.
[13:49:18] Fire-Dragon-DoL: arthurnn: that's an important point
[13:49:26] Fire-Dragon-DoL: arthurnn: at least now I know what should I look for
[13:49:34] sparklr: arthurnn: i dont understand why two child are need though
[13:49:47] relix: in rails2.3, doing `link_to organisation`, this creates a link to organisations_path, not to organisations_path(organisation)
[13:49:54] arthurnn: Fire-Dragon-DoL: yep.. try to log the inputs from your form when the error happen.. so u will see
[13:49:58] Fire-Dragon-DoL: sparklr: because you usually try to have one male and one female children
[13:50:34] Fire-Dragon-DoL: arthurnn: already logged, I didn't put it on gist because I printed out all e-mails xD
[13:50:44] arthurnn: Fire-Dragon-DoL: lol
[13:52:01] rushed: relix: was organization nil or unpersisted at the time? also… upgrade your rails :)
[13:52:25] relix: rushed I wish I could update rails ;)
[13:52:29] ac-species: I ran `bundle install --without assets` and now `bundle install` automatically ignores the assets gems group. How do I get the asset gems back? (Rails 3.2.13, JRuby 1.7.4)
[13:52:39] relix: rushed nope none of that
[13:52:51] relix: `link_to o, o` does the job
[13:53:01] relix: `link_to o` links to index
[13:53:11] relix: or is this normal rails 2.3 behaviour
[13:53:27] relix: jesus, working with rails 2.3 is like eating rusty nails at times
[13:53:31] Fire-Dragon-DoL: I Imagine I need one of those long regex to parse if mail is vlaid
[13:54:26] momomomomo: Stop eating rusty nails then relix
[13:54:26] rushed: relix: so problem solved then :) and no, normal rails 2.3 behavior is to upgrade
[13:54:26] relix: guys, I can't update, ok, I know I could
[13:54:26] relix: I know i should*
[13:54:26] relix: rushed alright, thanks I guess ;)
[13:54:40] momomomomo: relix: http://api.rubyonrails.org/v2.3.8/ and best o' luck!
[13:55:06] relix: when doing link_to user it also links to the index of the controller it's on, so I guess it's normal behaviour
[13:55:19] relix: momomomomo that page has been my home for a while now :(
[13:55:32] relix: alright, going back in
[13:55:45] relix: if I don't make it back, tell my mom I love her!
[13:55:47] rushed: relix: take a flashlight!
[13:57:01] relix: thanks rushed !
[13:57:29] relix: luckily it's friday, I can legitimately drown my stress using intoxicating substances tonight
[14:11:33] ac-species: Answering my question: `vi .bundler/config` and run "dd" on the offending line.
[14:17:21] Fire-Dragon-DoL: arthurnn: FOUND!
[14:17:33] Fire-Dragon-DoL: arthurnn: a fucking SPACE in e-mail address =D
[14:17:59] arthurnn: thats not bad... at least u dont have russian chars on the email address.. lol
[14:18:37] Fire-Dragon-DoL: thanks a lot anyway
[14:18:43] Fire-Dragon-DoL: you took me out of a big trouble
[14:18:51] Fire-Dragon-DoL: I didn't have any idea what to look for with that error
[14:19:22] Fire-Dragon-DoL: and now that I know this, I'll pollute my code with mailcheck
[14:19:40] Fire-Dragon-DoL: and a rake task to list invalid e-mails
[14:20:31] treehau55: trying to think of the best way to trigger an api action based on a date or another action firing, im thinking of something like Wisper any opinions?
[14:24:39] mikecmpbll: treehau55: sounds like you want to schedule a job?
[14:27:11] mikecmpbll: having real trouble working out how to migrate from many single tenanted databases to a multi-tenanted database. can't figure out how to maintain foreign_keys etc
[14:30:25] boytoy: In my Rack middleware, how do I examine my headers? Not much luck with this one: Rails.logger.debug "BLEEP: #{headers}"
[14:31:03] rushed: mikecmpbll: maintain? what's going to break your foreign keys?
[14:35:36] rushed: boytoy: you might find this helpful http://railscasts.com/episodes/151-rack-middleware
[14:38:46] Fire-Dragon-DoL: I'm about to buy Radar book about multitenanted application
[14:38:54] brotspinne: hello. I have a model testcase which has many steps. when I change an attribute of a step via an accessor like step.foo = 42 and then save! the testcase, no changes are made. do somebody know why?
[14:39:03] Fire-Dragon-DoL: sounds like a really useful argument
[14:39:18] Fire-Dragon-DoL: ahem, topic, sorry
[14:39:52] brotspinne: the issue is that I need to change all attribtes of the steps first and then save all together
[14:39:56] GeorgesLeYeti: I want to make a upload form to upload a sound and after file upload redirect to sound page. I use for this carrier wave + jquery file upload. Here my code: https://gist.github.com/anonymous/ed570887075594454ac5
[14:41:33] GeorgesLeYeti: My problem is: The redirection didn't work and i don't get why. Because under webbrick console i see it "Redirected to http://localhost:3000/sounds/322"
[14:43:20] treehau55: mikecmpbll, is that how you see it
[14:43:24] brotspinne: GeorgesLeYeti: I guess the fileupload plugin is changing your form to an ajax form so the response of your create action is ignored
[14:43:50] mikecmpbll: treehau55: seems like it. in which case use something like delayed_job.
[14:44:16] GeorgesLeYeti: brotspinne: ok so that mean i have to make the redirect action under fileupload plugin i guess. Ty
[14:44:34] brotspinne: GeorgesLeYeti: I think so
[14:44:37] treehau55: mikecmpbll, basically im trying to lock rosters upon two conditions, a cutoff date, or at the begining of a match, and have them unlock after the match
[14:45:31] treehau55: mikecmpbll, so you think something like resque or sidekiq?
[14:46:01] brotspinne: nobody has a hint for my issue? :/ it is really basic
[14:46:08] mikecmpbll: treehau55: yes.
[14:46:48] freesteph: having a hard time understandign why my radio input' labels are not selecting properly
[14:47:03] freesteph: I have three radios with a label
[14:47:08] mikecmpbll: brotspinne: you have to save the step.
[14:47:17] freesteph: and the 'for' attribute of the labels point to their respective inputs
[14:47:41] freesteph: when I click the label, I actually see the radio button dimmed on press
[14:47:45] freesteph: but it's not being selected
[14:48:29] momomomomo: freesteph: Post your code to http://gist.github.com/ (all related code and errors), and then come back and explain: What you're trying to do, what the issue is, and what you think has gone wrong. This will help people be able to digest/understand your problem. Also check this out when you get a chance: http://www.catb.org/esr/faqs/smart-questions.html
[14:48:34] brotspinne: mikecmpbll: I thought child records will be saved when I save the parent model?
[14:49:49] rushed: brotspinne: created in some circumstances, not updated
[14:50:00] freesteph: momomomomo: I thought it was pretty clear...
[14:50:11] momomomomo: freesteph: I didn't read what you said, I didn't see code
[14:50:35] freesteph: momomomomo: my bad
[14:51:20] brotspinne: rushed: so what is the best approach for this common task? I'm iterating over the child records and set some attributes and then I want - after the loop - to save everything at once. just loop again?
[14:51:25] freesteph: momomomomo: http://pastebin.com/78yscu2B
[14:51:58] mikecmpbll: brotspinne: save the child in the loop?
[14:52:11] freesteph: shoot, sorry
[14:52:16] brotspinne: mikecmpbll: no I only want to save when the first loop succeeds
[14:52:50] treehau55: mikecmpbll, im thinking something like job scheduling might be overkill for now, I just need to check if it should be locked when someone asks for it
[14:52:55] mikecmpbll: brotspinne: i don't know what you mean, i'll probably need to see some code.
[14:53:16] mikecmpbll: treehau55: yep, that's exactly what you should do.
[14:53:43] ac-species: I'm deploying my RoR app to Tomcat via a WAR, but since it's not the ROOT app of Tomcat, the asset paths in the CSS don't reference the assets folder in the app. Is there any way to fix the CSS?
[14:54:07] brotspinne: mikecmpbll: in the loop where I update attributes (without saving them) of child records, there can be exceptions raised or it can return. so I want to wait for the loop to finish successfully before I make any change to the database. like a transaction
[14:54:15] treehau55: ac-species, thats weird ive never had that issue, are you using jruby
[14:54:26] ac-species: treehau55: yes.
[14:54:35] rushed: brotspinne: you know what's like a transaction? a transaction :)
[14:54:57] brotspinne: mikecmpbll: but I can't use a real Transaction because in this loop there updated other records which must be saved
[14:55:03] freesteph: momomomomo: https://gist.github.com/freesteph/5935110
[14:55:09] momomomomo: treehau55: What, exactly, are you trying to do? Earlier you said that you're trying to execute code based on time, which would suggest a job schedule
[14:55:13] brotspinne: rushed: see msg before
[14:55:50] treehau55: ac-species, what version of rails
[14:55:56] freesteph: momomomomo: nevermind, it I copy out this code in a blank file
[14:55:58] freesteph: the HTML works fine
[14:56:04] freesteph: so there's something overriding somewhere in my code
[14:56:09] ac-species: treehau55: Rails 3.2.13, JRuby 1.7.4 in 1.9 mode.
[14:56:13] mikecmpbll: brotspinne: i think you're over complicating it but I can't tell for sure without seeing some code.
[14:56:48] brotspinne: ok doesn't matter
[14:56:50] treehau55: momomomomo, no if a user tries to update/modify roster in any way, just have them tell them its locked. the way the rosters are locked, is either a. automatically based on a date, or b. based on another api event (so a trigger basically)
[14:56:59] ac-species: treehau55: though as far as I can tell, the problem is that the CSS doesn't account for Tomcat placing the app in /webapp.
[14:57:09] brotspinne: mikecmpbll: this is really a simple use case so we don't need code for this
[14:57:16] treehau55: ac-species, check out the third comment here https://github.com/jruby/warbler/issues/50
[14:57:26] treehau55: did something similar to fix it
[14:57:46] momomomomo: freesteph: Post the resulting HTML
[14:58:18] momomomomo: treehau55: So then just create a method and variable that goes along with it
[14:59:05] momomomomo: ie: attr_accessible :locked (boolean); def is_locked? locked ||= (check_your_methods_to_see_if_it_should_be_locked) end
[14:59:08] treehau55: momomomomo, okay just checking i didnt want to believe it was that simple
[14:59:19] momomomomo: I don't know, it depends on what you need treehau55
[14:59:21] mikecmpbll: brotspinne: haha, well it clearly isn't because you've gone from wanting to update an association object when saving an object -- which IS simple -- to something all together not simple to comprehend without code.
[15:00:27] ac-species: treehau55: except my assets are correctly compiling. The app's css, js, and favicon all load correctly, but when the css calls for icons and the logo, it uses the wrong paths.
[15:02:04] rushed: ac-species: is your css source using the asset helpers?
[15:02:18] ac-species: rushed: I don't know.
[15:02:55] rushed: ac-species: you probably want to check :)
[15:03:00] treehau55: ac-species, have you started a console and checked to see if the paths were correct
[15:03:20] treehau55: ac-species, you can always just go inside your app.config and set the paths
[15:04:35] brotspinne: rushed: mikecmpbll: https://gist.github.com/pseidemann/0e54c94583c1a1c9f907
[15:06:01] mikecmpbll: brotspinne: I don't understand what would be wrong with putting comment.save! after comment.text = ".."
[15:06:28] treehau55: ac-species, are you getting a rails error when you try to access the app or are you just getting unstyled pages
[15:06:58] ac-species: treehau55: I'm just getting missing images on all the styled pages.
[15:07:06] ac-species: Everything else seems to work.
[15:07:16] brotspinne: mikecmpbll: ok imagine: first iteration, first comment. no return, no exceptions. the comment will be updated and save. second iteration. an exception is raised. all other comments will be ignored. but the first one is already updated. but it shouldn't
[15:07:37] mikecmpbll: my bad, gotcha.
[15:07:38] momomomomo: brotspinne: http://apidock.com/rails/ActiveRecord/Base/update_attributes
[15:07:51] brotspinne: momomomomo: no sorry ;)
[15:08:00] momomomomo: brotspinne: Explain
[15:08:08] brotspinne: see message before
[15:08:32] momomomomo: I see you looping through comments
[15:08:36] momomomomo: and setting text
[15:08:52] brotspinne: maybe I can use :autosave
[15:09:04] mikecmpbll: brotspinne: was just about to suggest htat
[15:09:22] mikecmpbll: that's all i can think of, other than where you started which was just save them outside of that section by looping over again
[15:10:03] brotspinne: yeah this was my first question
[15:10:41] fwaokda: anyone here use sqlserver as their database? I'm trying to connect to my sqlserver on my host machine from my guest ubuntu on virtualbox but I cant get it to work...
[15:11:01] treehau55: ac-species, I would investigate inside a rails console, unfortunately warblers given us many headaches as well
[15:11:07] rushed: fwaokda: MSSQL?
[15:11:18] fwaokda: rushed, yes
[15:11:29] ac-species: rushed: The css.scss uses asset_url().
[15:11:51] arturodz: Hello, I am having a mass assignment error in a many to many relation between two objects. I've already added the column to the attr_accessible method but not luck. Been stuck with this for a while… Models code: https://gist.github.com/anonymous/5935195
[15:11:57] rushed: fwaokda: you'll probably want to look at the activerecord-sqlserver-adapter and tiny_tds gems
[15:12:38] arturodz: The error is "ActiveModel::MassAssignmentSecurity::Error at /users/1
[15:12:39] arturodz: Can't mass-assign protected attributes: channel_ids"
[15:13:21] momomomomo: arturodz: Did you create your join table?
[15:13:34] arturodz: momomomomo: yes
[15:13:40] mikecmpbll: arturodz: the clue is in the error
[15:13:44] fwaokda: rushed, yeah im using those. I had a method that worked on another computer but on that one my sqlserver didn't have a name and I could access it by using the gateway ip from the guest os -- however this instance has a name ".\SQLExpress" and I can't get it to connect to it
[15:13:55] arturodz: momomomomo: it actually works when reading data, not when writing
[15:14:08] fwaokda: rushed, this is my database.yml at the moment https://gist.github.com/anonymous/75717c78bff1d0b12cf3
[15:14:44] arturodz: mikecmpbll: already added the channel_ids column to attr_accessible but no luck
[15:14:53] mikecmpbll: not in that gist you haven't
[15:15:15] starfox21: is it bad practice to have models without a corresponding controller?
[15:15:24] mikecmpbll: starfox21: no.
[15:15:28] treehau55: starfox21, no
[15:15:36] momomomomo: Aye,arturodz you've only opened up role_ids
[15:15:58] rushed: fwaokda: you'll probably want to drop the named instance strings and use the following: "dataserver: server_name_or_ip:1433" "host: server_name_or_ip" "port: 1433"
[15:16:21] fwaokda: rushed, ok thanks! let me try that... i was running out of ideas
[15:17:21] arturodz: momomomomo: Nop, I've also added :channel_ids, I took it out cause it was not working
[15:17:40] mikecmpbll: arturodz: to which model?
[15:17:41] arturodz: I added it again just in case, restarted the server, no luck
[15:17:46] fwaokda: rushed, did you mean to put the port at the end of dataserver and under port?
[15:17:49] arturodz: to the user model
[15:18:22] momomomomo: arturodz: paste your stack trace error now
[15:18:24] mikecmpbll: arturodz: add your controller code to the gist then.
[15:19:31] rushed: fwaokda: yes, the dataserver option should be host:port and the other two are the two pieces individually (this is redundant because, as far as I can tell, which set is being looked at depends on the tiny_tds version and version of mssql you're connecting to)
[15:20:17] brotspinne: mikecmpbll: I will stick with post.comments.each &:save!
[15:21:42] momomomomo: brotspinne: Did you consider using acceptes_nested_attributes_for
[15:22:06] arturodz_: mikecmpbll: http://pastie.org/8113132
[15:22:11] brotspinne: momomomomo: there is no form
[15:22:37] momomomomo: brotspinne: So?
[15:22:47] brotspinne: momomomomo: the models in the code are fictional
[15:23:03] brotspinne: actually this code is running within a rake task
[15:23:49] momomomomo: arturodz: Your view / form? add that to your gist please
[15:24:41] arturodz: https://gist.github.com/anonymous/5935269
[15:25:20] momomomomo: arturodz: side-note, using one single gist link will allow you to put all of these files in one page
[15:26:02] arturodz: momomomomo: Yeah, sorry, is just that for some reason Im not being able to access gist
[15:26:33] arturodz: momomomomo: some web pages are blocked intermittently for some reason, IT is working on it
[15:27:27] mikecmpbll: arturodz: looks like it should work to me.
[15:27:29] mikecmpbll: ACTION shrugs
[15:27:41] momomomomo: arturodz: And you've added attr_accessible :channel_ids to your User model, correct?
[15:28:49] arturodz: https://gist.github.com/arturodz/5935295
[15:29:45] arturodz: momomomomo: I was able to finally login to github, promise everything in one page from now on
[15:29:54] momomomomo: arturodz: Quick question - why are you using a different primary key for Channel ?
[15:30:28] arturodz: momomomomo: sure, I am replicating a db from salesforce, so I am using the sf ids
[15:31:18] arturodz: momomomomo: I would usually just use the databasedotcom gem, but it became too slow as we are managing big data sets.
[15:31:36] momomomomo: arturodz: Go into your rails console, and try something like: u = User.last; u.channels << Channel.last; u.save
[15:31:49] momomomomo: See if that works, or if you get an error
[15:32:02] mikecmpbll: momomomomo: that's not mass assignment so yeah, it'll work.
[15:32:15] momomomomo: mikecmpbll: I'm wondering if it's not just his mass assignment, but thank you
[15:32:17] arturodz: yeah, it works as expected
[15:32:51] momomomomo: and arturodz u.channels shows up that which you added?
[15:33:16] arturodz: reading the relation is no problem
[15:33:30] momomomomo: what's the name of your join table arturodz
[15:33:38] arturodz: channels_users
[15:35:08] arturodz: It really does not look like a mass-assignment issue to me.
[15:35:24] mikecmpbll: except the error which says mass assignment error? :|
[15:35:50] momomomomo: arturodz: paste your migration from your join table
[15:36:07] arturodz: mikecmpbll: well of course
[15:36:11] momomomomo: arturodz: What database are you using? MySQL?
[15:36:40] Fire-Dragon-DoL: I have a question about monkey patching (or not).. I have a validation mail method (which I use not only in rails) which is called as ValidateEmail.valid?(email), should I add a method to string class, called #valid_email?
[15:36:56] Fire-Dragon-DoL: or maybe #email?
[15:36:57] arturodz: https://gist.github.com/arturodz/5935295
[15:37:40] arturodz: I'm using sqlite
[15:37:51] arturodz: will change into postgre for production
[15:38:15] kevintrehan: Hello, I am having an issue with path helpers. I currently have a controller for static pages (currently only a home page and an about page exist). In my routes.rb, I am using get '/about', to: 'static_pages#about' and that is working just fine. However, I want my url to end with /learn-more instead of /about. So, I tried changing that line of code in routes.rb to get '/learn-more' to: 'static_pages#about' which causes me to ge
[15:38:16] kevintrehan: an error saying "No route matches [GET] "/about"." Does anyone have any insight into what the problem is?
[15:38:29] mikecmpbll: Fire-Dragon-DoL, nah.
[15:39:26] Fire-Dragon-DoL: mikecmpbll: ValidateEmail.valid?(email) this looks bad from OOP perspective, but monkeypatching string I'm not sure is good
[15:41:10] kevintrehan: Oh also, I'm getting an error that says "Undefined local variable or method 'about_path'…" and I only get that when I try to use /learn-more instead of /about
[15:41:23] mikecmpbll: you could stick a validate_email() method in validate_email.rb and just include the file where you need it.
[15:42:04] momomomomo: arturodz: add in attr_accessible :channels_attributes
[15:42:12] rushed: kevintrehan: you might find a working example helpful http://railscasts.com/episodes/117-semi-static-pages-revised
[15:42:30] mikecmpbll: kevintrehan: that's because your link is still going to /about
[15:42:46] momomomomo: But that shouldn't do it, I honestly am scraping here
[15:42:55] momomomomo: rushed: any idea for this mass assignment error?
[15:43:13] arturodz: momomomomo: changed it, restarted the server, no luck
[15:43:37] delinquentme: warning: Insecure world writable dir /usr/local in PATH, mode 040777
[15:43:49] delinquentme: How serious of a security issue is something like this?
[15:44:30] mikecmpbll: arturodz: i guess the only other thing we haven't seen is your params.
[15:44:35] mikecmpbll: inspect those and gist em? :)
[15:44:38] momomomomo: arturodz: Try taking out your authorize!
[15:44:42] momomomomo: in your Users controller
[15:44:57] arturodz: will do and post
[15:45:01] kevintrehan: mikecmpbll: Yeah, I did realize that shortly after sending my initial message. But I am still getting an error when I am at the root: "Undefined local variable or method 'about_path'…" It doesn't make sense to me that about_path is only defined if I am using /about… or am I missing something else?
[15:45:11] fwaokda: rushed, sorry had to step away, I think your idea is getting me close to connecting. I'm now looking into this error msg "Unable to connect: Adaptive Server is unavailable or does not exist" -- thanks for your help! ;)
[15:45:27] momomomomo: and also arturodz remove that , as: :admin
[15:46:15] Solnse: join #ruby
[15:46:32] rushed: fwaokda: that means no answer from the server, so you probably want to verify that the target machine has TCP/IP enabled, remote connections enabled, firewall disabled or rules configured properly, is on the port you think it is, & you're using valid credentials using some other tool (say query analyzer or whatever… something non-local to the machine) to make sure you're not on a wild goose chase :P
[15:48:01] ziikutv: I am wondering why I am not geting any growl notifications? I have guard + rspec and guard is auto starting spork.. Following the railstutorial.org book : rails version 4 edition
[15:48:24] ziikutv: By the way, Adium (my IRC client) just gave me growl notifications as I joined this channel
[15:48:38] fwaokda: rushed, ok i have most of those configured already I'll look into the firewall settings -- should just need to open 1433 correct?
[15:49:13] mikecmpbll: oh kevintrehan: use :as =>
[15:50:08] ziikutv:  are there any files and such i can paste for help?
[15:52:22] kevintrehan: mikecmpbll: So, should my code be get '/learn-more', :to => 'static_pages#about', :as => about_path ?
[15:52:34] rushed: fwaokda: don't guess… there are way too many variables :) try to connect using query analyzer or something from a machine other then the server using TCP/IP… if it works then you know you need to work on the client machine config, if it doesn't work then you haven't finished configuring your server
[15:52:36] arturodz: momomomomo: ok, it looks like its working now
[15:52:38] mikecmpbll: :as => "about"
[15:52:51] momomomomo: arturodz: So then the problem is with your authentication and controller logic
[15:53:15] momomomomo: I'd guess that the , as: :admin isn't doing what you expect
[15:53:27] momomomomo: but I'll leave that for you to investigate, and report back here for others to see if they ahve the same issue
[15:53:41] arturodz: momomomomo: yes, i'll check the ability..rb
[15:53:42] kevintrehan: mikecmpbll: Ah perfect! Thank you very much!
[15:53:57] fwaokda: rushed, oh ok thanks i'll do that now then
[15:54:11] mikecmpbll: or, if you prefer the json hash syntax just go for: get '/learn-more', to: 'static_pages#about', as: :about
[15:54:17] arturodz: momomomomo: of course, thanks you very much, you pointed in the right direction
[15:54:31] arturodz: mikecmpbll: thanks too, i'll report back
[15:58:56] mikecmpbll: have a nice weekend, chaps.
[16:03:56] ziikutv: hm no help eh
[16:09:26] ziikutv: can anyone help ffs?
[16:09:33] ziikutv: or even guide me in the right direciton?
[16:10:27] ziikutv: here is my guardfile and gemfile
[16:10:27] ziikutv: https://gist.github.com/ziikutv/5935562
[16:12:43] elaptics: ziikutv: what's the problem?
[16:13:18] fwaokda: rushed, got it working. Appears that even though I set my TCP/IP to enabled - I still had to go to the "properties" for that and enable it once again and set the port number for IPALL -- thanks again for all the help!
[16:14:22] ziikutv: http://ruby.railstutorial.org/chapters/static-pages?version=4.0#top
[16:14:37] ziikutv: elaptics: I have followe the guide on railstutorial for Guard + Spork
[16:14:55] ziikutv: however, I am not seeing any notifications from growl :(
[16:15:44] ziikutv: When I have guard running I type "n" to disable notifications, then once again and it says "Guard uses TerminalTitle to send notifications."
[16:15:49] ziikutv: but i want growl notifications
[16:16:51] ziikutv: and also i tried adding notification :guard to my guardfile however I see message "sudo bundle exec guard
[16:16:51] ziikutv: 21:46:10 - ERROR - Please install the 'growlnotify' executable."
[16:18:17] elaptics: ziikutv: sorry, don't know. Perhaps growl needs updating for ruby 2?
[16:19:04] scyllinice: Did you install the growlnotify executable?
[16:19:13] ziikutv: i am on a mac it comes with growl?
[16:19:27] scyllinice: It is in the zip file, but isn't installed by default
[16:19:37] ziikutv: i have growl as i said
[16:19:51] ziikutv: there is growl in my preferences
[16:19:55] ziikutv: system preferences
[16:20:04] ziikutv: but if you are talking about something else, please forgive me and tell me
[16:20:27] scyllinice: ziikutv: Why are you being unpleasant?
[16:20:46] ziikutv: i am not sorry english isnt my main lang
[16:20:51] ziikutv: so i might sound rude i get this a lot.
[16:21:37] elaptics: ziikutv: I can't see anything inherently wrong in your guardfile or gem file. I have guard running here with growl notifications but I am on ruby 1.9.3 and using OS X Snow Leopard
[16:21:37] scyllinice: ziikutv: So you have the AppStore version of growl?
[16:22:09] elaptics: ziikutv: also, I am running the pre-app store version of growl
[16:22:11] ziikutv: hm I am on leopard, running Ruby 2.0.0
[16:22:23] ziikutv: I am guessing I have the pre-app store version
[16:22:27] rushed: ziikutv: in general things are in the middle of a somewhat awkward conversion from growl to notification center… it's possible to get working in my experience with autotest (and I assume guard as well) but it's a finicky and non-trivial process…
[16:22:35] elaptics: ziikutv: just try switching to 1.9.3 and see if that helps
[16:22:49] elaptics: I haven't tried my setup with ruby 2 yet
[16:22:59] ziikutv: everytime i swtich versions with rvm i just get fuked up
[16:23:02] ziikutv: i have to redo everything
[16:23:04] ziikutv: gem install rails even
[16:23:05] scyllinice: ziikutv: Go here: http://growl.info/downloads#growlnotify
[16:23:09] scyllinice: It's at the bottom
[16:23:10] elaptics: I'm running a rails 3.2 project right now with 1.9.3 and it's working fine for me
[16:23:18] scyllinice: Get the GrowlNotify for the version of Growl you have
[16:23:22] Eiam: ziikutv: interesting, I moved from 1.9.3 to 2.0 and didn't have any issues
[16:23:28] Eiam: i use rails & sinatra
[16:23:37] elaptics: oh yes, you do need growlnotify
[16:24:28] ziikutv: elaptics: growlnotify that a gem or something I have to toss money at?
[16:24:36] scyllinice: ziikutv: It's where I linked
[16:24:37] scyllinice: http://growl.info/downloads#growlnotify
[16:24:45] elaptics: ziikutv: no it's just part of growl ^ see scyllinice's comments
[16:24:56] scyllinice: It's in the "General downloads" section
[16:25:25] ziikutv: also I now have to type sudo before doing ANYTHING
[16:25:30] elaptics: think it might have been in the original growl dmg as extras too
[16:25:32] ziikutv: what gives?
[16:25:44] scyllinice: elaptics: Yeah, it's there as well
[16:27:39] ziikutv: why do i have to type sudo now?
[16:28:06] rushed: ziikutv: you probably don't want to be using sudo
[16:28:22] ziikutv: yes but i have to when i do bundle exec guard
[16:28:26] ziikutv: or anything related now.
[16:31:30] scyllinice: That's weird
[16:32:53] pellis: how can i detect that a belongs_to association change (in order to send an email) ?
[16:33:57] ziikutv: thanks i am getting notifications now L)
[16:34:48] ziikutv: however I get this.. "Bundle exec guard"… no command found tells me to do bundle install.. i do sudo bundle exec guard.. guard starts.
[16:36:05] rushed: ziikutv: stop using sudo :)
[16:36:31] rushed: ziikutv: gisting the error you get without sudo might result in some useful help
[16:39:04] ziikutv: https://gist.github.com/ziikutv/5935732
[16:40:24] rushed: ziikutv: so, the error message says "Install missing gem executables with `bundle install`" have you considered running "bundle install"?
[16:40:43] ziikutv: have done so many times.
[16:41:18] brendan6: I have a gem that I maintain that calls #scoped internally. I am getting deprecation errors on rails 4 suggesting to use #all instead. However, #all will not work the same for rails 3 applications. Does anyone have any suggestions on how to fix these deprecations errors will still maintaining support for Rails 4?
[16:42:11] DANtheBEASTman: those deprecation errors are telling you to drop support for rails 3.
[16:42:48] brendan6: DANtheBEASTman: then force rails 3 users to use a specific version of the gem?
[16:43:32] DANtheBEASTman: yeah, if you want to maintain two seperate versions, that's a great way to handle that.
[16:43:39] s2013: what is kgio
[16:43:52] dopie: i love indecisive clients
[16:46:27] ziikutv: one last question
[16:46:36] ziikutv: Why do I soemtimes get multiple notifications?
[16:46:56] ziikutv: ie: notified 1 tested, 0 errors.. same notification again.
[16:49:46] ziikutv: anyways thats not a big deal but thanks for the big help
[16:50:07] ziikutv: one i run bundle install to fix the previous error i get a permission denied error.
[16:51:55] ziikutv: rushed: I have updated and added what happens when i do bundle install
[16:51:55] ziikutv: https://gist.github.com/ziikutv/5935732
[16:52:07] ziikutv: i have tried chmoding those directories, no luck.
[16:58:21] s2013: whats the best way to check the log to see the content of email tsent out in development
[16:58:28] pellis: can i find out what attribute was changed in an after_save callback?
[17:00:13] elaptics: s2013: just tail your development log
[17:00:41] elaptics: s2013: in your app's root directory run: tail -f log/development.log
[17:00:45] brendan6: s2013: the letter opener gem may come in handy too
[17:01:40] elaptics: s2013: I actually use MockSMTPapp which acts as a local mail server and email client and I just set my dev mail settings to use it so they get delivered there to see how they actually look
[17:01:43] s2013: development is empty blah
[17:02:05] elaptics: s2013: your develoment log? Unlikely
[17:02:37] brendan6: s2013: are you trying to view the outgoing emails in production?
[17:03:29] s2013: i just setup the app, its not my own, just helping someone fix an error
[17:03:43] s2013: i had to create the development.log file
[17:03:49] s2013: nor rails s wasnt working
[17:04:00] s2013: anyways, its fine, i just fixed the issue without even looking at the email log. thanks
[17:13:27] fryguy: relevant: http://mailcatcher.me/
[17:39:56] kara_sweets: in a survey app, where you have a survey, question and answer model, does it make sense to create another model that stores the completed survey if a user fills it out?
[17:40:15] kara_sweets: or it s there a way to store the completed survey based on the existing models
[17:40:59] luser0: yes, it is "or"
[17:42:37] luser0: have you normalized your forms?
[17:45:12] n3lthon: hi, is possible to integrate redmine inside an existing rails app?
[17:45:37] toretore: sounds like a great idea
[17:45:52] luser0: n3lthon, do you have the ref url for redmine?
[17:46:36] nobitanobi: Hi guys, anybody know where can I find a project who has used Rspec to do feature tests?
[17:46:43] n3lthon: luser0: http://www.redmine.org/projects/redmine/wiki
[17:46:49] nobitanobi: I would like to have some examples to have some kind of inspiraion
[17:48:23] joelteon: why am I getting redirected to / here? https://gist.github.com/joelteon/02681900aa0e693942ee
[17:53:39] joelteon: oh, hey, never mind, it IS cancan's fault
[17:59:31] DANtheBEASTman: I apologize for the noobish question, I feel like a fairly seasoned swimmer but Ruby is new water to me, having trouble understanding what the : and @ symbols/operators do. Is there somewhere I can read about them? ruby doc isntt exactly easy to navigate
[18:02:28] joelteon: @ is the sigil for an instance variable
[18:02:42] joelteon: :thing is a symbol
[18:03:50] luser0: joelteon: how do we override symbol to sigil most efficiently?
[18:07:14] kara_sweets: how is a two word model name referenced in code?
[18:07:18] kara_sweets: if its review_info.rb
[18:07:26] kara_sweets: ReviewInfo in the model class
[18:08:25] momomomomo: kara_sweets: ReviewInfo
[18:08:27] Sylario|2: kara_sweets: if in singleword it is not capitalized : two_word, if it is capitalized : TwoWord
[18:08:34] kara_sweets: accepts_nested_attributes_for :review_info, allow_destroy: true
[18:09:02] momomomomo: kara_sweets: yes
[18:10:13] kara_sweets: i have the survey at this url: http://localhost:3000/companies/1/surveys/1
[18:10:30] kara_sweets: but i want to create a review resource , not sure what to plug in to form_for
[18:11:01] kara_sweets: should i do @review = survey.reviews.build(params[:review])
[18:11:20] momomomomo: kara_sweets: I think you might do well to read through the guide here http://guides.rubyonrails.org/form_helpers.html
[18:21:54] AntelopeSalad: what's the cleanest way to handle conditional assets?
[18:22:13] AntelopeSalad: ex. loading something like respond.js for out of date IE versions only
[18:27:44] interactionjaxsn: AntelopeSalad: ie shim ?
[18:28:05] interactionjaxsn: <!--[if lt IE 9]><script src="dist/html5shiv.js"></script><![endif]-->
[18:28:16] treehau55: is there an easier way to simulate filling out a jquery-ui date picker in a capybara test besides just doing a page.execute_script
[18:28:18] AntelopeSalad: interactionjaxsn: i know, but i mean how should they be setup in rails specifically?
[18:28:45] AntelopeSalad: because right now it only outputs the assets for "application" , but it serves that for all browsers
[18:29:54] momomomomo: treehau55: http://rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Finders
[18:30:04] momomomomo: AntelopeSalad: http://guides.rubyonrails.org/asset_pipeline.html
[18:30:36] AntelopeSalad: momomomomo: i read that, it doesn't mention anything about conditional loads
[18:30:49] naeluh: I am trying to install refinery and I am getting this error - ERROR: While executing gem ... (OptionParser::InvalidOption)
[18:30:51] naeluh: invalid option: --include-dependencies
[18:31:06] naeluh: I am in ubunti 13.04
[18:31:29] naeluh: Unable to resolve dependencies: rails requires activesupport (= 3.2.13); activeresource requires activesupport (= 3.2.13), activemodel (= 3.2.13); railties requires activesupport (= 3.2.13); actionpack requires activesupport (= 3.2.13), activemodel (= 3.2.13), builder (~> 3.0.0); activerecord requires activesupport (= 3.2.13), activemodel (= 3.2.13), arel (~> 3.0.2)
[18:31:34] momomomomo: naeluh: That's a refinery cms question
[18:31:43] momomomomo: naeluh: But, I'll say that you're missing those dependencies.
[18:32:13] momomomomo: naeluh: If you have bundler installed, run 'bundle install' in the refinery directory
[18:32:37] naeluh: momomomomo: yeah I tried to run --include-dependenies but then It looks like I dont have that command
[18:33:06] naeluh: momomomomo: like this gem bundle install
[18:33:29] momomomomo: naeluh: http://bundler.io/
[18:34:12] treehau55: naeluh, this might sound naive, but are you spelling dependencies correctly?
[18:34:32] momomomomo: treehau55: from his paste " invalid option: --include-dependencies"
[18:34:34] naeluh: treehau55: haha yeah I think so
[18:34:48] treehau55: momomomomo, second time around it wasn't right, so wasn't sure
[18:35:00] naeluh: thanks yeah I think I did
[18:35:19] naeluh: momomomomo: cool I will try and use that bundler
[18:35:46] treehau55: naeluh, how did you install ruby on your system
[18:35:55] kara_sweets: I've found myself in this predicament
[18:35:56] kara_sweets: http://localhost:3000/companies/1/surveys/1/reviews/new
[18:36:07] treehau55: (i use ubuntu 12.04 personally)
[18:36:14] naeluh: treehau55: i used this http://www.computersnyou.com/1535/2013/03/installing-ruby-on-rail-on-ubuntu-with-rbenv-step-by-step/
[18:36:17] kara_sweets: and have no idea what to feed form_for when its nested 3 levels deep
[18:36:45] kara_sweets: simple form for only takes 2 arguments so @company, @survey, @review is out of the question
[18:37:07] momomomomo: kara_sweets: When pasting code, please use http://gist.github.com ; also, we're unable to see anything on your 'localhost' link, as it's only available on your localhost
[18:38:02] treehau55: naeluh, read up on this as well if you are going to be using rbenv http://robots.thoughtbot.com/post/47273164981/using-rbenv-to-manage-rubies-and-gems
[18:38:14] Ryuno-Ki: Good evening
[18:38:39] momomomomo: Evening Ryuno-Ki
[18:39:30] treehau55: hallo wie gehts
[18:40:17] naeluh: treehau55: do you know why I can use --include-dependencies
[18:40:57] momomomomo: naeluh: You don't have to.
[18:41:13] momomomomo: naeluh: gem install bundler; cd my/app/directory; bundle install
[18:41:14] naeluh: momomomomo: ok
[18:41:24] momomomomo: ie: exactly as bundler.io shows
[18:42:40] treehau55: holy crap, how long has this been out? http://www.pairprogramwith.me/
[18:42:59] kara_sweets: how do you auto set an attribute in a form?
[18:43:50] interactionjaxsn: treehau55: avdi is the man
[18:44:08] momomomomo: kara_sweets: You're asking questions that would be resolved best by understanding how forms work
[18:44:23] momomomomo: kara_sweets: http://guides.rubyonrails.org/form_helpers.html
[18:45:13] Uranio: is very logic use "relation.all" why is it deprecated?
[18:45:30] interactionjaxsn: treehau55: i've wanted to pair for a while but im uneasy about letting people into my box. I've been thinking about an ami that can be spun up for pairing with people... just sayin
[18:46:35] treehau55: interactionjaxsn, or cloud9
[18:47:48] treehau55: interactionjaxsn, an ami is a good idea though
[18:48:40] treehau55: interactionjaxsn, i have 80$ in free aws credit
[18:48:43] interactionjaxsn: treehau55: cloud9 looks good but i'd like my dot files and such
[18:48:49] treehau55: interactionjaxsn, if you want to try it out
[18:48:58] gerep: Hi all. I'm making an integration with Cielo's webservice, it requires a XML with the data to be sent via POST. Do I need to create the XML and send it or can I do it somehow, directly?
[18:49:48] interactionjaxsn: treehau55: do you think an image on the free tier would be enough?
[18:50:19] treehau55: interactionjaxsn, the free tier can get godawfully laggy sometimes
[18:50:41] treehau55: interactionjaxsn, just using the small is a world of difference
[18:50:42] Macai: Hi there.
[18:51:04] interactionjaxsn: treehau55: figures... :/ can't get anything good for free now.
[18:51:55] Macai: Does anybody know of some good Devise documentation? The stuff I found has thus far been quite confusing.
[18:53:25] Macai: interactionjaxsn: That's what I've found so far, actually.
[18:54:43] interactionjaxsn: Macai: that should be all you need. is there something specific that is giving you problems
[18:56:02] Macai: interactionjaxsn: I think I may have figured it out. Thanks anyway. See you.
[18:56:37] bobthecookie: Hey, can someone help me downgrade rails? I'm on 4.0.0, I need to be on 3.2.8 for work
[18:57:02] treehau55: bobthecookie, is there any reason you cant have both?
[18:57:06] rushed: bobthecookie: you don't need to do anything, bundler will take care of it for you :)
[18:57:23] rushed: bobthecookie: also, you should be on the latest 3.2, not 3.2.8
[18:57:40] treehau55: 3.2.8 has a massive security flaw that is fixed by 3.2.11
[18:58:34] treehau55: and like rushed said you should be using latest 3.2
[18:58:52] bobthecookie: rushed: I'm on 3.2.8 for work. Will 3.2.13 be compatible?
[19:04:54] bobthecookie: what security flaw is in 3.2.8?
[19:05:17] kara_sweets: i still can't figure out how to make the form for 3 levels deep
[19:05:18] kara_sweets: http://localhost:3000/companies/1/surveys/1/reviews/new
[19:05:29] interactionjaxsn: bobthecookie: http://www.cvedetails.com/vulnerability-list/vendor_id-12043/product_id-22568/version_id-139741/Rubyonrails-Ruby-On-Rails-3.2.8.html
[19:05:58] interactionjaxsn: kara_sweets: we can't see your localhost...
[19:06:14] kara_sweets: I'm just showing that to give an idea of the routing
[19:06:33] kara_sweets: simple_form_for(@company, @survey, @review) is too many arguments
[19:09:06] bobthecookie: ...well then, thats a lot of security vulnurabilities
[19:10:51] dopie: interactionjaxsn, i got the checkboxes to work
[19:11:06] interactionjaxsn: dopie: sweeet!!!
[19:11:13] dopie: ill post the coe
[19:11:39] dopie: https://gist.github.com/staycreativedesign/5936603
[19:12:32] dopie: I need a tag for checked and unchecked
[19:19:12] dopie: interactionjaxsn, got another one here
[19:27:31] dopie: http://stackoverflow.com/questions/15174252/github-preview-feature-with-rails-3-2
[19:27:33] dopie: the thing is
[19:27:36] dopie: i dont want to use tabs
[19:28:20] dopie: https://gist.github.com/staycreativedesign/5936681
[19:31:21] timhansen: afternoon, all.
[19:31:59] timhansen: i'm attempting to push a rails 4 app to heroku, and i keep getting the error "Can't connect to MySQL server on '127.0.0.1' (111)". i have config.assets.initialize_on_precompile = false set in application.rb
[19:32:22] timhansen: and i added the mysql add-on to the app
[19:32:34] timhansen: any ideas what might be going on?
[19:32:49] dopie: 127 isnt that local host?
[19:33:10] dopie: timhansen, goto heroku and they should give you the server location
[19:33:27] dopie: and then change that in your production
[19:33:29] timhansen: pooh yea, there's more setup, isn't there
[19:33:58] dopie: im a newb too
[19:37:21] interactionjaxsn: dopie: so you want the preview side to populate as the user is checking boxes?
[19:37:33] dopie: hahahaaha no...
[19:37:38] dopie: basically
[19:37:56] dopie: there is a description textarea....
[19:38:10] dopie: whatever he writes there i want him to see it in the previewtextarea
[19:39:54] interactionjaxsn: dopie: as he writes? is your .righ-side hidden or always visible?
[19:42:44] dopie: always visible
[19:43:04] ionut: i have this code in a partial <% if !flash[:notice].blank? %> ... <% end %> and i get the following error : undefined method `[]' for nil:NilClass, please help
[19:44:13] dopie: and as he writes yes
[19:44:20] interactionjaxsn: dopie: javascript
[19:46:15] interactionjaxsn: ionut: if flash && other conditions
[19:46:17] boytoy: In my Rack middleware, how do I examine my headers? Not much luck with this one: Rails.logger.debug "BLEEP: #{headers}"
[19:46:20] boytoy: The reason is I'm not getting a match on "if headers['Content-Type'] =~ /text\/html/" so I need to find out why.
[19:47:41] interactionjaxsn: boytoy: can you use pry
[19:48:12] boytoy: interactionjaxsn: Never tried it before
[19:48:21] kara_sweets: https://gist.github.com/anonymous/54f6b943f7c7f8154c02
[19:48:27] mwlang: any idea how to get ActiveModel classes (non-persisted AR models) working with Active Admin drop-down selectors? I think I'm close, but get "undefined method `connection' for Status:Class" message while rendering the edit form. gist of the Status model here: https://gist.github.com/mwlang/5936802 for Rails 4 app.
[19:48:33] interactionjaxsn: boytoy: try it out. you'll love it
[19:48:43] boytoy: interactionjaxsn: Cool :)
[19:48:47] kara_sweets: ^ returns a blank form even when there is info
[19:49:20] rushed: boytoy: there are examples of using headers from middleware shown in http://railscasts.com/episodes/151-rack-middleware
[19:50:03] boytoy: rushed: Oh damn you're right! if @headers["Content-Type"].include? "text/html" yeah?
[19:51:35] boytoy: I got my "headers['Content-Type'] =~ /text\/html/" from rack-chromeframe: https://github.com/bcgio/rack-chromeframe/commit/41ff89952300e86b578b74521a0bc1eaf055559c .. wonder why that didnt work though
[19:51:45] dopie: interactionjaxsn,
[19:51:46] dopie: http://stackoverflow.com/questions/5475862/live-preview-of-formatted-html-form-input-with-rails
[19:53:30] interactionjaxsn: dopie: run with that
[19:53:48] dopie: im trying
[19:54:14] dopie: what if i dont want to use prototype
[19:54:18] dopie: as it is a headache
[19:55:53] kara_sweets: anybody know why fields_for is returning noting? https://gist.github.com/anonymous/54f6b943f7c7f8154c02
[19:58:59] rushed: kara_sweets: is there anything in the review_infos collection on your review?
[19:59:58] rushed: kara_sweets: also, you might find a working example helpful http://railscasts.com/episodes/196-nested-model-form-revised
[20:05:52] ionut: interactionjaxsn: thank you very much, it worked like a charm
[20:11:45] nobitanobi: I've followed this tutorial : http://blog.zerosum.org/2011/03/19/easy-rails-outh-integration-testing.html -- but when in my rspec I call login_with_oauth I get "undefined local variable or method `login_with_oauth' for #<RSpec::Core::ExampleGroup::Nested_1:0xa5a64f0>
[20:11:48] nobitanobi: Any thoughts?
[20:12:16] timhansen: i set DATABASE_URL to the CLEARDB_DATABASE_URL and i'm still getting the error, "Can't connect to MySQL server on '127.0.0.1' (111)"
[20:12:26] zeromodulus: afternoon gents.
[20:14:48] dopie: i got it working
[20:14:52] dopie: but without markdown
[20:18:09] dopie: https://gist.github.com/staycreativedesign/5936975
[20:18:10] dopie: there we go
[20:19:18] dopie: How do i make markdown read that?
[20:19:37] dopie: http://50.57.132.227/designs/new ... type in the description area ... it works on the preview...
[20:19:50] dopie: except how would i make markdown syntax work
[20:42:52] epochwolf: What's the popular markdown editor for websites these days?
[20:45:06] epochwolf: dopie: editor, not the parser :P
[20:48:16] fooboo123: mow is decent, but I usually just use RubyMine
[20:49:56] dopie: epochwolf, would you know how to integrate live preview with jquery I have it working but i dont know hot output the markdown code
[20:50:36] epochwolf: I would like a javascript editor that does live preview on a webpage.
[20:51:06] epochwolf: If I just wanted to edit markdown on my harddrive, I have textmate installed
[20:52:14] dopie: epochwolf, well im almost there
[20:52:25] dopie: http://50.57.132.227/designs/new
[20:54:33] dopie: Im not sure how to get markdown to work in live preview
[20:55:09] epochwolf: http://pagedown.googlecode.com/hg/demo/browser/demo.html
[20:56:28] dopie: how do i do that!
[20:57:04] epochwolf: dopie: it's a javascript library with some css files.
[20:57:04] dopie: how do i do live preview with markdown
[20:57:19] dopie: so wth do i have to do
[20:57:32] soahccc: Hey guys... I've got a somewhat strange thing here. The exact same works for threads but all you see in the gist is wrong. The table is just empty! I never saw something like this... After the request (when I quit the pry session) rails don't find the record either... https://gist.github.com/2called-chaos/b0a5c1fdda0f392d639b
[20:57:36] epochwolf: Same way you would do any third-party javascript library. Figure out how it's supposed to be instaleld and do it.
[20:57:56] epochwolf: You'll probably have to chop it up to get it into the asset pipeline.
[20:59:22] soahccc: Forgot to mention: This only fails when creating the record. If I just update it, it works... I don't even have an idea
[21:03:42] et09: is there a decent non-third-party analytics package
[21:16:20] soahccc: Ahh it got removed instantly due to the callback on the thread :(
[21:25:57] Mendon: <3 feature specs.
[21:26:22] asoliman: I have regular .css files in my vendor assets folder, how can i add them to my application.css.scss?
[21:26:59] asoliman: i tried an @import, but that wont work since they arent .scss extensions, I also attempted the // *= for sprocket, but it doesnt work properly when i deploy
[21:28:10] boytoy: asoliman: isnt it //=?
[21:29:28] asoliman: boytoy: i thought it was //= for .js and //*= for .css
[21:29:42] Mendon: Anyone know off the top of their head to make a has_one association be auto-populated via a join when you initialize it?
[21:30:08] boytoy: asoliman: oh right wait
[21:30:12] Mendon: Or a belong_to, rather
[21:30:20] boytoy: asoliman: i use /*= require jquery_mobile_custom_structure_1.3.1.min */
[21:30:31] toretore: Mendon: elaborate
[21:30:52] boytoy: for css i mean
[21:30:56] Mendon: toretore: One second.
[21:31:01] asoliman: boytoy: yeah it seems like that should work then, would i need any special settings before i deploy for it to work? all the vendor files dont work properly
[21:31:08] asoliman: but my other assets are fine
[21:31:08] brownies: Mendon: #include
[21:31:42] boytoy: asoliman: i dont think so, im new to this stuff too so
[21:31:48] Mendon: https://gist.github.com/terrellt/cf91140681c8c4e0843c <-- I want to make it so when I do Pet.find(1).monster_record it runs one query.
[21:32:10] toretore: Mendon: read the activerecord associations guide
[21:32:11] asoliman: boytoy: hmm, yeah im just confused as to why it fails on deploy but works locally, its quite odd
[21:32:12] meoblast001: i think i broke my RVM and i'm considering entirely removing it and reinstalling it
[21:32:27] meoblast001: i can't seem to remember though. is system-wide or user-specific generally preferred?
[21:32:28] fryguy: meoblast001: consider rbenv or chruby instead
[21:32:40] Mendon: brownies: Thank you, I think that's it.
[21:32:56] meoblast001: fryguy: if i don't use rvm, my coworkers will blame me for anything that ever goes wrong on my machine that's not going wrong on their systems
[21:33:06] meoblast001: "Well, if you used rvm like we do, you wouldn't have these problems."
[21:33:16] boytoy: asoliman: just to check, you've remembered to add all extra app/assets stuff into application.rb?
[21:33:29] meoblast001: i think i just really broke it... i can't even rails create anymore without bundler failing with a ton of permission denied errors
[21:33:35] boytoy: that got me once
[21:33:37] asoliman: boytoy: shoot, that may be what i forgot...how do i do so?
[21:33:55] fryguy: meoblast001: seems like not a great reason, but ok
[21:34:19] fryguy: in that case, why are you asking us what to do instead of asking your co-workers?
[21:34:20] meoblast001: it seems that system-wide installs are what's giving me the problem
[21:34:32] Mendon: Blah, it's not doing it as a join.
[21:34:37] Mendon: It's doing a second query, which is silly.
[21:34:38] meoblast001: fryguy: well, because right now i'm setting it up for my own personal stuff
[21:34:52] meoblast001: i just figured if i'm using it for work, i might as well use it for my own stuff so i don't have a million ruby setups on my machine
[21:34:53] boytoy: asoliman: i dont think it applies to the stuff in vendor/assets/stylesheets though which should be included from your application.css
[21:35:17] boytoy: asoliman: but if you got extra stuff in app/assets you should add it to config/application.rb like: config.assets.precompile += ["desktop.js", "desktop.css", "mobile.js", "mobile.css", "form.css", "admin.css"]
[21:36:25] asoliman: boytoy: i have them all in my application .scss file with either @import or //*=
[21:36:55] boytoy: dunno about that man
[21:37:53] boytoy: so confusing at times :)
[21:47:20] meoblast001: fryguy: reinstalled and it works now :)
[22:27:11] edwardthefma: who hear has used the google cloud messiging gem befor
[22:27:54] edwardthefma: im looking for a working example to learn frome
[22:30:36] lurraca: hi guys, I need to setup the action mailer with reply-to address but I don't see exactly how to do it.
[22:30:47] lurraca: any tips? anything I can read from?
[22:33:20] spike|spiegel: headers['Reply-To'] = whatever
[22:33:37] spike|spiegel: next time try harder before asking
[22:40:18] rien: Hey folks. I have Product and ProductItems as modules. A product has_many product_items. Product#items returns a list of ProductItems for a given instance of a product. Now I have BetterProduct < Product and I need BetterProduct#items to returns a list of BetterProductItems < ProductItem. How do I do that?
[22:40:43] rien: sorry, as Models, not "modules"
[22:43:41] rushed: rien: do they share tables?
[22:44:59] edwardthefma: who hear has used the google cloud messiging gem before
[22:45:33] edwardthefma: im looking for a working exampele of its implamentation
[22:48:19] momomomomo: edwardthefma: You just asked the question, there is an example linked here anyhow https://github.com/dondeng/gcm_on_rails
[22:48:32] rien: rushed: yes the very same table
[23:16:37] skyjumper: why might the migration generator be making blank migrations?
[23:16:52] skyjumper: i'm getting this: https://gist.github.com/anonymous/5937792 from this: "rails generate migration CreateProducts name:string part_number:string"
[23:19:35] rakl: skyjumper "CreateProducts" isn't a good enough name to autogenerate code for you, so it just gives you a blank file
[23:19:50] rakl: if you wanted to generate a migration for a new model/table, you should generate a model insead
[23:20:01] rakl: `rails g model product name:string part_number:string`
[23:20:15] skyjumper: rakl: are you sure? that example is directly from the rails guide
[23:20:26] skyjumper: http://guides.rubyonrails.org/migrations.html
[23:20:51] rakl: where does it say the command it used to generate the first migration?
[23:21:04] skyjumper: search for "rails generate migration CreateProducts name:string"
[23:21:54] rakl: huh, interesting. don't know then
[23:22:03] skyjumper: ACTION shrugs
[23:22:33] `damien: Hi all! I'm having trouble with an AR SQL query and I could use a sanity check. Would anybody be willing to check this out? https://gist.github.com/damien/5937815
[23:23:15] rakl: doesn't auto generate for me either
[23:24:06] skyjumper: rakl: guess the guide is wrong
[23:24:09] fwaokda: If i create a stored procedure that has different attributes from my model, do i create a model for the stored procedure? Or do I add those attributes to my model that is closely related to the stored procedure?
[23:28:14] amaxwell: anyone here familiar with basics for setting up mintiest with a new rails project? I think i've followed the instructions. my site is running but when i try to run my tests i get an error: Don't know how to build task 'minitest:controllers'
[23:29:38] rakl: skyjumper what version of rails are you using
[23:30:20] skyjumper: rakl: 3.2.12
[23:30:28] amaxwell: if i just run "rake test" it runs without an error but my test is never run (as it passes and i've purposely written it to fail)
[23:30:39] rakl: mayeb that's the problem I'm on 3.2.11
[23:30:40] amaxwell: and not tests run in the output
[23:30:56] skyjumper: guide might be for 4.0
[23:32:29] rakl: yeah maybe. Radar would know
[23:33:08] rakl: tldr; are the guides for 4.0?
[23:35:22] sebastianb: and those: http://guides.rubyonrails.org/v3.2.13/
[23:35:24] sebastianb: are for 3.2.13
[23:41:21] rakl: why am I seeing a record being already updated in the before_update callback in an observer?
[23:42:55] rakl: http://pastie.org/8114162
[23:52:46] fragamus_: Is there multiple levels of has many through in rails
[23:53:08] fragamus_: I am using rails 3 currently
[23:53:28] ryanf: fragamus_: sure, you can just do has_many :foos, :through => :existing_has_many_through_association
[23:54:21] fragamus_: I really love it !