« Back to channel list

#RubyOnRails - 24 July 2015

« Back 1 day Forward 1 day »
[00:00:58] borodin: I'm getting Method Not Allowed on a boilerplate redirct after a form post in rails 4
[00:01:08] jhack: has joined #RubyOnRails
[00:01:11] Radar: borodin: !code
[00:01:11] helpa: borodin: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[00:01:20] Gnut: has joined #RubyOnRails
[00:01:28] borodin: if I run the app in RAILS_EMV=production I do not get method not allowed, but in RAILS_ENV=development, I get the error
[00:02:54] lethjakman: has joined #RubyOnRails
[00:04:02] Radar: borodin: !ncnh
[00:04:02] helpa: borodin: If you don't provide any code, it becomes really difficult for us to help you. Providing code to reproduce the problem increases your chances of getting great, accurate help immensely.
[00:04:33] zenspider: my assert_select repro: https://gist.github.com/1d8c5b4da88aabdad7c8
[00:04:59] milesforrest: has joined #RubyOnRails
[00:05:05] zenspider: no code no help? heh
[00:05:21] Radar: Which version of Rails.
[00:05:34] htmldrum: has joined #RubyOnRails
[00:05:37] Radar: Searching 2759 files for "def assert_select"
[00:05:37] Radar: 0 matches
[00:05:55] borodin: Radar: https://gist.github.com/chewmanfoo/2431707227155dd8223b
[00:05:58] borodin: thanks in advance
[00:06:04] shanson: has joined #RubyOnRails
[00:06:16] Radar: ah, rails-dom-testing is responsible for that
[00:06:31] borodin: I was running develop in production mode to fix an assets issue, but I'd like to be in development in dev and production in production
[00:06:34] Radar: borodin: Logs too please.
[00:07:03] zenspider: the apparently also in actionpack. I should double check the doco I was reading to see where it was from
[00:07:48] zenspider: https://github.com/kaspth/rails-dom-testing/blob/master/lib/rails/dom/testing/assertions/selector_assertions.rb#L167
[00:07:51] zenspider: that's where I'm hitting
[00:08:36] zenspider: and document_root_element is `Nokogiri::HTML::Document.parse(@rendered.blank? ? @output_buffer : @rendered).root`
[00:08:47] zenspider: and @rendered & @output_buffer are both blank
[00:09:00] zenspider: and Nokogiri::HTML::Document.parse("").root => nil
[00:09:07] chills42: has joined #RubyOnRails
[00:09:33] zenspider: I don't see anything in the changelogs about assert_select changing in this way... just that it switched to nokogiri and selectors might be different here and there
[00:09:56] Radar: Yeah, I don't know :( sorry!
[00:10:18] tubbo: zenspider: is that how @html_document is actually defined when a rails controller is populating it?
[00:10:36] tubbo: using the Nokogiri::HTML::Document#root method that is
[00:10:58] quazimodo: has joined #RubyOnRails
[00:11:21] giowong: has joined #RubyOnRails
[00:11:21] zenspider: 4.2 guides say: "assert_select(element, selector, [equality], [message]) ensures that the equality condition is met on all the selected elements through the selector starting from the element (instance of Nokogiri::XML::Node or Nokogiri::XML::NodeSet) and its descendants."
[00:11:42] zenspider: tubbo: I don't understand your q, sorry.
[00:11:45] sar1nk: has joined #RubyOnRails
[00:11:49] Scripore: has joined #RubyOnRails
[00:11:57] tubbo: zenspider: nah that kinda answered my question
[00:12:23] tubbo: like, when you just use assert_select normally in a controller test...according to the 4.2 guides (whatever you quoted there) it should work the way you're using it
[00:12:36] alexclark: has joined #RubyOnRails
[00:12:50] zenspider: so I'm not insane? :)
[00:13:20] bricker: zenspider: what's the error?
[00:13:42] tubbo: zenspider: well, i wouldn't go that far. you're still using assert_select instead of capybara *runs*
[00:13:52] giowong: does anyone know how to include relations of other models for ransack for the @search function?
[00:14:02] zenspider: bricker: NoMethodError: undefined method `document' for nil:NilClass
[00:14:15] zenspider: trying to use assert_select w/o a render
[00:14:38] zenspider: in a clean app: https://gist.github.com/1d8c5b4da88aabdad7c8
[00:14:45] zenspider: works in rails 3
[00:15:16] zenspider: bug is on: https://github.com/kaspth/rails-dom-testing/blob/master/lib/rails/dom/testing/assertions/selector_assertions.rb#L167
[00:16:32] tubbo: this is interesting... https://github.com/kaspth/rails-dom-testing/blob/master/lib/rails/dom/testing/assertions/selector_assertions.rb#L267
[00:16:47] tubbo: so you can just define that and that's now where the root element is?
[00:16:52] htmldrum: has joined #RubyOnRails
[00:16:58] VeryBewitching: Is a div an HTML document? Does it validate?
[00:17:12] zenspider: tubbo: that comes in from ... one of the rails test classes
[00:17:17] zenspider: but I could prolly override it...
[00:17:43] zenspider: VeryBewitching: I don't know what you're asking
[00:17:54] tubbo: zenspider: yeah like...that seems relatively easy to do. that's just a module mixed into the ActiveSupport::TestCase base class, so overriding it in your test seems totally valid
[00:18:15] tubbo: VeryBewitching: no, a <div> is an html element. an html document is really defined by a bunch of tags inside <html></html>
[00:18:34] VeryBewitching: zenspider: The test code includes a DIV in a string, would HTML::Document validate that successfully?
[00:18:40] tubbo: VeryBewitching: though if you just made a .html file with <div></div> it would work, because your browser inserts the rest of the tags necessary to make it a document so it can be parsed thru the DOM
[00:18:42] VeryBewitching: tubbo: I know what HTML is :D
[00:18:44] bricker: zenspider: can you verify that assert_select is coming from rails itself?
[00:18:47] bricker: not being overridden?
[00:18:53] bricker: method(:assert_select).source_locastion
[00:19:04] zenspider: bricker: yes, it is
[00:19:20] Radar: bricker: Do you know who zenspider is? :)
[00:19:24] zenspider: VeryBewitching: I get a result from nokogiri, that's what you're asking
[00:19:25] tubbo: VeryBewitching: =) yeah it's just a semantic thing, thought it might be interesting to note. i always found it fascinating that browsers insert code into my code to make things work. it makes you wonder just how far they go (the truth: they go very far)
[00:19:51] zenspider: *IF that's what you're asking.
[00:20:26] VeryBewitching: zenspider: I was more wondering if HTML::Document would crap out if you gave it a string that didn't include <html>
[00:20:37] zenspider: tubbo: defined the method, no diff. :/
[00:20:41] robbyoconnor: has joined #RubyOnRails
[00:20:57] zenspider: it's clearly using it tho
[00:21:02] towski__: has joined #RubyOnRails
[00:21:05] tubbo: zenspider: it's looking for a method called document()...i wonder if you just did Nokogiri::HTML('whatever') if it would work
[00:21:11] bricker: Radar: a ruby developer with a problem that he can't figure out
[00:21:13] dented42: has joined #RubyOnRails
[00:21:22] Radar: bricker: zenspider has been doing Ruby longer than anyone in this channel.
[00:21:34] zenspider: oh. wait. no... I'm now getting: NoMethodError: undefined method `document' for #<HTML::Document:0x007fa583bf01c8 @root=<div id="x"></div>>
[00:21:35] Contigi: has joined #RubyOnRails
[00:21:55] zenspider: so... progress? heh
[00:21:58] tubbo: i think you just need to do Nokogiri::HTML()
[00:22:06] bricker: Radar: impressive
[00:22:25] tubbo: zenspider: didn't you like, contribute on nokogiri? ;)
[00:22:29] bricker: Radar: that's gotta be at least... 30 years!
[00:22:56] zenspider: ok... now... how to make this work with both rails 3 and rails 4 ? :P
[00:23:06] tubbo: zenspider: if Rails.version =~ /3/
[00:23:34] pwnd_nfsw: has joined #RubyOnRails
[00:24:05] zenspider: this one works: https://gist.github.com/ae774bfb7ab20ba726d0
[00:24:49] crdpink2: has left #RubyOnRails: ()
[00:24:58] zenspider: thanks guys!
[00:25:18] tubbo: you are welcome
[00:26:24] machty: has joined #RubyOnRails
[00:26:33] tubbo: hey i got a question
[00:26:36] tubbo: if anyone can answer
[00:26:51] tubbo: let's say i have an active_record model that just maps to a table in a mysql database
[00:27:06] tubbo: when i do ThatModel.create(), can i specify attribute names with non-standard column names?
[00:27:14] tubbo: like for example, MyModel.create(TheAttribute: 'hello')
[00:27:23] tubbo: or does active_record convert that stuff automatically?
[00:27:35] quazimodo: has joined #RubyOnRails
[00:27:45] tubbo: backstory: i'm trying to make active_record models out of the tables that the Ocelot BT tracker needs
[00:27:59] tubbo: but their column names are camel-cased, not snake-cased
[00:29:23] zenspider: iirc, if you do it in create and the like, it'll use setter methods if they don't map to columns. so you can alias in snake_case methods
[00:29:50] zenspider: I had the same crap with some horrid oracle db admins with the worst naming practices ever. Everything in AR had to be tweaked
[00:29:57] zenspider: that was a while ago tho
[00:30:00] Radar: tubbo: It won't convert the columns to snake case. Columns are whatever you've specified them to be.
[00:32:08] tubbo: since these aren't models i'm actually interacting with in the app (actually, the rest of the app uses mongoid), it doesn't really matter what they're called. i just need to be able to add and update these tables when my mongoid models get saved, so i wanted an ORM to access them
[00:32:32] tubbo: alright cool. thanks...i was really hoping i wouldn't have to alias_attribute everything
[00:32:55] malcolmva: has joined #RubyOnRails
[00:32:58] smathy: tubbo, make some views.
[00:33:28] smathy: ...well, doesn't help with .create :)
[00:33:30] doodlehaus: has joined #RubyOnRails
[00:33:45] smathy: ACTION has to read back more before typing
[00:35:47] zenspider: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[00:36:13] giowong: is it a ransack problem where my strings wont get sorted descending?
[00:36:41] tubbo: smathy: like SQL views? yeah i suppose i could do that
[00:36:42] Mendenhall: has joined #RubyOnRails
[00:36:45] tubbo: i have to use mysql blahhhhhh
[00:36:54] tubbo: fuck ocelot :)
[00:36:55] smathy: Radar, that one's definitely for you ;) ^
[00:37:03] Radar: smathy: neg
[00:37:08] Radar: I give up on giowong after they don't follow the rules
[00:37:11] smathy: Radar, :)
[00:37:21] Radar: I don't want to have to tell people every damn time they ask a question to show code
[00:37:22] Radar: so I give up
[00:37:37] smathy: Radar, hey, speaking of the rules, I noticed that it doesn't mention multi-line pasting?
[00:37:41] smathy: (or I can't read)
[00:37:52] helpa: https://gist.github.com/996779
[00:38:09] smathy: Ok, I can't read :)
[00:38:27] smathy: I don't know what I was searching for.
[00:39:00] tubbo: lol https://gist.github.com/radar/996779#gistcomment-1406605
[00:39:07] tubbo: "Jesus what is fucking shit with registering your annoying ass"
[00:39:16] tubbo: like what
[00:40:16] giowong: its just a question
[00:40:19] ElSif: maybe he had his cursor in the wrong window?
[00:40:29] smathy: tubbo, comment is same date they joined github.
[00:40:30] giowong: my numbers sort correctly
[00:40:38] smathy: tubbo, they probably thought Radar made them register in order to comment.
[00:40:39] giowong: i was just wondering if strings are a corner case
[00:42:21] giowong: https://gist.github.com/gwong89/b3001ef7b1efe2ce440d
[00:42:23] kham: has joined #RubyOnRails
[00:42:44] bob14: has joined #RubyOnRails
[00:43:17] sdwrage: has joined #RubyOnRails
[00:46:21] ght: Question: In Devise 3.5.1 on Rails 4.2.x using a standard flash notice partial configuration, where you iterate over flash with the stock flash.each do |key, value|
[00:46:30] ght: I'm told this is not recommended
[00:46:42] AckZ: has joined #RubyOnRails
[00:46:45] ght: and Devise on timeoutable will write "Your session has timed out" followed by "true"
[00:47:01] ght: Does anyone have an example of how to iterate over flash messages just for type :notice, :alert, and :warning?
[00:47:31] ght: Those are the standard types, yes? Whenever we write to flash it's always flash[:notice] on redirect or flash.now[:notice] on render
[00:48:50] ur5us_: has joined #RubyOnRails
[00:50:23] speakingcode: has joined #RubyOnRails
[00:50:42] chills42: has joined #RubyOnRails
[00:51:07] htmldrum: has joined #RubyOnRails
[00:52:56] Ropeney: has joined #RubyOnRails
[00:52:58] dede: has joined #RubyOnRails
[00:53:05] NodeNagant: has joined #RubyOnRails
[00:54:25] tubbo: ght: wait, where did you hear that's not recommended?
[00:54:31] tubbo: i do that all the time
[00:54:35] shanson: has joined #RubyOnRails
[00:56:05] theery: has joined #RubyOnRails
[00:56:41] lacrosse: has joined #RubyOnRails
[00:59:04] ebbflowgo: has joined #RubyOnRails
[01:05:44] zorak8: has joined #RubyOnRails
[01:07:27] chintanparikh: has joined #RubyOnRails
[01:08:08] twilling: has joined #RubyOnRails
[01:09:10] Scripore: has joined #RubyOnRails
[01:11:14] xkickflip: has joined #RubyOnRails
[01:11:29] chintanparikh: I've got a question about polymorphic associations. Here's the relevant code: https://gist.github.com/chintanparikh/23bfecabcc47e64ea052. Notification belongs_to User, so user.notifications should show all notifications belonging to that user. However, each notification also is linked to an object through a polymorphic association, and one of those objects is a user. How would I set that up on the user side?
[01:11:38] mc78_: has joined #RubyOnRails
[01:14:51] jxpx777: has joined #RubyOnRails
[01:16:16] charliesome: has joined #RubyOnRails
[01:17:45] x-light: has joined #RubyOnRails
[01:19:56] workmad3: has joined #RubyOnRails
[01:20:13] yfeldblum: has joined #RubyOnRails
[01:20:40] chintanparikh: Nevermind, figured it out. If anyone's curious: has_many :linked_notifications, foreign_key: 'linkable_id', class_name: 'Notification'
[01:21:47] hashrocket: has joined #RubyOnRails
[01:22:01] melonstorm: has joined #RubyOnRails
[01:22:24] tuelz: has joined #RubyOnRails
[01:26:37] drale2k: has joined #RubyOnRails
[01:28:11] chintanparikh: has joined #RubyOnRails
[01:29:48] idd2d_: has joined #RubyOnRails
[01:34:21] theery: has joined #RubyOnRails
[01:35:30] jxpx777: has joined #RubyOnRails
[01:35:42] inoter: has joined #RubyOnRails
[01:37:00] braincra-: has joined #RubyOnRails
[01:40:23] hahuang65: has joined #RubyOnRails
[01:44:35] jonee: has joined #RubyOnRails
[01:49:13] shyshy: has joined #RubyOnRails
[01:49:47] adavia: has left #RubyOnRails: ("Leaving")
[01:50:01] Gnut: has joined #RubyOnRails
[01:50:50] rhm50_: has joined #RubyOnRails
[01:51:11] badmadrad: has joined #RubyOnRails
[01:54:35] k1t: has joined #RubyOnRails
[01:57:27] michaeldeol: has joined #RubyOnRails
[01:59:29] centrx: has joined #RubyOnRails
[01:59:50] badmadrad: has joined #RubyOnRails
[01:59:57] k1t: has joined #RubyOnRails
[02:00:01] sofy_arg: has joined #RubyOnRails
[02:00:25] hahuang65: has joined #RubyOnRails
[02:00:29] bonhoeffer: has joined #RubyOnRails
[02:00:45] exadeci: has joined #RubyOnRails
[02:01:42] lethjakman: has joined #RubyOnRails
[02:06:04] icaro: has joined #RubyOnRails
[02:08:35] bonhoeffer: has joined #RubyOnRails
[02:10:18] jxpx777: has joined #RubyOnRails
[02:15:57] christiandsg: has joined #RubyOnRails
[02:20:31] one_zero: has joined #RubyOnRails
[02:20:56] Creeves: has joined #RubyOnRails
[02:22:53] Tamal: has joined #RubyOnRails
[02:23:10] cooldman224: has joined #RubyOnRails
[02:24:02] earthquake: has joined #RubyOnRails
[02:24:14] baweaver: has joined #RubyOnRails
[02:28:15] axl_: has joined #RubyOnRails
[02:28:16] ght: Question: I need to change the ID of a table entry on dev to match another database, is there a recommended way to do this?
[02:28:35] theery: has joined #RubyOnRails
[02:28:47] ght: For example, I have an Account entry with ID 1, I need to make it ID 2, is there a way to do this besides manually copying it?
[02:29:46] bonhoeffer: has joined #RubyOnRails
[02:35:41] Creeves: ght: Model.find(id).update_column(:id, new_id) ?
[02:39:25] sofy_arg: any idea why a remote link is responding with the same request multiple times? is something relating turbolinks?
[02:40:20] dopie: has joined #RubyOnRails
[02:40:55] giowong: has joined #RubyOnRails
[02:42:22] willywos: has joined #RubyOnRails
[02:42:38] badmadrad: has joined #RubyOnRails
[02:43:17] bonhoeffer_: has joined #RubyOnRails
[02:43:40] Creeves: sofy_arg: is your <%= javascript_include_tag "application" %> outside of the head of the page?
[02:45:38] sofy_arg: Creeves: no
[02:46:16] alfajor: has joined #RubyOnRails
[02:46:55] k1t: has joined #RubyOnRails
[02:47:50] konsolebox: has joined #RubyOnRails
[02:49:19] Creeves: can you gist the form/view?
[02:49:24] ohhmaar_: has left #RubyOnRails: ()
[02:50:46] Gnut: has joined #RubyOnRails
[02:51:10] chipotle: has joined #RubyOnRails
[02:52:02] rromanchuk: has joined #RubyOnRails
[02:54:21] bronson: has joined #RubyOnRails
[02:55:00] sleungcy: has joined #RubyOnRails
[02:55:10] quazimodo: any way to install a gem across all ruby versions? (managed with chruby)
[02:55:25] michael_mbp: hey guys is there a chan for legal help
[02:55:49] Radar: quazimodo: no
[02:55:56] towski_: has joined #RubyOnRails
[02:55:58] Radar: michael_mbp: Call your local lawyer
[02:56:03] michael_mbp: hey Radar... I'm horridly bummed.
[02:56:25] sofy_arg: Creeves: http://pastie.org/10308909
[02:57:28] sofy_arg: Creeves: when i load the page it work fine. I realized this is happening when i change from different pages
[02:57:43] michael_mbp: my 'employer' of 20-21 months has been bought out. Most of the projects we do are eCommerce with Spree, some are rebuilds from Rails 2.x apps, and obviously need time. They want quicker turn around so Rails has garnered a 'negative' rating
[02:58:01] michael_mbp: They want to go the way of a Wordpress chop-shop /facepalm.
[02:59:02] jimbeaudoin: has joined #RubyOnRails
[02:59:16] fighella: has joined #RubyOnRails
[02:59:36] Creeves: sofy_arg: so if you load a different page, navigate to this one and then click 'send message' it sends multiple requests?
[02:59:42] quazimodo: Radar: that's a pain in the butt
[02:59:42] silverdust: Using paperclip and AWS S3. I'm uploading two different file types ( not as multiple upload but in the same form). How do I go about the has_attached_file
[02:59:47] Creeves: but if you just load the page and use it, then it sends one?
[03:00:07] silverdust: Can I set for both inthat one model
[03:00:23] michael_mbp: Creeves I dropped in randomly, is that related to XHR by anychance?
[03:00:26] sofy_arg: Creeves: yes
[03:00:28] silverdust: has_attached_file 'attachment1'
[03:00:35] michael_mbp: seen something similar with jquery loading twice.
[03:00:36] silverdust: has_attached_file 'attachment2'
[03:00:44] michael_mbp: *being loaded that is.
[03:01:11] Creeves: i've read it can be to do with the location of the script element in the dom
[03:01:37] Creeves: but sofy_arg was saying that his are in the head
[03:01:53] michael_mbp: 2 instances of jQ, so any events get handled twice.
[03:01:59] michael_mbp: (just an example)
[03:02:07] Creeves: that's what most of the answers say when i look this issue up
[03:02:08] sofy_arg: im getting multiple request
[03:02:17] hahuang65: has joined #RubyOnRails
[03:02:19] Creeves: how many on average?
[03:02:42] Radar: michael_mbp: Sorry to hear about your situation :(
[03:02:59] Radar: michael_mbp: it might be time to find a new client
[03:03:04] sofy_arg: Creeves: depends on how many pages im changing to
[03:03:04] Radar: michael_mbp: I don't know why you need a lawyer though?
[03:03:20] lethjakman: has joined #RubyOnRails
[03:03:21] michael_mbp: Radar... I may have to file for bankruptcy lol!
[03:04:01] Radar: michael_mbp: Why?
[03:04:08] michael_mbp: I only work remote. last time I didn't have a job, that lasted for ages. Last 20 odd months, not been able to get a single client (apart from the existing one).
[03:05:01] Creeves: sofy_arg: ahhh okay, so if you click 5 links before the button then it sends 5 times? ie. every navigation to a new view is reloading (the binding or linking to the js or something)
[03:05:10] Radar: michael_mbp: Has the existing one been giving you enough work?
[03:05:19] michael_mbp: bad decisions, too many eggs in one basket.
[03:05:27] michael_mbp: oh yeah, packed 40 hr week.
[03:05:32] nandx64: has joined #RubyOnRails
[03:05:35] sofy_arg: Creeves: yes
[03:05:42] silverdust: michael_mbp: you sound a lot like me
[03:05:59] silverdust: but how often do you take interviews? Are you on toptal?
[03:05:59] Radar: michael_mbp: So that's a positive right there. Do you need help to find Rails work?
[03:06:00] michael_mbp: got a contract till next year, but they can terminate with 2-months notice.
[03:06:14] bin_005: has joined #RubyOnRails
[03:06:25] michael_mbp: Radar: anything you can do help would be fantastic.
[03:06:35] christiandsg: has joined #RubyOnRails
[03:06:48] michael_mbp: my portfolio, some of it at least http://inertialbox.com/work?token=2fc79dfc23699f4b0ae78b4c6e24a75700e648ca29c829f7eb694c5ae19e0a16
[03:07:31] michael_mbp: I just spent 7 months rebuilding a rails 2.x app, full upgraded to Rails 4. customs Ansible app deployment/management stack (also mine).
[03:08:24] bonhoeffer: has joined #RubyOnRails
[03:08:37] workmad3: has joined #RubyOnRails
[03:08:51] michael_mbp: Payment gateway integration, special 'invoices' feature that sends payments and orders to a warehousing system via XML.
[03:09:50] braincrash: has joined #RubyOnRails
[03:09:57] michael_mbp: silverdust: I only do direct, no toptal
[03:10:05] Scient: sounds like a huge app, 7 months is a long time
[03:10:14] Scient: I can see why they want faster turnaround though :P
[03:10:25] Radar: michael_mbp: I've put my feelers out. I'll let you know what I get back.
[03:10:50] michael_mbp: Scient: yeah, this was overly complicated by a poor decision in the proposal.
[03:11:11] silverdust: I take a lot of interviews per week and sometimes they ask if I can recommend. I could always recommend you
[03:11:50] Radar: michael_mbp: would you like to do more Spree work?
[03:11:51] silverdust: I've picked up much from when I started but my number of experience years disqualifies me
[03:12:07] bonhoeffer: has joined #RubyOnRails
[03:12:12] michael_mbp: basically products/categories are fetched via a feed from the old system. The new site had a completely different organisation, so I had to build a referential taxonomy hierarchy that'll SURVIVE changes to the 'existing taxonomy'
[03:12:15] sofy_arg: Creeves: any suggestions?
[03:12:25] silverdust: I've seen people with longer years not doing as good
[03:12:30] Creeves: sofy_arg: was doing a bit of a lookup of turbolinks but i don't know it well enough sorry
[03:12:36] Creeves: was hoping it might be one of those simple issues
[03:13:05] Creeves: i mean if the number of requests is dependent on how many pages have been navigated to, we should be able to work from there
[03:13:22] michael_mbp: Scient: took me back into the land of computer science/graph theory. Horrid and unecessary complication as the cient refused to re-order the taxonomy on their end.
[03:13:43] Creeves: is spree good?
[03:14:08] sofy_arg: Creeves: what?
[03:14:08] michael_mbp: as opposed to being bad? :)
[03:14:45] Creeves: well, if i asked the same thing about woocommerce (under WP) i'd probably get some 'no' answers haha
[03:14:56] michael_mbp: I like its variant system, and have hacked into its logic that basically marks an order as 'complete', by-passing a whole lot of "locks".
[03:15:02] earthquake: has joined #RubyOnRails
[03:15:05] Creeves: i work on a RESTful payments API like stripe so always interested in the best ecommerce frameworks
[03:15:08] lethjakman: has joined #RubyOnRails
[03:16:41] michael_mbp: I this Radar will like (or hate) this!
[03:16:42] silverdust: In less than a year of rails I really don't see what a 4+ years experience will do that I can't
[03:16:45] one_zero: has joined #RubyOnRails
[03:17:15] michael_mbp: https://gist.github.com/bsodmike/9796cd8a2e31dc9e3855
[03:17:23] Scient: and easily :)
[03:17:27] Creeves: also wondering about spree as i have to build plugins to most of these frameworks
[03:17:31] acti0nman: has joined #RubyOnRails
[03:17:33] jdayvie: has joined #RubyOnRails
[03:17:38] Creeves: and some have been HORRIBLE (woocommerce plugins in php)
[03:18:22] Scient: the fact that you dont know what you dont know alone tells that you are not so experienced
[03:18:32] Scient: nothing to do with years here
[03:18:52] Tamal: has joined #RubyOnRails
[03:19:19] bronson: has joined #RubyOnRails
[03:19:23] jdayvie: Hey everyone =) Hope all is having a great day/evening! I've been having a very odd error that I cannot solve, nor others that I ask. Its on my live site called Program in Person (www.programinperson.com) and everyone works fine, able to view all the users. The issue is, WHEN LOGGED IN, this one user seems to have an issue (http://www.programinpers
[03:19:24] jdayvie: on.com/users/ifdattic). Using heroku logs, it seems like the issue involves a for loop that is involved with the geocode gem I use. If anyone has any ideas?
[03:19:29] michael_mbp: silverdust: well I've managed 80+ rack apps on around 20 servers for the past 20 months if that counts. Including Autoglym.com and that's a major brand.
[03:19:39] jdayvie: https://gist.github.com/Jdayvie/6b1eb1913f132bda7988 - That is the complete error in a gist.
[03:19:50] hahuang65: has joined #RubyOnRails
[03:19:54] michael_mbp: Thanks again Radar.
[03:19:55] silverdust: Scient: I don't know what I don't know? I've read the docs in-out
[03:20:05] Scient: michael_mbp: I hope this all works out for you
[03:20:15] michael_mbp: if you need to pass my email, it's michael@inertialbox.com Radar
[03:20:34] Scient: silverdust: nothing personal, but ignorance regarding thinking someone knows (almost) everything there is to know usually means they are not that experienced
[03:20:45] Scient: I see it all the time with junior engineers/new hires
[03:20:48] michael_mbp: Scient: thanks mate, not been taking it all to well. Need to pucker up :p
[03:20:48] Creeves: silverdust: generally as i learn more about any language/framework, the more i realise how much there is i don't know
[03:21:18] michael_mbp: Creeves: great outlook.
[03:21:22] michael_mbp: Scient: agreed.
[03:21:25] ExUser2: has joined #RubyOnRails
[03:21:28] Scient: you probably have a solid grasp on basic rails stuff, the most common "core" pieces that make up your average app. but experience beyond that is what creates efficiency
[03:21:33] Creeves: yeah though i worry about it for job interviews and things
[03:21:33] Scient: going on assumptions here ofc
[03:21:43] Scient: that efficiency is what moves people from junior to mid to senior levels
[03:21:49] nandx64: has joined #RubyOnRails
[03:21:56] michael_mbp: I value working in a 'no ego' environment too; just enjoy my current team. None of this "I'm better than you" or know it all nonsense.
[03:22:01] silverdust: I know that's true. But the point is I should adapt with basic knowledge and the years shouldn't matter, the projects I've worked on is what should matter
[03:22:08] Scient: being able to quickly identify sources/causes for problems, knowing intricate internal details that can cause side-effects that are not expected and so forth
[03:22:08] michael_mbp: or worse, the new hire wants everything done his way.
[03:22:34] Scient: generally I have yet to see a good an engineer with a couple of years of exp who has a good grasp of rails/ruby
[03:22:44] michael_mbp: One that irks me is, someone discovers <insert latest tech toy, say React> then all they want to do is React.
[03:22:54] Scient: more often than not it shows by just them producing super sloppy code (imo) though
[03:22:58] Creeves: yeah i still have very little knowledge of what is happneing behind the scenes in rails
[03:23:05] Scient: its like "ill use the first solution that works" and it just reeks
[03:23:15] Scient: i wish i knew how to fix that :(
[03:23:28] bmalum: has joined #RubyOnRails
[03:23:32] ExUser2: has left #RubyOnRails: ()
[03:23:35] Creeves: i haven't seen many beginner tutorials that focuses on what's going on behind all of rails automagic
[03:23:37] Creeves: that would be good
[03:23:38] michael_mbp: Creeves: it helps picking an area at a time and diving into the rails source.
[03:23:40] sumper: has joined #RubyOnRails
[03:23:42] Scient: like this one junior dev in our company was ridiculing me because I spent about like 4 hours trying to figure out why a rspec test did not work the way I expected it to work
[03:23:46] Creeves: but it would be beginner rails but not beginner programmer level
[03:23:49] michael_mbp: it also helps using pry to take a closer look.
[03:23:52] silverdust: Creeves: here http://www.toptal.com/ruby-on-rails#hiring-guide
[03:23:55] Scient: his solution was to just do it differently, in an uglier way, but it would work
[03:24:05] Scient: he was kind of amazed that I would not give up
[03:24:13] silverdust: It asks and answers what's going on behind the scene in rails
[03:24:15] michael_mbp: Scient: crazy.
[03:24:17] Scient: to me THAT was weird, like why would you NOT go all the way, it will teach you a lesson :D
[03:24:30] michael_mbp: exactly. I'm like a dog with a bone that way.
[03:24:46] Creeves: silverdust: where on the page does it? :S
[03:24:47] Scient: i will fucking not give up until I know exactly why something is broken the way it is
[03:24:48] michael_mbp: but I've now learned to hunt those down in my own time, rather than killing productivity at work if I can help it.
[03:24:52] Scient: only then can I properly fix it :)
[03:24:54] Creeves: oh further down?
[03:25:02] Creeves: nice okay, didn't scroll far enough haha
[03:25:04] Casty: has joined #RubyOnRails
[03:25:07] michael_mbp: hehe. I'm as bad as sometimes not being able to sleep.
[03:25:12] michael_mbp: Like something's off with the force :p
[03:25:24] michael_mbp: "There's a disturbance in my test suite" :)
[03:25:36] sumper: hi everyone, new to the chan been doing RoR for about a year now and looking to move into react js for front end...... does anyone have any good tutorials or tips or anything resourceful for react-rails?
[03:25:36] Scient: and still, years sadly DO matter in most cases
[03:25:37] michael_mbp: ACTION does a jedi arm wave...
[03:25:38] Scient: not all, but most
[03:25:55] Scient: the les years, the less relevant experience, the more time someone needs to spend with that person "holding their hand"
[03:26:03] silverdust: Creeves: first question > Explain the process flow of a rails request
[03:26:04] annlewis: has joined #RubyOnRails
[03:26:05] Scient: or checking what they produce is of high quality and makes sense etc
[03:26:10] Radar: michael_mbp: is inertialbox just you?
[03:26:10] Scient: I see it every damn day :)
[03:26:27] Creeves: silverdust: yeah i didn't realise it was past the 'hire these devs!' part
[03:26:28] michael_mbp: Scient: I get those guys to always throw up PRs that I personally have to nit pick through.
[03:26:35] Creeves: looks interesting, i shall have a read, thanks
[03:26:53] Radar: michael_mbp: May I PM?
[03:26:55] Scient: there are times when I just pick the PR apart and then sit down with them and re-do it
[03:27:02] Scient: in worst cases I just redo it when its urgent
[03:27:07] michael_mbp: Radar: for the bulk of it yes, but I do have access to a fantastic... gifted designer, and would take him on if clients are willing to pay
[03:27:10] michael_mbp: be my guest Radar
[03:27:11] Scient: which I wish I should not do :(
[03:27:23] michael_mbp: Scient: sometimes it's needed.
[03:27:25] Scient: man Im waiting for the day when I could turn over actual dev or our stuff to the team
[03:27:42] one_zero: has joined #RubyOnRails
[03:27:45] Scient: but from time and time again I keep getting reminded that someone would definitely fuck up :P
[03:27:54] nandx64: has joined #RubyOnRails
[03:28:20] silverdust: michael_mbp: You ever completed a project in less than a month ? Have there ever been a time you feel testing will waste time on Freelance job when there is a rush to deliver?
[03:28:38] silverdust: Scient too ^
[03:28:44] Scient: that long ass list of interview questions imho only has a couple of decent ones to weed out more senior people, idk...
[03:28:54] Scient: most of it is like super primitive "i have read the rails tutorial" kind of stuff
[03:29:10] Radar: Scient: that's good enough to weed out 90% of candidates :)
[03:29:16] badmadrad: has joined #RubyOnRails
[03:29:20] Scient: silverdust: when I was working for my own devshop, I rarely wrote any tests
[03:29:28] Creeves: i just worry too much that i have a general overview of a fair few different technologies and not really deep knowledge in one single area
[03:29:39] Scient: in most cases clients who are time and/or price sensitive will not like testing, especially TDD
[03:29:51] Scient: and yes I have completed projects in less than a month
[03:29:56] Scient: I have completed projects in days :P
[03:29:59] Scient: it all depends on the project
[03:30:05] Scient: comparing apples to oranges here obv
[03:30:35] Creeves: once we quoted a week for a project which was creating a page that showed 9 small clocks and 1 big clock from timezones around the world
[03:30:42] Creeves: it ended up being so fucking complicated
[03:30:51] Creeves: if only i had seen that video on timezones before
[03:30:56] michael_mbp: silverdust: deffo, as he said depends on the scope of the project :)
[03:30:56] one_zero_k: has joined #RubyOnRails
[03:31:03] Scient: Radar: i feel like you can teach ruby and rails to anyone. but how the hell do you teach someone to actually care about the code they write and make them go after the best possible solution instead of the first one that pops in their head...
[03:31:29] Creeves: Scient: easy
[03:31:33] Creeves: make them code something
[03:31:38] Creeves: then 6 months later, make them work on it
[03:31:39] Radar: Scient: That's a long lesson to learn.
[03:31:45] Creeves: that taught me the hard way :D
[03:31:51] Scient: i wish that alone would do it :D
[03:32:00] yfeldblum: has joined #RubyOnRails
[03:32:01] jobewan: has joined #RubyOnRails
[03:32:10] Scient: i am trying to rotate people between projects, so they are forced to work with other peoples code
[03:32:13] Creeves: i probably had to do that a few times before i really stopped writing shit code
[03:32:18] Scient: giving that "outsider" perspective
[03:32:40] Creeves: that's the best way imo
[03:32:48] Scient: i often see confused reactions when im explaining someone that yep i just spent an hour adding 2 lines of code to the app
[03:32:54] sumper: ~[ Scient ]~ As someone who learnt RoR on their own (not a huge accomplishment i know lol) but the hardest part is, as you said, was learning to code the right way... most of that came through refactoring and practise
[03:33:04] Scient: because I needed to figure out where is the logical place to put it and I needed to move stuff around for that
[03:33:17] Scient: they are like hey, why didnt you just stuff it into the controller?
[03:33:22] Scient: or something similar
[03:33:26] Scient: makes me cringe every time :D
[03:34:18] badmadrad: has joined #RubyOnRails
[03:34:27] Scient: and this is why it should be mandatory for every software engineer to read this book - http://www.amazon.com/The-Pragmatic-Programmer-Journeyman-Master/dp/020161622X
[03:34:43] Creeves: i guess it's had to discover/verify that what you've done is actually not best practice
[03:35:19] Scient: well "best practices" are imho often also debatable...
[03:35:28] RegulationD: has joined #RubyOnRails
[03:35:35] Scient: im actually more afraid of inexperienced engineers following best practices blindly
[03:35:36] Creeves: yeah i don't really mean official best practices i guess
[03:35:44] Creeves: just that idea of "oh i threw it in there and it works, so it's fine"
[03:35:51] Scient: without bothering to figure out why they are best practices, or if they really make sense at all
[03:35:54] Creeves: knowing why that isn't fine is the hard step for me
[03:35:57] yizr: has joined #RubyOnRails
[03:36:22] sumper: What have you guys found as best solutions for front end on RoR ?
[03:36:24] badmadrad: has joined #RubyOnRails
[03:36:51] Scient: writing haml and coffee and not bothering with all these funky new hip frontend frameworks? :D
[03:37:16] sumper: Thats where I am at but potential employers are all hyped on the js train
[03:37:18] Creeves: sumper: we built our frontend in angular and just use rails for an API with nginx to serve the static stuff and forward api requests to rails
[03:37:26] Creeves: i'm not much help in that department haha
[03:37:28] Scient: fuck those employers :P
[03:38:05] Scient: man... i would just like to demolish some js hypetrain fanboy in an interview (while being a candidate obv) :P
[03:38:24] sumper: yah but its hard to find a strict RoR job
[03:38:31] Scient: is it really?
[03:38:31] sumper: most people want some js flavour
[03:38:40] sumper: at least in toronto canada it has been
[03:38:41] Scient: (im asking because I honestly do not know)
[03:38:57] sumper: im hoping to get down to the us or uk or something but its hard been an expat
[03:39:13] Creeves: yeah near everyone here is the same
[03:39:24] sumper: i actually havent used irc in over 10 years lol
[03:39:30] Scient: btw in case anyone here is a dc high school student
[03:39:31] Scient: http://www.dchacks.org/
[03:39:32] sumper: i found this network on the reactjs site and here i am
[03:39:46] sumper: glad i did
[03:40:35] sumper: im trying to learn react now as i see the potential and guess i wanted some honest opinions on what framework to focus on
[03:40:46] Scient: react is a solid choice imho
[03:40:53] Scient: its one of the "sane" frameworks imho
[03:41:01] sumper: thats what i seem to be seeing with it
[03:41:02] Scient: does not focus that much on pointless sugar and doodads
[03:41:06] Scient: but actually tries to solve problems
[03:41:17] Scient: I wish I would have time to play around with it :(
[03:41:25] sumper: i've been playing around with it a little
[03:41:55] lethjakman: has joined #RubyOnRails
[03:41:58] sumper: i think im going to stick it out and read the documentation
[03:42:09] Scient: it definitely wont hurt you
[03:42:15] Scient: their approach to things is imho cool too
[03:42:20] sumper: thanks for your input much obliged
[03:42:23] Scient: just learning that alone is a benefit already
[03:42:50] sumper: i like the way everything seems to be coded in a clean way
[03:42:55] sumper: i found ember to be really annoying
[03:43:02] tuelz: has joined #RubyOnRails
[03:43:04] w09x: has joined #RubyOnRails
[03:43:38] kham: has joined #RubyOnRails
[03:43:51] silverdust: I only discovered about React after working half way on my last project
[03:44:14] silverdust: Thought I should mix it in and start trying it but I knew it was a bad choice that'll affect performance
[03:44:25] silverdust: Having both Angularjs and React I mean
[03:44:35] silverdust: A lot of load
[03:44:45] Creeves: why would you use both?
[03:44:51] Scient: LinkedIn tells me my "Profile Strenght" is All-Star
[03:44:54] Scient: guess thats cool...
[03:44:56] Creeves: from my understanding react will be doing the job of angular views
[03:45:03] Scient: wtf does that mean though
[03:45:19] Creeves: Scient: means you play on all star weekend
[03:45:41] sumper: i got that status as well
[03:45:46] Creeves: i hate linkedin
[03:45:47] sumper: it means you take a lot of time to update your profile haha
[03:45:48] silverdust: Creeves: I've seen some cases where they used both
[03:45:57] Scient: I havent updated it in a while though
[03:45:59] michaeldeol: has joined #RubyOnRails
[03:46:00] silverdust: And called it Angular-react more like Angular-rails
[03:46:05] Scient: I need to do it, and im too lazy to actually spend time on it :P
[03:46:08] Creeves: silverdust: i can kinda see why i guess
[03:46:17] Creeves: like, React is better than angular views
[03:46:17] Scripore: has joined #RubyOnRails
[03:46:26] Creeves: but angular covers a lot more than react
[03:46:33] sumper: looool its so creepy at times when recruiters message you only to waste your time because you dont know some stupid js flavour of the month!!!
[03:46:51] silverdust: I will try it out on my next project. Hope that comes soon
[03:47:01] Scient: im getting so much spam lately :(
[03:47:06] Scient: it used to be recruiters, now its even worse
[03:47:07] Creeves: i wouldn't use angular until 2 comes out
[03:47:10] silverdust: Been taking a lot of interviews and sometimes it's like I've got this and they never get back
[03:47:16] Scient: its companies trying to sell the shit out of their crap
[03:47:25] sumper: ?? silverdust ?? i feel your pain
[03:47:28] htmldrum: has joined #RubyOnRails
[03:47:33] Scient: I have 3 different people from Oracle literally spam me 3 times a week
[03:47:38] Scient: to have lunch
[03:47:41] lxkm__: has joined #RubyOnRails
[03:47:50] Scient: thats 9 emails a week, they dont get the hint either
[03:47:54] Scient: "im ignooooring you..."
[03:47:59] sumper: argh im using an old mirc client through wine and its got these auto complete colour things ... whats a good irc client similar to mirc for mac?
[03:48:18] Creeves: sumper: was just tping this haha: "sumper: what irc client are you using?"
[03:48:22] michael_mbp: last Mac once I used was Colloquy, on irssi now though.
[03:48:30] silverdust: I just use irssi on all platforms
[03:48:37] Creeves: the auto complete with the little arrows look weird heh
[03:48:45] Creeves: sumper: best client for osx i've used is limechat
[03:49:16] sumper: im using excursion which is a script based on mirc
[03:49:20] sumper: it was developed back in the 90s
[03:49:29] sumper: i used to use it in my internet piracy days
[03:49:32] Creeves: my choice for limechat was based on using mirc for nearly 10 years yeah
[03:49:33] hahuang65: has joined #RubyOnRails
[03:49:33] sumper: its so clean looking haha
[03:49:56] michael_mbp: BTW what are your thoughts on presenters/decorators/service objects Scient?
[03:50:18] sumper: creeves: i'll give limechat a look
[03:50:20] michael_mbp: recent project I found it was cleaner to maintain all of those in lib/
[03:50:27] sumper: ps: managed to remove the autocomplete stuff haha
[03:50:33] bruno-: has joined #RubyOnRails
[03:51:57] Scient: michael_mbp: i think they have a place... at times
[03:52:02] Scient: but mostly I dont like them :D
[03:52:09] Scient: there are other, imho cleaner ways to organize code
[03:52:15] Scient: like... *gasp* classes
[03:52:23] Scient: people dont use enough plain ruby classes in rails
[03:52:31] michael_mbp: these are POROS
[03:52:41] michael_mbp: most of then *are* POROS
[03:52:41] Scient: I guess we can thank the rails conventions for that - stuff your crap in models and be quiet
[03:52:52] michael_mbp: (that's what I meant...)
[03:53:03] Radar: sumper: Textual is what I use for IRC
[03:53:04] Scient: mostly yeah, but decorators have some nasty delegation magic involved etc
[03:53:08] michael_mbp: so service objects, are classes/POROS that provide a service.
[03:53:21] Scient: id say if used properly, they make sense I guess
[03:53:37] michael_mbp: ahh, I only use them if/when desperate and err on the side of caution. Mostly for presenters.
[03:53:38] Scient: the last project by this larger devshop that I saw just abused the FUCK out of decorators
[03:53:51] bronson: has joined #RubyOnRails
[03:53:53] Scient: I would like to take all the decorators and just beat them with those :D
[03:53:56] Scient: its like ... bad
[03:54:04] michael_mbp: try getting a REPL to debug an issue inside a decorator. I couldnt :p
[03:54:05] Scient: they used presenters and decorators actually
[03:54:25] Scient: the problem imho is that those two get used as junk drawers too often
[03:54:27] michael_mbp: as I recall you get hammered by method missing...
[03:54:38] Scient: so people just stuff their code in there to keep controllers and models nice and clean
[03:54:43] Scient: and it doesnt really solve anything
[03:55:32] michael_mbp: man, another pet peeve. Juniors love to have strings of commented code. I prefer to only have commited code, that has value. If you want to comment it, remove it with a descriptive commit. Similar to the 'junk drawer' in some ways.
[03:55:47] EminenceHC: has joined #RubyOnRails
[03:55:49] Creeves: like don't comment at all?
[03:55:55] michael_mbp: *comment out, sorry
[03:56:07] michael_mbp: lol ^^ that'll make sense.
[03:56:13] Scient: that is so fucking true
[03:56:19] Scient: we use version control for a reason :P
[03:56:26] Scient: it. has. history.
[03:56:30] Creeves: it's silly to have commented out code with versioning software anyway
[03:56:42] Creeves: i mean, you can get that code easily, you don't need to leave it there making things ugly
[03:56:48] Scient: next up - copies of the same file named .bak, bak1, bak2 etc
[03:57:02] Scient: yay for writing PHP straight on the server :D
[03:57:04] Scient: good old days....
[03:59:47] Creeves: actually we had a funny occurence here recently
[04:00:37] Creeves: we were commiting charges to our backend gateway and for each we provided a reference ID unique to each charge that, if the same ID was sent twice, would just return the status code of the first request
[04:00:48] Creeves: so just a NONCE to ensure reuests are not repeated right
[04:01:05] jenrzzz: has joined #RubyOnRails
[04:01:15] Creeves: and from our side, we were using our charge model IDs since we knew they were unique and could be directly related back to the charges in our DB
[04:01:49] Creeves: and for two $990.00 payments, one of which was something like charge-b3d and the other charge-B3d, both reigstered as the same charge by our backend
[04:02:06] Creeves: turns out the reference ID they were using wasn't case sensitive
[04:02:27] Creeves: so we responded to the merchant that the second payment charged successfully and no $990.00 was actually made
[04:02:40] Creeves: that was a fun email
[04:05:11] ascarter: has joined #RubyOnRails
[04:06:19] theery: has joined #RubyOnRails
[04:06:32] aweis: has joined #RubyOnRails
[04:07:26] Nowaker: has joined #RubyOnRails
[04:07:36] k1t: has joined #RubyOnRails
[04:08:47] aweis: hello, I have my own database, that I would like to log the sql to the ActiveRecord Sql logging. I see in previous versions of rails there was a method ActiveRecord::ConnectionAdapters::AbstractAdapter.log_info(sql, name, ms) which would do exactly this. Does anyone know what the modern way to log sql is?
[04:08:59] Creeves: we don't use that payment backend anymore, so i'm just deciding whether or not to email them to let them know that they should either do a case sensitive comparison or at least say in their docs that it's case insensitive
[04:09:04] Radar: aweis: ActiveSupport::Notifications.
[04:09:13] Radar: aweis: http://ryanbigg.com/2013/06/finding-sql-queries-in-rails/
[04:10:28] Nowaker: howdy. I get validation errors showed twice with Devise. Any ideas? No, it's not :validatable + custom validations. If I have neither :validatable nor custom validations, I get constraint error (because I didn't check for uniqueness). If I enable :validatable, I get two errors about uniqueness. If I enable :validatable and write a custom validation, I get 4 errors. So... ideas?
[04:10:48] aweis: Radar: isn't this for developing a backtrace, not for adding more SQL to the logs?
[04:11:02] Radar: aweis: You could use it for both.
[04:11:13] Radar: aweis: Rails.logger.info(details[:sql])
[04:11:37] s2013: has joined #RubyOnRails
[04:12:51] NodeNagant: has joined #RubyOnRails
[04:13:38] sofy_arg: Creeves: it works fine if i remove turbolinks
[04:14:15] jdayvie: Hello again =) I'm currently having an issue that has stumped myself and a few others. My live site Program in Person (http://www.programinperson.com) is running fine, able to view all the profiles; however, when a LOGGED IN user visits this profile (http://www.programinperson.com/users/ifdattic), it throws up an issue. It seems to be from a for st
[04:14:15] jdayvie: atement which I have placed there for a geocoder gem. Odd thing is this does not happen on any of the other profiles.
[04:14:34] jdayvie: Here is the gist of the error: https://gist.github.com/Jdayvie/6b1eb1913f132bda7988 - Greatly appreciate it if anyone may know =)
[04:14:48] Creeves: sofy_arg: do you need turbolinks
[04:15:18] Creeves: sofy_arg: can you gist your layout
[04:15:31] aweis: so Radar, I think I am missing something about the details hash in the example. Right now I have the following logs: Rails.logger.info(sql) => Jul 23 21:13:23.840 [5008]: SELECT * FROM table WHERE ts > time_ago('4 min');
[04:16:20] aweis: Radar: previously I would log the following: Jul 23 21:14:01.550 [3629]: SQLT (131 rows) (4.6ms) SELECT * FROM table WHERE ts > time_ago('4 min');
[04:16:25] arooni-mobile: has joined #RubyOnRails
[04:17:17] mwlang: jdayvie: your SELECT clause seems to be substituting ???user_name??? for $1 instead of ???ifdattic??? I doubt that???s your intent.
[04:17:17] sofy_arg: Creeves: http://pastie.org/10308951
[04:17:45] aweis: Radar: is there any way to get the prettier logging of the number of rows returned and the duration spent? Similar to what I was able to do in ActiveRecord::Base.connection.log_info(sql, name, ms)
[04:17:46] arup_r: has joined #RubyOnRails
[04:18:09] mwlang: oh, wait???I???ve been doing too much Rails 1.2
[04:18:28] jdayvie: mwlang: Interesting...THANK YOU for helping zone down the issue =) I won't lie though, I am confused. How/why is it doing that?
[04:18:29] mwlang: the arrays are tuples in ???modern Rails??? :-p
[04:18:43] sofy_arg: Creeves: maybe you want to check my javascript
[04:20:14] jdayvie: SELECT "users".* FROM "users" WHERE "users"."id" = $1 - I see what you mean. Confused as to how that would/could happen.
[04:20:48] sofy_arg: Creeves: http://pastie.org/10308952
[04:21:05] mwlang: jdayvie: ignore that, I sent you barking up the wrong tree
[04:22:00] mwlang: You???re executing an #each on a nil class???which presumably comes from this line: ???for user in @user.nearbys(50)???
[04:22:04] hahuang65: has joined #RubyOnRails
[04:22:08] mike___1234: has joined #RubyOnRails
[04:22:25] poli: has joined #RubyOnRails
[04:22:47] Creeves: sofy_arg: nice, just looking now
[04:23:04] mwlang: most rubyists don???t use the ???for X in Y??? form, and I???m unfamiliar with it, but I???m betting it???s calling #each behind the scenes.
[04:23:21] jdayvie: Okay, but the odd thing is 1: This works fine with all the other users and 2: This was advised through geocode gem.
[04:23:43] jdayvie: It is calling each according to the error.
[04:23:51] mwlang: Well, try changing that line to: ???<% @user.nearbys(50).each do |user| %>
[04:24:11] jdayvie: Just a regular block, makes sense! Let me try that real quick.
[04:24:44] aweis: Radar: I think I found what you were talking about in the abstract_adapter
[04:25:56] jdayvie: mwlang: Nope, the same issue happens.
[04:26:15] jdayvie: That actually causes all the profiles to have an issue.
[04:26:22] Creeves: sofy_arg: which request exactly is sending multiple times?
[04:26:32] Creeves: the post or the get
[04:26:36] sofy_arg: Creeves: both
[04:27:04] sofy_arg: sofy_arg: i believe is something wrong there
[04:27:52] mwlang: jdayvie: at least you now have some consistency. :-)
[04:28:08] jdayvie: Haha, that is true.
[04:28:36] michael_mbp: has joined #RubyOnRails
[04:28:44] jdayvie: It throws up an error with using else in an if statement..
[04:29:17] jdayvie: https://gist.github.com/Jdayvie/6b1eb1913f132bda7988
[04:29:34] badmadrad: has joined #RubyOnRails
[04:29:51] mwlang: jdayvie: backtrace, too.
[04:29:53] jdayvie: (I know spacing is bad, I am in the process of fixing it throughout the project) =P
[04:30:06] jdayvie: Sorry, what do you mean backtrace?
[04:30:17] mwlang: the error
[04:30:25] jdayvie: Sure thing, just deleted it from that =P
[04:31:00] Creeves: sofy_arg: okay i think i've got it
[04:31:03] slash_nick: Have any of you used sass to compile scss in middleware (rather than precompiling)? Any observations on performance?
[04:31:31] jdayvie: mwlang: Its updated.
[04:31:33] jdayvie: Same gist.
[04:31:39] mwlang: slash_nick: performance is about what it???s like in development environment since that???s what happens while you???re developing.
[04:31:41] Creeves: since the delegated event is being rebound on every page:load, you need to attach your delegated click event outside of the ready function
[04:32:35] jdayvie: mwlang: Actually hold on.
[04:32:39] mwlang: jdayvie: are you sure you saved the template and tested?
[04:32:44] jdayvie: That was the previous error, let me show you the newer error.
[04:33:04] slash_nick: mwlang: makes sense... i'm also thinking of using ruby-concurrency and promises in order to do the compiling in the background, expecting it to be ready by render time..
[04:33:07] mwlang: yup. messin??? with me, you are.
[04:33:16] tjbiddle: has joined #RubyOnRails
[04:33:26] jdayvie: Keeping you on your toes =P
[04:33:34] doodlehaus: has joined #RubyOnRails
[04:33:35] jdayvie: Its updated now. Im looking too with ya =P
[04:33:45] mwlang: slash_nick: sounds overly complicated and potentially brittle.
[04:33:46] bradleyprice: jdayvie: What's this bit? <%= user.last_name <% end %>
[04:33:48] pipework: slash_nick: Seems like a waste of time unless you're actually generating scss at runtime that wouldn't be able to be generated early.
[04:33:56] bradleyprice: jdayvie: I think you got a typo
[04:34:04] jdayvie: Yes....yes I do!
[04:34:08] jdayvie: Let me adjust, thank you =P
[04:34:16] pipework: Why not just use tilt and scss in the views and skip the asset pipeline in that case?
[04:34:24] Radar: aweis: GitHub has something for it but I can't remember the name of it!
[04:34:41] jdayvie: Ahh...I think that was it! =P
[04:35:12] jdayvie: mwlang: Thanks for the help with changing the block and bradleyprice, thank you for the typo spot.
[04:35:18] Creeves: sofy_arg: i'm pretty sure you don't need to have either the delegated binding
[04:35:22] Creeves: oops premature enter
[04:35:43] Creeves: sofy_arg: i'm pretty sure you don't need to have either the delegated event binding or the loadConversation function inside the ready function
[04:35:50] sarink: has joined #RubyOnRails
[04:35:53] Creeves: sofy_arg: give this a try perhaps: http://pastie.org/10308952#1
[04:36:08] Creeves: oops meant this: http://pastie.org/10308958
[04:36:26] slash_nick: pipework: only considering it as an outside of the box solution for letting admins dynamically update css... avoiding shipping new css to CDN, along with the need to recompile scss when one of the base css files change in our repo...
[04:36:41] hahuang65: has joined #RubyOnRails
[04:36:42] Creeves: also don't forget the semicolon after the ready func :D
[04:36:59] pipework: slash_nick: Why not just programmatically call the precompile task and then upload the new assets to your CDN?
[04:37:04] pipework: In a background job, perhaps.
[04:37:19] mwlang: I agree with pipework
[04:37:23] sofy_arg: Creeves: what have you changed there
[04:37:26] mwlang: and set it on a git hook
[04:37:44] pipework: mwlang: I'd just write or reuse whatever tooling I already have for deploying my assets, if possible.
[04:37:52] Creeves: sofy_arg: just took the binding and the function out of the ready function
[04:38:35] mwlang: personally, I???d just keep the css in the repo like it should be and practice continuous deployments.
[04:39:04] pipework: mwlang: I've had the need for marketing people to be able to apply custom style to a section of the website before.
[04:39:23] sofy_arg: Creeves: well im not seeing changes in your paste but i removed the entire ready function and now it works fine
[04:39:30] sofy_arg: Creeves: so thanks so much
[04:40:03] slash_nick: mwlang: pipework: that's the go-to solution... we've got a structure file, variables file, then "variable driven structure overrides".... essentially want admins to update the variables file only... it's easy to ship a new version to the CDN and know how to serve that version in the future. It's more annoying to replace all those versions when a developer updates the main scss files. Thus the desire to think of a solution that's just a
[04:40:13] ght: Creeves: Sorry for the late response, but that worked perfectly, thank you
[04:40:30] Creeves: ght: no problem, your welcome
[04:40:44] Creeves: sofy_arg: yay, that's great, your welcome also
[04:40:52] pipework: slash_nick: "The desire to think of a solution that's just a" and you trailed off.
[04:40:54] Creeves: i wasn't sure if you had other stuff in the ready function so didn't want to remove it
[04:41:11] slash_nick: pipework: just a|lways current
[04:41:20] theery: has joined #RubyOnRails
[04:41:35] Gnut: has joined #RubyOnRails
[04:41:52] Trynemjoel: has joined #RubyOnRails
[04:42:25] mwlang: alright, time to hunker down and crank some serious amount of code in next four hours.
[04:42:32] slash_nick: mwlang: godspeed
[04:44:03] crdpink: has joined #RubyOnRails
[04:45:28] slash_nick: pipework: we have the need to apply custom styling to the entire site, for each client, or for org in our clients' organizational hierarchies... we're doing that pretty well, but soon we'll want to do it all much more dynamically
[04:45:41] slash_nick: *or for each org
[04:46:05] slash_nick: ie no commits, no deploys
[04:46:06] pipework: slash_nick: That sounds much more like a dynamic css overrides view that gets loaded.
[04:46:38] badmadrad: has joined #RubyOnRails
[04:46:51] slash_nick: yes, but I don't want to use css when i've already got all this scss written and variables defined
[04:47:08] ujvaljoshi: has joined #RubyOnRails
[04:48:50] pipework: slash_nick: Why can't you just app/views/whatever/overrides.css.scss.erb and <%= overrides_for [client, org] %> and use that at the end of your styles or something?
[04:48:50] slash_nick: pipework: i'm talking about compiling our existing overrides into the markup, not into a css file to be loaded from the rails app or cdn... i also want to let the admin user adjust variables and see the changes in browser without reloading, then commit the variables changes via some new endpoint when satisfied...
[04:49:15] jdayvie: mwlang: So...apparently the issue was not gone =(
[04:49:19] jdayvie: It is still very much there...
[04:50:12] slash_nick: pipework: that is what we're currently doing.. are you saying scss files don't need to be precompiled in order to use them?
[04:50:21] sp1rs: has joined #RubyOnRails
[04:50:38] jdayvie: https://gist.github.com/Jdayvie/c4043079ca84af438d6a - I placed everything in this gist.
[04:50:53] pipework: slash_nick: Depends on where they live, right? app/views/ can serve anything and uses tilt at request time, app/assets/ is typically precompiled in production.
[04:50:55] slash_nick: pipework: ok, css.scss.erb... i didn't see that .erb extension at first
[04:51:26] pipework: slash_nick: As for building the interface for editing the stylesheet, I could see you having a nice form or something floating over a preview of pages where the style would apply, applying new rules as they're added to the form, when you submit the form, you'd want to persist the rules they provided or the changed variables, whatever.
[04:51:57] slash_nick: pipework: think it's a good solution?
[04:52:13] pipework: slash_nick: If you employ view caching for the CSS properly, yes.
[04:52:26] theery: has joined #RubyOnRails
[04:53:55] slash_nick: awesome... thanks pipework. i'll definitely produce a POC using that approach...
[04:54:23] slash_nick: at least a POC
[04:54:34] michaeldeol: has joined #RubyOnRails
[04:54:48] pipework: slash_nick: Are the style variable overrides secret at all?
[04:55:00] vigasdeep: has joined #RubyOnRails
[04:56:04] slash_nick: bradleyprice: how's it going?
[04:56:18] bradleyprice: Good. How are things?
[04:56:19] pipework: slash_nick: You could make a 'theme editor' thing that lets you twiddle variables, and you can add multiple 'themes' and assign them to clients and orgs. When you add a new theme for a client and/or org, it should save it and then immediately cause the css overrides for that new theme to be cached and available. :D
[04:57:08] jdayvie: In case anyone is able to help/may know, I am currently having an issue which I placed into a gist (https://gist.github.com/Jdayvie/c4043079ca84af438d6a). It's can issue on the block but not sure what...
[04:57:34] workmad3: has joined #RubyOnRails
[04:58:19] jdayvie: Additionally, this issue is only happening when visiting one user on my site. All the other profile pages work perfectly fine.
[04:58:54] slash_nick: bradleyprice: no complaints... work stays fun. wife and i are closing on a house this month!
[04:59:06] pipework: slash_nick: It's actually a shame that you don't use a client-side friendly css languagey thing.
[04:59:27] slash_nick: pipework: what do you mean?
[05:00:22] pipework: slash_nick: http://lesscss.org/#client-side-usage you could let them literally twiddle the variables in their client application via the form. Then you'd send the less file as a view file, like we discussed, but it stays as variables because you're sending a less file and not a css file.
[05:01:39] hahuang65: has joined #RubyOnRails
[05:01:43] slash_nick: pipework: so less is more "client side friendly" than sass? i've really never thought about the difference between the two
[05:02:21] pipework: slash_nick: Whale, Could use this: https://github.com/medialize/sass.js/
[05:02:23] pipework: I haven't used it.
[05:02:45] slash_nick: seems like it's going to be fun...
[05:03:40] slash_nick: I was playing with phrasing for editing verbiage inline... really got me wanting that theme editor, floating over a preview of pages...
[05:05:05] tyl: has joined #RubyOnRails
[05:05:15] pipework: slash_nick: If you can, totes go for scss on the client.
[05:05:21] pipework: It'd be pretty sweet, I think.
[05:05:50] slash_nick: i'll keep you posted for sure... it's a project i'll have to do some work on next quarter
[05:06:19] jdayvie: I added the log when the issue is gone (because it works when I am logged out). Also this does not happen on development or any other users in production. Just this one user =/ https://gist.github.com/Jdayvie/c4043079ca84af438d6a
[05:07:18] pipework: slash_nick: Honestly, https://github.com/medialize/sass.js/ looks cool.
[05:07:29] srinidhi: has joined #RubyOnRails
[05:08:13] chinmay_dd: has joined #RubyOnRails
[05:09:45] fighella: has joined #RubyOnRails
[05:10:24] Trynemjoel: has joined #RubyOnRails
[05:15:19] eggoez: has joined #RubyOnRails
[05:16:17] hahuang65: has joined #RubyOnRails
[05:17:12] christiandsg: has joined #RubyOnRails
[05:17:53] ght: Quesiton: any of you guys ever work with the yt gem for accessing YouTube content?
[05:18:19] ght: Our question is, we have it working, but we are attempting to display videos that are private, but on our YouTube account
[05:18:30] ght: We want to be able to display them to authenticated users on our site, but not to YouTube at large.
[05:18:50] Mendenhall: has joined #RubyOnRails
[05:19:41] SuMo_D: has joined #RubyOnRails
[05:23:51] rvanlieshout: has joined #RubyOnRails
[05:29:51] aganov: has joined #RubyOnRails
[05:32:53] GriffinHeart: has joined #RubyOnRails
[05:33:12] Pazician: has joined #RubyOnRails
[05:33:35] GriffinHeart: Hey guys I'm splitting my head with API versioning on the sharing controller code around, how are you guys doing it?
[05:33:45] Pazician: has joined #RubyOnRails
[05:33:45] Radar: GriffinHeart: Example of what you waant?
[05:34:09] quazimod1: has joined #RubyOnRails
[05:34:19] quazimod2: has joined #RubyOnRails
[05:34:54] GriffinHeart: Well I got a controller lets say 'Reward' and I'm gonna change one of the actions response, seems the easiest way is just duplicate routes, copy controller code and change what I need
[05:35:12] Radar: Are you going to do that every time you change a controller?
[05:35:25] GriffinHeart: Yeah exactly :s
[05:36:56] RegulationD: has joined #RubyOnRails
[05:37:10] GriffinHeart: don't really want to do that, for example bugs found and fixed in v2 will still be in v3 common code
[05:37:23] Radar: Who is using the API?
[05:37:32] Radar: And what change specifically are you making?
[05:38:30] giowong: has joined #RubyOnRails
[05:39:59] GriffinHeart: Radar: Mobile app, so have full control, changing the response of one action. 'reward/:id/redeem' so going from v2 -> v3
[05:40:02] user1138: has joined #RubyOnRails
[05:41:04] jonee: has joined #RubyOnRails
[05:41:15] GriffinHeart: Thing is :index, :show and etc stay the same. So several options here: copy code (bad), inherit (meh), extract controller to module and mixit-in (?)
[05:41:29] Lightsword: has joined #RubyOnRails
[05:42:01] rvanlieshout: create concerns?
[05:42:08] GriffinHeart: Radar: How do you usually deal with these? Or how would you deal with it?
[05:43:39] lala: has joined #RubyOnRails
[05:43:55] iamdevnul: has joined #RubyOnRails
[05:43:59] tuelz: has joined #RubyOnRails
[05:44:16] Creeves: GriffinHeart: i'm dealing with the exact same issue at the moment and for now it's just duplicated under each namespace. But I agree it's bad practice
[05:44:29] Creeves: that being said, i'm changing probably more than 50% in v2
[05:44:43] Creeves: so it's somewhat more justified i think
[05:45:13] kimegede: has joined #RubyOnRails
[05:45:26] Creeves: if you're changing only a small percentage of methods it seems excessive
[05:45:39] poli_: has joined #RubyOnRails
[05:45:46] GriffinHeart: Creeves: I'm changing mostly 'as needed' to v3, biggest drawback is bugs being fixed in one version and remaining on another version
[05:46:49] Creeves: hmm, I'm not really upgrading to the next version of my API due to bugs in the previous version, more as a structural change
[05:47:00] Creeves: if i had bugs in previous versions i'd aim to fix them for those versions
[05:47:14] Creeves: but as Radar said, i think it really depends on who is using the API
[05:47:52] tagrudev: has joined #RubyOnRails
[05:48:06] GriffinHeart: Yes, I meant more, when you copy code and fix something in v3 and forget the same code is in v2
[05:48:35] Creeves: ah i see what you mean
[05:48:57] GriffinHeart: Guess extracting common behaviour to concerns seems the best, then just include v2::reward::index, v2::reward:show, v3::reward::redeem into the controller
[05:49:27] safeforge: has joined #RubyOnRails
[05:50:06] Radar: GriffinHeart: Are you changing the action so much that you can't just have the V2 code adapt?
[05:51:35] GriffinHeart: Radar: Yeah the response schema is gonna be different, but the problem is more about how to organise/architect the remaining code and strategies to deal with it
[05:51:55] Radar: GriffinHeart: I don't know, sorry. I don't have anything to recommend here.
[05:53:18] GriffinHeart: Radar: Thanks anyway. Everything I found around the internet is mostly only about dealing with the routes and request header versioning vs path versioning
[05:54:34] slash_nick: GriffinHeart: write a ruby library for communicating with your API... end goal: set @your_api_wrapper.version = 2; @your_api_wrapper.reward_show(params).data... or @your_api_wrapper.version = 3; @your_api_wrapper.reward_show(params).data... version 2 may hit a different end point than version 3
[05:54:49] slash_nick: It's late here, sorry if that doesn't make sense
[05:54:55] krz: has joined #RubyOnRails
[05:55:59] GriffinHeart: slash_nick: hah ok, 14pm here, I'll try to make sense of it
[05:57:01] mary5030: has joined #RubyOnRails
[05:57:36] slash_nick: I've written API wrappers that've had to support various API versions of the same platform... ultimately, in the wrapper, I use namespaces corresponding to platform API versions.. so if nothing changes from 1.0.0 to 1.0.1, class MyApp::V_1_0_1::Reward < MyApp::V_1_0_0::Reward; end... if something had changed, you'd redefine the method in V_1_0_1
[05:57:41] slash_nick: GriffinHeart: ^
[06:01:09] marr: has joined #RubyOnRails
[06:03:00] hahuang65: has joined #RubyOnRails
[06:03:06] ProLoser: has joined #RubyOnRails
[06:04:51] Lloyd: has joined #RubyOnRails
[06:05:33] Creeves: oops wrong window sorry :X
[06:06:04] tyl: has joined #RubyOnRails
[06:07:43] latemus: has joined #RubyOnRails
[06:09:03] alphaatom: has joined #RubyOnRails
[06:09:36] dented42: has joined #RubyOnRails
[06:09:57] Trynemjoel: has joined #RubyOnRails
[06:12:16] Gnut: has joined #RubyOnRails
[06:12:41] GriffinHeart: has joined #RubyOnRails
[06:15:14] jenrzzz: has joined #RubyOnRails
[06:15:17] kumavis_: has joined #RubyOnRails
[06:16:42] KamalKaur: has joined #RubyOnRails
[06:17:53] hahuang65: has joined #RubyOnRails
[06:17:59] xkickflip_: has joined #RubyOnRails
[06:18:52] eGGsha: has joined #RubyOnRails
[06:19:45] KamalKaur: Hi, I have been trying to use bootstrap-sass Bower package in Rails, followed this link: https://github.com/twbs/bootstrap-sass#c-bower when I add the required code in application.rb, the server doesn't start and says: :in `<top (required)>': undefined method `join' for nil:NilClass (NoMethodError).
[06:21:04] Radar: Stacktrace or ban
[06:21:10] Radar: Sorry, I mean "or kittens"
[06:21:28] Trynemjoel: has joined #RubyOnRails
[06:21:57] badmadrad: has joined #RubyOnRails
[06:22:38] sinkensabe: has joined #RubyOnRails
[06:23:14] badmadrad: has joined #RubyOnRails
[06:24:03] jenrzzz: has joined #RubyOnRails
[06:25:04] hahuang65: has joined #RubyOnRails
[06:25:23] rodfersou: has joined #RubyOnRails
[06:25:48] GriffinHeart: has joined #RubyOnRails
[06:26:25] schaerli: has joined #RubyOnRails
[06:28:11] rodfersou: has joined #RubyOnRails
[06:30:01] dhjondoh: has joined #RubyOnRails
[06:35:17] alfie_max15: has joined #RubyOnRails
[06:35:26] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[06:35:28] alfie_max15: has joined #RubyOnRails
[06:38:05] alfie_max15: hi vigasdeep fighella
[06:38:17] alfie_max15: i've got an issue with link_to
[06:38:23] alfie_max15: this is what i'm using :
[06:38:24] alfie_max15: link_to "Reserve", reserve_path(seat), data: {:confirm => t('.confirm_reserve')}, :class => 'button', :method => :put
[06:39:20] alfie_max15: When i click the link, it asked for confirmation, but even when i click cancel the page gets redirected to the link
[06:39:54] alfie_max15: i'm clueless what might be the issue here
[06:40:38] alfie_max15: But when i remove the method, i.e: link_to "Reserve", reserve_path(seat), data: {:confirm => t('.confirm_reserve')}, :class => 'button'
[06:43:26] alfie_max15: vigasdeep, fighella ??? can you guys help me out with this?
[06:43:54] vigasdeep: I used it like this and it works
[06:43:56] vigasdeep: link_to 'Destroy', gen_avail, method: :delete, data: { confirm: 'Are you sure?' }
[06:44:07] fighella: hmm :) I was hoping someone else would jump in -- i havent got experience with the " put " added to my link...
[06:44:23] alfie_max15: vigasdeep, i've tried that too...
[06:44:53] theBestNunu: has joined #RubyOnRails
[06:45:06] alfie_max15: fighella, it's not just with put method, even with destroy the same thing occurs
[06:45:20] alfie_max15: i mean the delete method
[06:45:21] fighella: oh really? oh right. that's a pain. ..
[06:45:29] Gnut: has joined #RubyOnRails
[06:45:38] fighella: yup... so no js conflicts or issues in your console?
[06:46:14] alfie_max15: no issue in the console
[06:46:16] workmad3: has joined #RubyOnRails
[06:47:30] Trynemjoel: has joined #RubyOnRails
[06:48:11] fighella: That's when I write my own bindings :) hah
[06:48:34] sump: has joined #RubyOnRails
[06:48:59] alfie_max15: yeah, that's my last resort, but it should't be like this in rails... It should work... i just want to find the cause of this...
[06:49:54] joaomdmoura: has joined #RubyOnRails
[06:50:04] darutoko: has joined #RubyOnRails
[06:50:05] robbyoconnor: has joined #RubyOnRails
[06:50:08] SuMo_D: has joined #RubyOnRails
[06:51:58] MaDErroR123: has joined #RubyOnRails
[06:52:22] vigasdeep: alfie_max15: I'd suggest taking form part to the end, see if that works
[06:52:36] vigasdeep: Sorry ignore that
[06:53:02] vigasdeep: alfie_max15: I'd suggest taking confirm part to the end, see if that works
[06:53:31] qejk: has joined #RubyOnRails
[06:55:05] Pazician: has joined #RubyOnRails
[06:55:31] Pazician: has joined #RubyOnRails
[06:55:33] kham: has joined #RubyOnRails
[06:56:01] Trynemjoel: has joined #RubyOnRails
[06:56:19] drale2k: has joined #RubyOnRails
[06:56:36] CheckYourSix: has joined #RubyOnRails
[06:59:58] ergherd: has joined #RubyOnRails
[07:01:31] ergherd: I would like to launch a Rails app with *only* Facebook & Google authentication, but set it up so that I can easily introduce email+psw authentication in future. Is it better to roll with Devise + Omniauthable module, or implement only the Omniauth gem for now and migrate to Devise later?
[07:02:01] Trynemjoel: has joined #RubyOnRails
[07:02:16] ergherd: I am leaning towards Devise as, while you kind of have to hammer it to use only the Omniauthable module, it means I can make use of things like the Trackable module at no extra cost.
[07:02:35] ergherd: Does anyone have any experience in this area?
[07:04:58] Gil[l]es: has joined #RubyOnRails
[07:06:27] christiandsg: has joined #RubyOnRails
[07:09:28] Lightsword: has joined #RubyOnRails
[07:09:53] Gil[l]es: has left #RubyOnRails: ()
[07:09:56] Gil[l]es: has joined #RubyOnRails
[07:10:02] GriffinHeart: has joined #RubyOnRails
[07:10:46] Gil[l]es: has joined #RubyOnRails
[07:11:31] Mendenhall: has joined #RubyOnRails
[07:12:55] lxsndl: has joined #RubyOnRails
[07:14:15] erich: has joined #RubyOnRails
[07:14:32] Trynemjoel: has joined #RubyOnRails
[07:15:24] Gil[l]es: has left #RubyOnRails: ()
[07:15:26] Gil[l]es: has joined #RubyOnRails
[07:16:17] Lightsword: has joined #RubyOnRails
[07:16:58] eGGsha: has joined #RubyOnRails
[07:23:45] mary5030: has joined #RubyOnRails
[07:23:51] kumavis_: has joined #RubyOnRails
[07:24:57] schaerli: has joined #RubyOnRails
[07:25:02] lxsameer: has joined #RubyOnRails
[07:26:43] rails663: has joined #RubyOnRails
[07:28:35] lurch_: has joined #RubyOnRails
[07:28:55] elia: has joined #RubyOnRails
[07:28:59] drale2k: has joined #RubyOnRails
[07:29:15] rails663: From foreman readme: "Ruby users should take care not to install foreman in their project's Gemfile." Anyone knows why?
[07:29:24] 64MADFGMP: has joined #RubyOnRails
[07:32:41] mary5030: has joined #RubyOnRails
[07:35:57] artto: has joined #RubyOnRails
[07:36:00] DaniG2k: has joined #RubyOnRails
[07:36:10] Sylario: has joined #RubyOnRails
[07:36:48] Gnut: has joined #RubyOnRails
[07:37:16] inoter: has joined #RubyOnRails
[07:37:57] Rubie: has joined #RubyOnRails
[07:37:59] neanderslob: has joined #RubyOnRails
[07:38:05] TinkerTyper: has joined #RubyOnRails
[07:38:42] mfoo: has joined #RubyOnRails
[07:40:00] neanderslob: hi all, I'm finding that render 'edit' renders the path /incorporations/1 rather than /incorporations/1/edit
[07:40:42] neanderslob: it seems to be retaining editing functionality just fine but I feel like it's an indication that something's amiss
[07:40:49] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[07:40:57] neanderslob: more context in this gist: https://gist.github.com/BigMcLargeHuge/564ffe0004c54dd1b0eb
[07:41:38] Guest93100: has joined #RubyOnRails
[07:41:40] czerasz: has joined #RubyOnRails
[07:42:00] dideler: has joined #RubyOnRails
[07:42:28] ur5us: has joined #RubyOnRails
[07:44:40] tuelz: has joined #RubyOnRails
[07:46:32] sevenseacat: has joined #RubyOnRails
[07:51:25] arBmind: has joined #RubyOnRails
[07:51:56] bruno-: has joined #RubyOnRails
[07:52:57] zpe: has joined #RubyOnRails
[07:53:16] mary5030: has joined #RubyOnRails
[07:53:24] lxsameer: has joined #RubyOnRails
[07:59:34] safeforge: has joined #RubyOnRails
[07:59:40] livathinos: has joined #RubyOnRails
[08:00:37] yfeldblum: has joined #RubyOnRails
[08:01:14] mikecmpbll: has joined #RubyOnRails
[08:03:21] drale2k: has joined #RubyOnRails
[08:04:04] yfeldblum: has joined #RubyOnRails
[08:04:15] ruurd: has joined #RubyOnRails
[08:04:31] czerasz: has joined #RubyOnRails
[08:04:39] Guest93100: has joined #RubyOnRails
[08:06:37] davidjd: has joined #RubyOnRails
[08:07:04] schaerli: has joined #RubyOnRails
[08:08:20] watnall56: has joined #RubyOnRails
[08:09:36] bmalum: has joined #RubyOnRails
[08:10:14] Mendenhall: has joined #RubyOnRails
[08:10:25] snophey: has joined #RubyOnRails
[08:10:40] jsrn_: has joined #RubyOnRails
[08:12:40] snophey: has left #RubyOnRails: ()
[08:16:30] xkickflip: has joined #RubyOnRails
[08:17:13] blackhuey: has joined #RubyOnRails
[08:18:03] noodman: has joined #RubyOnRails
[08:20:07] tvw: has joined #RubyOnRails
[08:22:04] tjbiddle: has joined #RubyOnRails
[08:22:32] cornerma1: has joined #RubyOnRails
[08:23:18] axl_: has joined #RubyOnRails
[08:27:57] blackmesa: has joined #RubyOnRails
[08:31:34] rodfersou: has joined #RubyOnRails
[08:31:50] schaerli: has joined #RubyOnRails
[08:31:57] terpo: has joined #RubyOnRails
[08:32:24] bronson: has joined #RubyOnRails
[08:32:26] rodfersou: has joined #RubyOnRails
[08:33:01] rodfersou: has joined #RubyOnRails
[08:33:21] eGGsha: has joined #RubyOnRails
[08:33:36] anti-freeze: has joined #RubyOnRails
[08:35:13] doodlehaus: has joined #RubyOnRails
[08:37:35] bmalum: has joined #RubyOnRails
[08:38:42] bonhoeffer: has joined #RubyOnRails
[08:38:57] TomasAchmedovas: has joined #RubyOnRails
[08:39:17] Rubie: has joined #RubyOnRails
[08:43:21] GriffinHeart: has joined #RubyOnRails
[08:45:04] drale2k: has joined #RubyOnRails
[08:47:32] xkickflip: has joined #RubyOnRails
[08:47:35] rakm: has joined #RubyOnRails
[08:49:56] Pazician: has joined #RubyOnRails
[08:50:26] lepetitbastard: has joined #RubyOnRails
[08:50:34] Mendenhall: has joined #RubyOnRails
[08:50:40] lepetitbastard: Hi guys, I have a create action that contains code which I rather prefer to have most of it in the model. Unfortunately due to lack of experience I am finding it hard. Please have a look into my gist. Any help would be very much appreciated. Thanks in advance. Gist: https://gist.github.com/tonydefaria/bd622c01c6a81fee50cf
[08:52:25] tbuehlmann: LePetitBastard, I wouldn't place that logic in the model, I probably would write a service class for exactly this kind of work
[08:52:42] krz: has joined #RubyOnRails
[08:52:44] Aswebb_: has joined #RubyOnRails
[08:53:18] tbuehlmann: as in having a file app/services/payment_method_creator.rb (or similar) which handles the case
[08:53:46] ujvaljoshi: has joined #RubyOnRails
[08:55:24] christiandsg: has joined #RubyOnRails
[08:55:44] rvanlieshout: the location of the code isn't a preference
[08:55:47] rvanlieshout: it's a design
[08:56:17] lepetitbastard: hi tbuehlmann thanks for the answer. I will have a look to see how this could be done as a service. Never really done such thing
[08:56:24] rvanlieshout: a service would be better for here
[08:56:30] rvanlieshout: a service class is just a class that does something for you
[08:56:41] tbuehlmann: writing an example real quick
[08:56:48] rvanlieshout: so you create a class, add a method and have it create the paymentmethod and apply that to a given CreditCard
[08:57:21] drale2k: has joined #RubyOnRails
[08:57:43] lepetitbastard: rvanlieshout thanks a million! :)
[08:58:04] jenrzzz: has joined #RubyOnRails
[08:58:12] rvanlieshout: well.. thatnk tbuehlmann. he's writing an exmple for you :)
[08:58:18] lepetitbastard: tbuehlmann you are a star
[08:59:01] lepetitbastard: tbuehlmann really appreciate the help.
[09:01:53] kham: has joined #RubyOnRails
[09:02:12] one_zero: has joined #RubyOnRails
[09:06:08] tjbiddle: has joined #RubyOnRails
[09:08:25] tbuehlmann: something around this: https://gist.github.com/tbuehlmann/94005d8e54ecb015a55e
[09:09:19] tbuehlmann: spreading opinions on this one, but that's a first step
[09:09:35] tbuehlmann: maybe extract a method or two from #perform, but well
[09:09:36] lxsndl: has joined #RubyOnRails
[09:10:37] Diabolik: im getting an undefined line 34 faux_order https://gist.github.com/askl56/1f1675faa9c046d97e38
[09:10:40] Diabolik: first time using coffeescript
[09:10:40] Diabolik: so im somewhat confused
[09:10:55] lepetitbastard: wow! tbuehlmann really appreciate the effort! :) Will go ahead and try it out. Will be back to let you know how it went
[09:12:10] Trynemjoel: has joined #RubyOnRails
[09:15:56] hahuang65: has joined #RubyOnRails
[09:16:00] schaerli: has joined #RubyOnRails
[09:16:33] Surt_Q: has joined #RubyOnRails
[09:21:01] cajone: has joined #RubyOnRails
[09:22:40] Kilo`byte: has joined #RubyOnRails
[09:22:48] dented42: has joined #RubyOnRails
[09:23:04] eGGsha: has joined #RubyOnRails
[09:23:26] GriffinHeart: has joined #RubyOnRails
[09:24:00] EminenceHC: has joined #RubyOnRails
[09:24:38] xkickflip: has joined #RubyOnRails
[09:27:02] artto: has joined #RubyOnRails
[09:27:11] Trynemjoel: has joined #RubyOnRails
[09:28:46] xkickflip_: has joined #RubyOnRails
[09:30:04] Diabolik: can you possibly help?
[09:30:49] tbuehlmann: not a fan of coffee, sorry
[09:31:53] DEA7TH: has joined #RubyOnRails
[09:34:33] bmalum: has joined #RubyOnRails
[09:34:42] Trynemjoel: has joined #RubyOnRails
[09:36:33] amon777: has joined #RubyOnRails
[09:37:05] arBmind: has joined #RubyOnRails
[09:37:12] latemus: has left #RubyOnRails: ()
[09:37:18] fighella: has joined #RubyOnRails
[09:38:09] RegulationD: has joined #RubyOnRails
[09:38:11] nikhgupta: has joined #RubyOnRails
[09:38:16] amon777: We are running a live website, for a year now...and the last 4-5 days we experience site down issues...(loading and loading and loading)... the server doesn't experience any memory/traffice issue...and the production.log file doesn't seem to have any record useful to us...please any help? It's really critical to find a way to solve that issue
[09:41:12] amon777: any directions what to check out ?
[09:41:28] DefV: can you reproduce it?
[09:42:01] blackmesa: has joined #RubyOnRails
[09:42:23] bmalum: has joined #RubyOnRails
[09:42:31] DefV: because if you can you could strace your application server and see on which resource it is hanging
[09:42:31] nikhgupt: has joined #RubyOnRails
[09:43:30] DefV: (Ik ben wel onder de indruk dat de NOA nog klopt)
[09:44:50] DefV: wrong channel :-)
[09:44:59] rvanlieshout: ik dacht al :)
[09:45:09] DefV: maar: Now on Air ;-)
[09:45:25] tuelz: has joined #RubyOnRails
[09:45:51] amon777: Processing by PagesController#show as HTML
[09:45:51] amon777: Parameters: {"pages"=>"undefined"}
[09:46:01] amon777: that's the only error that i see now at the log
[09:46:18] amon777: and the exception notifier that tries to send email through smtp but it fails
[09:46:36] DefV: amon777: can you reproduce the hang?
[09:46:41] DefV: amon777: because if you can you could strace your application server and see on which resource it is hanging
[09:47:01] amon777: DefV: the website is still down... can't reproduce it
[09:47:52] hahuang65: has joined #RubyOnRails
[09:48:59] amon777: the last 50 lines of log : https://gist.github.com/glouk7/6f6e1eff45938fed8b89
[09:49:10] DefV: amon777: good
[09:49:15] DefV: amon777: log into your server
[09:49:22] DefV: amon777: and see what your server process is doing
[09:49:29] schaerli: has joined #RubyOnRails
[09:49:50] DefV: is it using 100% cpu or sitting there idle
[09:50:03] DefV: use strace / lsof to see what it is waiting for
[09:52:12] Skelz0r: has joined #RubyOnRails
[09:52:13] Trynemjoel: has joined #RubyOnRails
[09:52:15] w09x: has joined #RubyOnRails
[09:52:19] solars: has joined #RubyOnRails
[09:52:32] amon777: i've rolled back to the old pages controller
[09:52:39] amon777: (i've made changes before 2 weeks)
[09:52:43] amon777: and now it came up..
[09:52:47] amon777: i guess the issue is theer
[09:52:49] livathinos: has joined #RubyOnRails
[09:54:25] eGGsha: has joined #RubyOnRails
[09:54:36] xkickflip_: has joined #RubyOnRails
[09:55:55] amon777: let me gist the part of the code that is changing
[09:59:21] amon777: https://gist.github.com/glouk7/ecc875c70bf9538db35f/revisions please check..i've the original code...and revision also with the code that create the issues (website interruptions for some minutes)
[09:59:28] amon777: that's the pages controller
[10:00:12] dtcristo: has joined #RubyOnRails
[10:04:01] xkickflip: has joined #RubyOnRails
[10:06:03] amon777: any idea what could cause issues? I am not experienced Ruby on Rails programmes...and i am not sure what is wrong with that part. I really will appreciate any help..as it's a critical issue to our project..
[10:11:46] Trynemjoel: has joined #RubyOnRails
[10:14:13] wasp__: has joined #RubyOnRails
[10:14:39] workmad3: has joined #RubyOnRails
[10:16:49] bin_005: has joined #RubyOnRails
[10:17:54] schaerli: has joined #RubyOnRails
[10:18:01] Juanchito: has joined #RubyOnRails
[10:26:33] amon777: Why two simple "if then else" statements to interrupt the website, for 10-15 minutes?
[10:26:39] alienaut: has joined #RubyOnRails
[10:27:05] ddv: amon777: you have to debug this
[10:27:42] amon777: ddv: i am trying...but it looks correct to me, if you see the gist i've sent above, you will see that the "if then else" statements are quite simple
[10:27:55] amon777: ddv: https://gist.github.com/glouk7/ecc875c70bf9538db35f/revisions
[10:28:20] ddv: amon777: you have to be more specific
[10:29:06] amon777: ddv: I've used pages controller to define what value will has the @title variable and @description variable, which change the Title and the meta Description by page
[10:29:32] amon777: ddv: so i've added two new fields at the database, in order to be able someone to add custom title and custom meta description by page
[10:30:06] amon777: ddv: three files changed, the "pages" model, the"pages" controller and the "pages" view
[10:30:47] nikhgupt`: has joined #RubyOnRails
[10:30:57] amon777: ddv: It works...BUT, after we did the change, we experience website interruptions...the Ruby seems to stop responding for some minutes, randomly hours in a day
[10:30:59] workmad3: amon777: !gist-usage
[10:30:59] helpa: amon777: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[10:30:59] dashedstripes: has joined #RubyOnRails
[10:31:08] ddv: seriously provide a normal gist
[10:31:34] ddv: amon777: and your tests are passing?
[10:31:44] workmad3: ddv: oh man, you're hopeful there :P
[10:31:57] alienaut: When i am using sequel gem. When i run Weeks.where{ matches_count.lt 2 } it produce wrong query https://gist.github.com/alienaut/bbfa04671f740c0cb0af
[10:32:15] ddv: amon777: can you please be more concise, I still have no clue what you did and what the problem even is
[10:32:16] amon777: ddv: tests are passing, and it seems that it works fine.
[10:32:22] schaerli: has joined #RubyOnRails
[10:32:53] stamina: has joined #RubyOnRails
[10:32:58] amon777: ddv: the problem is that Ruby randomly stops responding for some minutes (the site goes offline)..and then comes back, after the change we implemented
[10:33:08] ddv: amon777: show me the changes
[10:33:09] amon777: ddv: so i am trying to find out, what is going on
[10:33:17] ddv: amon777: also you are making an assumption
[10:33:38] amon777: ddv: from the production.log file, at the time of the interruption, we see that pages controller gives error
[10:34:00] workmad3: alienaut: did you add the sequel gem when you meant to add the squeel gem?
[10:34:02] ddv: amon777: also don't use then with if unless it's a one liner and don't litter your controller with instance variables
[10:34:08] amon777: ddv: should i gist only the code i've added at the controller?
[10:34:20] ddv: amon777: the code you changed
[10:34:47] amon777: ddv: i've just added, not changed. let me show you
[10:34:47] alienaut: workmad3 did add. sorry for typo
[10:35:17] workmad3: alienaut: heh :) great typo btw... sequel gem is an ActiveRecord replacement, squeel is ActiveRecord extensions ;)
[10:36:05] doodlehaus: has joined #RubyOnRails
[10:36:36] arup_r: has joined #RubyOnRails
[10:36:40] amon777: ddv: Code added is from line 25 to line 41 (nothing else changed to pages controller) https://gist.github.com/glouk7/42940137b054951a12dd
[10:36:45] alienaut: workmad3 thanks :)
[10:37:03] alienaut: i am completely using wrong gem lol.
[10:37:14] ddv: that show action
[10:37:43] ujvaljoshi: has joined #RubyOnRails
[10:37:46] DylanJ: ddv: i've seen worse
[10:37:48] neilfse: has joined #RubyOnRails
[10:38:04] workmad3: DylanJ: 'seen worse' != good :P
[10:38:09] ddv: DylanJ: You did? Because this is really bad. I don't want to be a phrick or anything but come on
[10:38:32] DylanJ: yeah for sure workmad3 i'm in no way implying that this is good.
[10:38:41] DylanJ: i'm just saying, there's worse out there. much much much muuuuuch worse.
[10:39:26] workmad3: DylanJ: but yeah, I've seen worse too... I think one of the worst I saw was about 100 lines of controller code that used ActiveRecord::Base.execute to get back raw database results, and then manually turned them into arrays and hashes...
[10:39:50] workmad3: the dev's draw dropped when I replaced it with 2 lines of plan AR use..
[10:40:31] workmad3: gah, so many typos in that last sentence!
[10:40:32] elaptics: draw? or jaw?
[10:41:06] DylanJ: workmad3: there's an app i sometimes have to fix bugs for that has an action which is ~450lines of code.
[10:41:19] ddv: DylanJ: nice time to refactor it
[10:41:23] DylanJ: fuuuuuck that
[10:41:27] DylanJ: this aint my problem
[10:41:39] ddv: DylanJ: Nice attitude
[10:41:45] amon777: i didn't wrote the code guys...and i am not even a RoR developer...but this is something i have to handle, so i wrote that part of code with the (if) statements
[10:42:10] KamalKaur: has joined #RubyOnRails
[10:42:18] Trynemjoel: has joined #RubyOnRails
[10:42:22] DylanJ: ddv: you don't know the situation. maybe one day you'll inherit 200k lines of shit and need to make sure it keeps running while a replacement is in the works.
[10:42:25] amon777: so i would really appreciate if you could advice me what is going wrong..and thank you in advance
[10:42:55] mostlybadfly: has joined #RubyOnRails
[10:43:07] ddv: DylanJ: shouldn't be a problem if you write a good test suite
[10:43:31] ddv: DylanJ: also I have inherited far lager code bases
[10:43:35] ddv: larger*
[10:43:44] workmad3: ddv: did you inherit them with or without test suites?
[10:43:44] elaptics: ddv: lager code bases are better :)
[10:43:48] blackmesa: has joined #RubyOnRails
[10:43:54] ddv: workmad3: sometimes with and sometimes without
[10:44:04] ddv: lol elaptics
[10:44:28] tibounise: has joined #RubyOnRails
[10:45:05] workmad3: ddv: adding trustworthy tests to a large codebase in a reasonable amount of time isn't exactly easy :P if the entire system is already being rebuilt from scratch with more experienced devs, chances are it's not worthwhile and quick-fix is the name of the game...
[10:45:19] workmad3: it sucks, but that's the way things are at times :)
[10:45:27] ddv: workmad3: it's actually not that black and white
[10:45:36] arup_r1: has joined #RubyOnRails
[10:45:37] tibounise: I have troubles with my Rails application, when I do a POST requests on '/assets', I get a message saying "Method Not Allowed"
[10:45:53] tibounise: But there is a route for that action
[10:45:59] eGGsha: has joined #RubyOnRails
[10:46:00] DEA7TH_: has joined #RubyOnRails
[10:46:00] workmad3: ddv: did I state anything there in black and white terms? all of it was shades of gray and dependent on exact situation
[10:46:09] tibounise: And I can't find anything to help me on Google
[10:47:04] wethu: has joined #RubyOnRails
[10:47:14] workmad3: tibounise: rule of thumb - do *not* create a route 'assets'... that's the route that's grabbed by Sprockets for the asset pipeline by default
[10:47:18] ddv: workmad3: dont strawman me
[10:49:10] tibounise: workmad3: That explains my problem??? Thank's for the answer :)
[10:49:49] amon777: ddv: any idea mate? is it totally wrong?
[10:49:52] amon777: ddv: thank you
[10:50:16] xkickflip_: has joined #RubyOnRails
[10:50:42] ddv: just doing nothing at all is a dangerous attitude (and also not very professional) and exactly the reason why so many bad code bases exist, code is not a static thing that you write once and forget about it
[10:51:23] ddv: amon777: I have no idea
[10:51:54] ddv: amon777: diff the changes and step through it with byebug or something
[10:52:06] thelastinuit: has joined #RubyOnRails
[10:52:46] bmalum: has joined #RubyOnRails
[10:53:35] ddv: amon777: are you even sure this rails app is causing the problem?
[10:53:36] zeeraw: has joined #RubyOnRails
[10:54:28] amon777: ddv: yes, because at the time that ruby stops interrupting, nothing goes bad at the server...no memory or cpu issues, no other log errors at the server...nothing
[10:54:29] workmad3: ddv: hate to point it out, but you're the one now doing a strawman... I didn't suggest doing nothing, I said that in the situation that an entire app rebuild is already under construction (which is something) and by extension the existing app has a very limited lifespan left, then spending the time to build a trustworthy and robust test suite around the existing app is probably not an economically so
[10:54:33] ddv: amon777: are you not causing an infinite loop that is locking up the main ruby thread?
[10:54:35] workmad3: und idea in a business setting
[10:55:03] amon777: ddv: hmm that's maybe a logical issue there...do you see an infinite loop?
[10:56:35] kh0d: has joined #RubyOnRails
[10:57:08] ddv: amon777: ruby stops interrupting?
[10:57:12] ddv: what does that even mean
[10:57:18] amon777: ddv: sorry...stops responding
[10:57:33] ddv: amon777: ok so ruby is not monopolozing the cpu?
[10:58:01] chills42: has joined #RubyOnRails
[10:58:08] mostlybadfly: has joined #RubyOnRails
[10:58:15] ddv: workmad3: don't drag me into your confusion :)
[10:58:25] xkickflip: has joined #RubyOnRails
[10:59:19] ddv: amon777: did you check any connetivity issues for example the connection between rails and the database
[10:59:23] dhjondoh: has joined #RubyOnRails
[10:59:51] workmad3: ddv: heh :) I'm not confused :P
[11:00:22] tibounise: has left #RubyOnRails: ()
[11:00:37] DEA7TH: has joined #RubyOnRails
[11:00:48] workmad3: ddv: but it seems like a particularly pointless discussion, tbh... I suspect that if we got into specific examples we'd be in either agreement or only mildly disagree, and I can't be bothered to construct examples of sufficient complexity to warrant the discussion
[11:00:50] amon777: ddv: As this issue is happening several days, and our technicians and me are watching the hardware and ruby logs, nothing founded, so we believe that something goes wrong at the Ruby app.
[11:01:30] workmad3: ddv: I am curious as to what you thought was a strawman argument though ;)
[11:02:15] ddv: amon777: what is not responding exactly?
[11:02:16] leex: Hey, why isn't there a deep_transform_values method for Hash in rails but a deep_transform_keys method? any special reasoning behind it?
[11:03:13] amon777: ddv: Actually, the app is not responding...the website doesn't loading at all
[11:03:49] ddv: amon777: if you check with wireshark do you get any http responses back from rails?
[11:03:56] ddv: workmad3: we probably agree
[11:04:28] jlyndon: has joined #RubyOnRails
[11:04:46] DefV: amon777: I'll restate this one more time, if you ignore me this time it's on you
[11:04:52] DefV: amon777: use strace / lsof to see what it is waiting for
[11:05:05] ddv: so says its waiting
[11:05:09] DefV: amon777: your ruby server
[11:05:47] DefV: ddv: if it's hanging and server resources aren't spiked, that's my #1 hunch
[11:06:00] DefV: it's waiting for connection to db/external source/file access/deadlocked
[11:06:14] ddv: DefV: assumptions
[11:06:20] DefV: ddv: ofcourse
[11:06:30] DefV: ddv: only one way to rule em out
[11:06:32] amon777: ddv: i am not ignoring you mate, i am just trying to find out what exactly you mean with that
[11:06:36] DefV: ddv: go look at what the thing is doing
[11:06:37] amon777: ddv: as i've never used it
[11:06:47] doodlehaus: has joined #RubyOnRails
[11:06:55] ddv: amon777: listen to DefV
[11:07:10] DefV: amon777: strace -p <pid>
[11:07:14] DefV: to see what it is doing
[11:07:22] gavit_: has joined #RubyOnRails
[11:07:23] DefV: lsof -p <pid> to see what files / resources are being accessed
[11:07:24] uranther: has joined #RubyOnRails
[11:07:24] zorak8: has joined #RubyOnRails
[11:07:34] DefV: the pid is the process-id of your rails-server serving the requests
[11:08:05] xkickflip: has joined #RubyOnRails
[11:08:22] amon777: DefV: should i check these at the moment that the Ruby is not responding, right?
[11:08:23] corioliss: has joined #RubyOnRails
[11:08:30] DefV: amon777: right
[11:08:48] DefV: amon777: because if it is responding you're not in any trouble :-)
[11:08:50] Trynemjoel: has joined #RubyOnRails
[11:08:58] ddv: gavit: test failed
[11:09:00] amon777: DefV: ok, i will note them...as now it works ok
[11:09:13] gavit: ddv: testing irssi_proxy with limechat
[11:09:19] amon777: DefV: I will tell our technicians to run these commands when it is not responding again
[11:09:54] ddv: gavit: test failed
[11:09:58] gavit: I can see the messages in limechat, but can't type through it :(
[11:10:16] ddv: gavit: why are you not using textual?
[11:10:21] ddv: i'm assuming here you are on osx
[11:10:41] gavit: ACTION doesn't know textual
[11:10:58] amon777: DefV: Should an infinite loop, to cause the app to stops responding for some minutes randomly in a day?
[11:12:26] timharding: has joined #RubyOnRails
[11:12:32] gavit: ddv: why would working with textual be different?
[11:12:54] gavit: I'm wondering how to switch channels with irssi_proxy and type now :(
[11:12:58] ddv: gavit: because it started as a fork off limechat
[11:14:39] DefV: amon777: it's possible, but infinite loops mean cpu usage
[11:14:42] schaerli: has joined #RubyOnRails
[11:14:50] Trynemjoel: has joined #RubyOnRails
[11:15:34] schaerli_: has joined #RubyOnRails
[11:16:16] Cork: how do one generate an url for "/public/file.html"?
[11:16:44] Cork: meaning i want url_for to give me a full url (including host) for a file in the /public folder
[11:16:50] bruno-: has joined #RubyOnRails
[11:18:48] sonOfRa: Cork: rails 4 has polymorphic_url
[11:19:28] jonee: has joined #RubyOnRails
[11:19:54] amon777: DefV: Hmmm right, and we don't experience such issue...no hardware problems during the offline website
[11:21:30] amon777: DefV: Should i describe you, the last change i did at the code ? Because, i am not experienced RoR developer, so maybe i've done something wrong. Because at the Ruby log files, i saw page controller error
[11:22:13] bruno-: has joined #RubyOnRails
[11:23:32] timharding: Cork: http://stackoverflow.com/questions/8052532/rails-3-1-path-url-to-file-in-public-directory
[11:23:33] arup_r: has joined #RubyOnRails
[11:24:01] Cork: timharding: root_path is just "/" i need to generate a full url
[11:24:32] timharding: Cork: read the page "UPD I've found a dead simple solution"
[11:25:43] timharding: has left #RubyOnRails: ("Ciao!")
[11:25:44] Cork: hmm, that might work
[11:27:40] bruno-: has joined #RubyOnRails
[11:28:31] ruurd: has joined #RubyOnRails
[11:28:41] arup_r1: has joined #RubyOnRails
[11:29:21] Aswebb_: has joined #RubyOnRails
[11:30:31] Fire-Dragon-DoL: has joined #RubyOnRails
[11:32:16] christiandsg: has joined #RubyOnRails
[11:32:21] Trynemjoel: has joined #RubyOnRails
[11:33:01] bruno-: has joined #RubyOnRails
[11:33:21] syath: has joined #RubyOnRails
[11:33:23] syath: n #sequel
[11:34:53] ldnunes: has joined #RubyOnRails
[11:35:27] tuelz: has joined #RubyOnRails
[11:35:47] blackmesa: has joined #RubyOnRails
[11:36:33] Gnut: has joined #RubyOnRails
[11:36:57] shock_one: has joined #RubyOnRails
[11:38:26] bruno-: has joined #RubyOnRails
[11:39:57] Scripore: has joined #RubyOnRails
[11:41:33] KamalKaur: has joined #RubyOnRails
[11:43:49] bruno-: has joined #RubyOnRails
[11:44:14] zeeraw: has joined #RubyOnRails
[11:45:09] terpo: has joined #RubyOnRails
[11:47:18] bonhoeffer: has joined #RubyOnRails
[11:48:10] schaerli: has joined #RubyOnRails
[11:48:52] kh0d: has joined #RubyOnRails
[11:49:31] theBestNunu: has joined #RubyOnRails
[11:50:30] busterarm: has joined #RubyOnRails
[11:50:34] Pazician: has joined #RubyOnRails
[11:51:02] eGGsha: has joined #RubyOnRails
[11:54:23] chills42: has joined #RubyOnRails
[11:58:23] Trynemjoel: has joined #RubyOnRails
[11:58:37] schaerli: has joined #RubyOnRails
[11:59:12] bruno-: has joined #RubyOnRails
[12:00:09] tyl: has joined #RubyOnRails
[12:01:50] mjc_: has joined #RubyOnRails
[12:03:04] DEA7TH: has joined #RubyOnRails
[12:03:20] kitsuneyo: has joined #RubyOnRails
[12:03:32] kitsuneyo: What does a date record look like in Rails? I want to make a couple of seed records that include a date column
[12:03:36] blackmesa: has joined #RubyOnRails
[12:03:39] Mago_joao: has joined #RubyOnRails
[12:04:36] bruno-: has joined #RubyOnRails
[12:05:52] safeforge: has joined #RubyOnRails
[12:07:28] busterarm: Rails has API documentation for how to work with Date objects but I think how it actually looks in the database depends on which database
[12:08:09] Mago_joao: I really need some help in understanding how to make a working nested form with treeview, could someone kindle help me? thanks
[12:09:41] bruno-: has joined #RubyOnRails
[12:10:36] dudoom: has joined #RubyOnRails
[12:10:48] kh0d: has joined #RubyOnRails
[12:10:59] mdel: has joined #RubyOnRails
[12:11:07] jonee: has joined #RubyOnRails
[12:11:54] Trynemjoel: has joined #RubyOnRails
[12:13:30] emilkarl: has joined #RubyOnRails
[12:14:23] emilkarl: Anyoen got an idea how to abort a Ajax request en respond with an alert if not authorized with Pundit. Right not the reponse is a redirect to referer/homepage???
[12:15:02] Rubie: has joined #RubyOnRails
[12:15:10] cheeti: has joined #RubyOnRails
[12:16:36] kitsuneyo: is it 2015-07-24 ??
[12:16:44] tbuehlmann: emilkarl, a simple `render text: 'alert();'` maybe?
[12:17:04] k4nd4lf: has joined #RubyOnRails
[12:18:39] emilkarl: hmm k but does that stop the request from rendering ???js.erb? http://pastie.org/10309734
[12:18:48] emilkarl: kidoz: it is
[12:18:57] tyl: has joined #RubyOnRails
[12:18:57] busterarm: kitsuneyo: that's the default, but there are many ways to format date strings
[12:18:59] emilkarl: kitsuneyo: yes
[12:19:14] busterarm: and it may not actually look like that in the database
[12:19:18] kitsuneyo: so if i put dates in that format in my seed data it should work?
[12:19:48] busterarm: I think usually you'd want to do Date.new(year, month, day)
[12:20:03] bruno-: has joined #RubyOnRails
[12:20:52] busterarm: if you're using to_date on a string, there are many ways you can do it
[12:22:42] Gabriel403: has joined #RubyOnRails
[12:22:42] Gabriel403: has joined #RubyOnRails
[12:23:16] kitsuneyo: i guess i need to pass it like '1925-01-30' with inverted commas?
[12:23:45] kitsuneyo: ah to_date sounds useful, thanks busterarm
[12:23:49] busterarm: "pass it" is very vague. It's not clear what you're trying to do
[12:23:51] schaerli: has joined #RubyOnRails
[12:24:09] busterarm: your safest bet is probably making date objects with Date.new
[12:24:30] kitsuneyo: ok sorry. i have a model Person and one of the columns is of type date. i'm just adding a couple of seed records in seeds.rb
[12:25:10] kitsuneyo: the date is one value in a column, so do i really need Date.new?
[12:25:22] bruno-: has joined #RubyOnRails
[12:25:51] busterarm: you'll want a Date object, but there's a few ways to arrive at that
[12:25:55] Trynemjoel: has joined #RubyOnRails
[12:26:35] Scripore: has joined #RubyOnRails
[12:26:43] JDeen: has joined #RubyOnRails
[12:26:51] kitsuneyo: busterarm, i did this... born: '1963-03-16'.to_date
[12:26:52] busterarm: to_date can do weird things sometimes, but you can specify formatting which avoids that
[12:27:44] xkickflip_: has joined #RubyOnRails
[12:28:40] jkamenik: has joined #RubyOnRails
[12:28:54] busterarm: I'd do either Date.new(1963, 3, 16) or Date.strptime("1963-03-16", '%Y-%m-%d')
[12:29:13] busterarm: but that's me
[12:32:37] JDeen: Hi there. I would like to the generated rails structure to be slightly differnet. For example I would like the source code of the app be in `src` folder, where I will have other folders like 'archive' and stuff not related to the rails project. Any one wiht suggestions to generate a project like that?
[12:33:13] ddv: jdeen: because?
[12:33:51] emilkarl: Worked thank you tbuehlmann
[12:33:58] kitsuneyo: busterarm, i tried the first of your suggestions and it works so i'll stick with that, thank you
[12:35:27] busterarm: ddv: agreed. I'd have to have a pretty strong reason to break Rails conventions
[12:35:31] workmad3: jdeen: you'll be fighting rails a lot to modify the basic app structure in that way... and fighting rails means you lose a lot of the benefits of rails, so I'd advise very heavily against doing something like that
[12:35:42] busterarm: though there is a post I found about how to do it (in Rails 3)
[12:35:57] JDeen: ddv: its just to structure projects and to keep them consistant with other projects of mine. In theory i like to keep documentation, archive (old stuff, notes) etc seperate from rails code
[12:36:16] ddv: jdeen: add a doc directory to your rails project
[12:36:55] workmad3: jdeen: what's 'archive' and how is it different from your git/scm history?
[12:37:34] ddv: jdeen: keep personal notes outside of scm
[12:37:59] tuelz: has joined #RubyOnRails
[12:38:42] JDeen: No not like that. for example if I change a php website to Rails I would keep the old php site inside archive `php-implementation`.
[12:39:22] JDeen: The thing is such things can one day become helpful for some one who works on the project for referencial pourposes would it not
[12:40:14] christiandsg: has joined #RubyOnRails
[12:40:21] JDeen: so that one git clone gives access to the whole history of the project
[12:40:32] charliesome: has joined #RubyOnRails
[12:40:34] busterarm: i'd put that in docs too, tbh. It's not an active part of the project
[12:40:41] workmad3: jdeen: sure... but I'd stick that in a separate branch of the git repo and remove it from the main project
[12:40:49] busterarm: or what workmad3 said
[12:40:57] Creeves: has joined #RubyOnRails
[12:41:18] JDeen: seperate branch, good idea!
[12:41:20] Aswebb_: has joined #RubyOnRails
[12:41:44] wethu: has joined #RubyOnRails
[12:41:49] workmad3: jdeen: leverage git for what it's good for - tracking all your old code and decisions in controlled ways (tags & branches are your friends here :) )
[12:42:00] workmad3: lunch time!
[12:42:05] busterarm: :/ i need to start using tags more
[12:42:20] Papierkorb: has joined #RubyOnRails
[12:42:36] JDeen: sure, enjoy lunch!
[12:42:55] arup_r: has joined #RubyOnRails
[12:43:23] mary5030: has joined #RubyOnRails
[12:43:25] JDeen: busterarm: I tag, every time I merge a branch to dev or dev to master. but never actually got to use it (like checkout specific version)
[12:43:44] JDeen: so probably its ok to tag less :)
[12:46:11] bweston92: has joined #RubyOnRails
[12:46:16] sevenseacat: has joined #RubyOnRails
[12:46:21] daxroc: has joined #RubyOnRails
[12:46:56] TinkerTyper: has joined #RubyOnRails
[12:47:57] Trynemjoel: has joined #RubyOnRails
[12:49:10] wm3|away: yeah, I personally only tag if I want to easily recover a specific commit (because I had to change direction on something and want to recover the original code) or if I'm doing something that has discrete rather than continuous releases
[12:49:22] wm3|away: otherwise I use branches to track things :)
[12:49:53] drale2k: has joined #RubyOnRails
[12:49:58] rustymyers: has joined #RubyOnRails
[12:53:28] Trynemjoel: has joined #RubyOnRails
[12:53:45] JoshL: has joined #RubyOnRails
[12:54:27] TinkerTyper: has joined #RubyOnRails
[12:54:46] seba4: has joined #RubyOnRails
[12:55:36] seba4: hi to everyone anyone used gulp with rails? I have a problem with scss @import
[12:55:43] Grundell: has joined #RubyOnRails
[12:57:16] stantonnet: has joined #RubyOnRails
[12:57:21] Detch: has joined #RubyOnRails
[12:57:38] allcentury: has joined #RubyOnRails
[12:58:18] cac: has joined #RubyOnRails
[12:58:58] renews: has joined #RubyOnRails
[12:59:52] gavit_: has joined #RubyOnRails
[13:00:05] ramortegui: has joined #RubyOnRails
[13:00:15] schaerli: has joined #RubyOnRails
[13:00:39] sandelius: has joined #RubyOnRails
[13:00:55] dtcristo: has joined #RubyOnRails
[13:00:57] bmurt: has joined #RubyOnRails
[13:01:19] gavit: has joined #RubyOnRails
[13:01:27] mary5030: has joined #RubyOnRails
[13:02:24] maryb: has joined #RubyOnRails
[13:03:11] a346: has joined #RubyOnRails
[13:03:51] sankaber: has joined #RubyOnRails
[13:04:28] Trynemjoel: has joined #RubyOnRails
[13:07:09] erich: has joined #RubyOnRails
[13:07:34] kitsuneyo: I want to make a select-type form field, where each option's label is the same as its value (a string). How do I do that?
[13:08:18] universa1: kitsuneyo: what have you tried?
[13:08:23] kitsuneyo: So the options will be 'Staff', 'Writing', 'Music' etc, and choosing one of those will save that same text as a string in the database
[13:09:06] kitsuneyo: universa1, I'm looking at this page: http://guides.rubyonrails.org/form_helpers.html#making-select-boxes-with-ease ...
[13:09:43] kitsuneyo: ...And it seems like I could do something like this: <%= f.select :category, options_for_select(['Staff', Staff], etc. )%>
[13:09:46] MaryBoom: has joined #RubyOnRails
[13:09:58] kitsuneyo: but that seems a bit inefficient
[13:09:59] MaryBoom: has left #RubyOnRails: ()
[13:10:30] busterarm: select_tag "name" options_for_select([array of options])
[13:10:35] busterarm: if you're using turbolinks
[13:10:43] busterarm: http://apidock.com/rails/ActionView/Helpers/FormTagHelper/select_tag
[13:10:49] universa1: kitsuneyo: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select
[13:10:56] universa1: busterarm: what has turbolinks to do with it?
[13:11:08] busterarm: err, form tag helpers i mean
[13:12:07] kitsuneyo: busterarm, I think that's what I'm doing
[13:12:27] universa1: kitsuneyo: so f.select :foo, %w(Staff Whtaever Something)
[13:12:39] kitsuneyo: universa1, I saw that page too but it seems more relevant for if I was collecting the values from the Db?
[13:12:54] busterarm: it's all the same thing really, just if you use the method there's nice options to do things for you, like have a selected default
[13:12:57] MaryBoom: has joined #RubyOnRails
[13:13:00] pingpong11: has joined #RubyOnRails
[13:13:03] MaryBoom: Hi! I have a project that runs on localhost perfectly, now I want to move it to my server. I've moved my project folder and tried to start webrick from ssh, it works. Obviously, this is not the right solution because the app wont start up again after server reboot, also I cannot run it on :80 because it is already taken by Apache. So how do you guys do it?
[13:13:14] kitsuneyo: I can use %w?? I'm not sure how to do that...
[13:13:22] universa1: kitsuneyo: are you creating a form for a model? so did you do form_for @something do |f| ?
[13:13:25] busterarm: or you could pull the values directly from a collection with options_from_collection_for_select
[13:13:27] universa1: kitsuneyo: open up irb
[13:13:28] bhegel: has joined #RubyOnRails
[13:13:41] universa1: kitsuneyo: and enter %w(...)
[13:14:09] kitsuneyo: It's for making strings right?
[13:14:16] universa1: kitsuneyo: please try it out.
[13:14:36] kitsuneyo: I just tried it, and I've seen it before in some Ruby books
[13:15:27] kitsuneyo: But haven't seen it much in Rails, and didn't know I can use it in form helpers etc
[13:15:59] universa1: kitsuneyo: form helpers are just ruby methods.
[13:16:00] kitsuneyo: oh so it makes an array...
[13:16:15] umgrosscol: has joined #RubyOnRails
[13:16:25] Rubie: has joined #RubyOnRails
[13:17:19] bhegel: I have a series of models which represent various ???types??? of a Parent. However each Child type has slightly different DB fields from the others. Is this a case for Single Table Inheritance?
[13:17:49] universa1: bhegel: how much do they actually have in common? with sti you always have all fields across all "types"
[13:18:00] Trynemjoel: has joined #RubyOnRails
[13:18:03] dopie: has joined #RubyOnRails
[13:18:10] Scripore: has joined #RubyOnRails
[13:18:33] universa1: actual example would make it easier to give you actual advise.
[13:18:39] Schalla: has joined #RubyOnRails
[13:18:45] Schalla: has joined #RubyOnRails
[13:20:02] bhegel: Well for example, Publication has title, author, etc. But then there are things like BookReview, which has book_reviewed, book_title; or ConferencePaper which has conference_title, conference_date, etc.
[13:20:33] bhegel: So they are all different kinds of publications with probably ~5 basic facts about publications in common, then ~10 different subtypes with 1-2 ???unique??? fields.
[13:22:47] kitsuneyo: ok so i now have: <%= f.select :category, options_for_select(%w(Staff Programming ETC))%>
[13:23:03] universa1: kitsuneyo: you most likely could drop the options_for_select
[13:23:19] kitsuneyo: this seems work although i haven't saved a record with it yet because the rest of the form isn't done yet
[13:23:40] jhack: has joined #RubyOnRails
[13:24:18] kitsuneyo: universa1, if i drop options_for_select then do i have to wrap %w(Staff Programming ETC)) in something?
[13:24:49] kitsuneyo: thanks so much universa1 !
[13:24:53] Kedric: has joined #RubyOnRails
[13:25:16] kitsuneyo: i knew there would be an easier Rails Way to do it... :D
[13:25:29] kitsuneyo: see y'all later
[13:27:25] Kedric: Anyone here using docker? Do you deploy on digital ocean CoreOS or AWS or do you ahve your own server?
[13:28:31] garrypolley: has joined #RubyOnRails
[13:28:37] Schalla: Not using docker, deploying on own server.
[13:28:49] blackmesa: has joined #RubyOnRails
[13:28:58] Schalla: But its a relative small application, so I dont need the scalability.
[13:29:18] Kedric: thats how we currently are Nignx, Unicorn, PG configured by ansible. The issue I have is continous delivery
[13:29:42] Kedric: our continous integration tests would take upwards of 40 minutes to spin up a new box, install everything, and run the tests
[13:30:00] Kedric: our local development machines crawl a bit too much when we need 2 servers up
[13:30:32] poli: has joined #RubyOnRails
[13:31:00] schaerli: has joined #RubyOnRails
[13:31:35] RubyNewbey_: has joined #RubyOnRails
[13:31:39] Schalla: kedric: I dont understand entirely why Docker should solve that?
[13:32:29] Grundell: has joined #RubyOnRails
[13:32:36] umgrosscol: Schalla: The docker images have everything installed already.
[13:33:09] Schalla: umgrosscol, welp, yeah, good point.
[13:33:34] Schalla: I didnt expect that it is that which takes so much time.
[13:33:41] Schalla: (installation of deps etc)
[13:33:47] umgrosscol: Schalla: It's not a panacea, nor without it's own drawbacks, but it's a pretty handy tool.
[13:34:12] umgrosscol: Schalla: Yeah, and getting the dependencies lined up just so can be a bit of a pain.
[13:34:51] Kedric: Schalla: the stack we have is the same across most apps but running ansible with new vars can do unexpected consequences and is outside the use case (removing an app and adding a new one). The containers would be smart enough to handle it without running the whole ansible stack
[13:35:05] Kedric: we would use the ansible stack to set up everything except unicorn and the app
[13:35:48] Schalla: Sounds reasonable, sadly no experience with it, sorry. Its a thing I wanted to look into, but that list is quite long
[13:35:54] Schalla: (Creating own app containers)
[13:36:07] umgrosscol: kedric: I concur. Infrastructure as code is nice. I don't like having to change my infrastructure just to test applications.
[13:36:50] wallaby: has joined #RubyOnRails
[13:37:45] Nubville: has joined #RubyOnRails
[13:38:11] Kedric: umgrosscol: Schalla The issue I am running into is the zero downtime deployment on production. I need a load balancer of some sort to spin up the new container, add to load balancer, remove old container, delete old container
[13:39:22] paulcsmith: has joined #RubyOnRails
[13:39:30] doodlehaus: has joined #RubyOnRails
[13:39:34] RegulationD: has joined #RubyOnRails
[13:39:35] Lightsword: has joined #RubyOnRails
[13:39:38] umgrosscol: kedric: Your load balancer should be able to point to just about anything... a different container on the same machine, a different vm, different instance of the application living wherever... ect.
[13:40:16] busterarm: has joined #RubyOnRails
[13:40:19] Kedric: umgrosscol: I agree, its just picking the balancer. Looking at HaProxy and Nginx, need something to configure the pool and have easy automatic deployments
[13:40:29] DEA7TH: has joined #RubyOnRails
[13:40:42] Aswebb_: has joined #RubyOnRails
[13:40:58] umgrosscol: We're switching to haproxy.
[13:41:15] umgrosscol: Using some hardware load balancers currently.
[13:41:19] Lightsword: has joined #RubyOnRails
[13:41:22] hashrocket: has joined #RubyOnRails
[13:42:15] Kedric: we host all of our stuff on digital ocean. We are a small company but I fear growing pains badly
[13:42:31] Kedric: and the docker stuff gets us CI, which is MUCH NEEDED
[13:43:25] umgrosscol: kedric: Never used digital ocean. I've heard people like it. I've used AWS and Azure.
[13:43:41] romdi: has joined #RubyOnRails
[13:44:15] Kedric: umgrosscol: yeah, DO has been awesome for us, zero issues. Went to an AWS summit but its a bit much. Like the other stuff, but DO for hosting leaves me zero reason to switch
[13:44:32] Kedric: and in all seriousness, the DB/Web/App area all on the same box.
[13:45:41] umgrosscol: kedric: Yeah, you'd really have to have a sysadmin boner or sufficiently complex use case that would prompt you to switch.
[13:45:55] xhoy: hi! i have an object and in my controller i do a redirect_to @object, but i would love to do a redirect_to @object, action: :edit
[13:46:01] xhoy: but that doesnt seem to work...
[13:46:04] xhoy: any suggestions?
[13:47:02] Kedric: umgrosscol: and I have neither, nor do the uppers of this company think Sysadmins are worth it. Sales people know domain admin password.. Unprotected shares??? I am just waiting for the day shit blows up lol
[13:47:10] busterarm: what's the alias for the edit route?
[13:47:15] xhoy: (there are 3 different object types, so i could do an if/else/something?
[13:47:19] busterarm: you could redirect_to that alias?
[13:47:28] xhoy: yeah but then i first need to look it up?
[13:47:52] umgrosscol: kedric: It might never blow up. It might also never have to scale. You could get lucky.
[13:48:02] sevenseacat: xhoy: redirect_to [:edit, @object]
[13:48:02] Trynemjoel: has joined #RubyOnRails
[13:48:09] shanson: has joined #RubyOnRails
[13:48:19] busterarm: or yeah that
[13:48:23] busterarm: i forgot you could od that
[13:48:30] xhoy: sevenseacat: that should be documented somewhere :P
[13:48:36] Kedric: umgrosscol: big bucks no whammy!
[13:48:45] livathinos: has joined #RubyOnRails
[13:48:50] mrbubbles: has joined #RubyOnRails
[13:48:53] xhoy: http://api.rubyonrails.org/classes/ActionController/Redirecting.html <<< i didn't read it that way?
[13:49:05] xhoy: no example with an [] ?
[13:49:09] sevenseacat: http://guides.rubyonrails.org/routing.html#creating-paths-and-urls-from-objects
[13:49:17] sevenseacat: see the last example
[13:49:50] xhoy: dammit how could i mis that!
[13:50:52] schaerli: has joined #RubyOnRails
[13:51:09] busterarm: kedric, umgrosscol: i feel like the market is constantly on a spectrum between "sysadmins aren't worth it" and "omg we need our own hardware and sysadmins to run it"
[13:52:16] Kedric: busterarm: Its more getting C** Buy in in small companies has been my issue. They see it as a cost center, not a preventative solution
[13:52:59] busterarm: i just flatly refuse to work at companies that treat tech as a cost center. Took my hits already.
[13:53:00] Kedric: they can just sit and hope it doesn???t break and when it does lose thousands of dollars or just get a sysadmin to prevent it
[13:53:18] Kedric: i am ???programming??? all the time, when half of it is sysadmin for our servers
[13:53:19] busterarm: i also got used to working at hedge funds where they have budgets
[13:53:28] busterarm: a little spoiled
[13:53:29] Mago_joao: Need help with nestedform and TreeView stackoverflow question = http://stackoverflow.com/questions/31565554/ror-nested-form-hidden-field-value
[13:53:30] Kedric: generic company stuff is on them, my dev side is golden
[13:54:45] busterarm: i worked for five years at a tech company run by all retail executives who basically ran the business development group and the entire rest of the company separately with only one person to communicate between them
[13:54:49] annlewis: has joined #RubyOnRails
[13:55:05] busterarm: i liken the experience to slamming your head into a wall every day :)
[13:55:42] Kedric: oh the battles with manglement
[13:55:46] Axilla: has joined #RubyOnRails
[13:55:51] busterarm: but hey, work from home! :D
[13:56:39] porkchicharon: has joined #RubyOnRails
[13:56:44] Kedric: I am allowed to work from home, but none of my developers are because ???we don???t know if they are actually working???. Uh, I assigned them tasks that I can do personally, know how long they take and they submit PRs I can tell when they dont work
[13:57:01] Kedric: so I can and cannot work from home because I don???t want to make the rift between management and dev team worse.
[13:57:03] Trynemjoel: has joined #RubyOnRails
[13:57:28] Kedric: they also think project visibility is acheived by people working in the office. I need a new job lol
[13:57:41] busterarm: full time remote is great if all parties involved pull their weight
[13:58:08] busterarm: end up not being able to judge anyone except based on deliverables
[13:58:13] adac: has joined #RubyOnRails
[13:58:23] busterarm: which does have its cons though
[13:58:28] Kedric: culture becomes hard to manage and team cohesion can be difficult to acheive
[13:58:33] umgrosscol: busterarm: I concur. Get things done is a good metric.
[13:58:54] busterarm: you end up not being able to do any research projects though
[13:59:14] benhuda: has joined #RubyOnRails
[13:59:15] adac: Is there a better 'alternative' to a rake task that is called via cron every xx minutes? Is there gem/tool that can handle this rails internally?
[13:59:16] busterarm: or rather, if you do them and the budget tightens up, the people doing those projects will get axed
[13:59:20] busterarm: (which I learned)
[13:59:49] Kedric: adac: Whenever can be used to schedule rake tasks.
[14:00:23] busterarm: +1 for whenever
[14:00:28] Papierkorb: seconding whenever, it's pretty much ruby DSL for a crontab generator
[14:00:29] Kedric: cant put people full time on research projects in most places. Throwing a few days here and there can be feasible
[14:00:40] Papierkorb: Would like systemd timers more, but, it just works.
[14:00:51] adac: kedric, Exactly yes! I also found: https://github.com/ondrejbartas/sidekiq-cron tah maybe an alternative!
[14:01:41] Kedric: adac: whenever is less moving parts if that is something you care about.
[14:01:47] Kedric: also, we haven???t really adopted redis here
[14:02:20] adac: kedric, I see yes
[14:02:29] busterarm: are you already on postgres?
[14:03:02] Kedric: yup, but we don???t use a lot of the lower level features. Its pretty much mysql + hstore for us right now. Haven???t had a need to optimize anything
[14:03:16] RegulationD: has joined #RubyOnRails
[14:03:47] fgielow: has joined #RubyOnRails
[14:03:49] busterarm: just with all the new features pg is bringing, I almost can't see a need for using the key-value or column-family stores
[14:04:10] busterarm: almost. redis is nice.
[14:04:17] fighella: has joined #RubyOnRails
[14:04:23] gambl0re: has joined #RubyOnRails
[14:04:30] werelivinginthef: has joined #RubyOnRails
[14:04:37] drale2k: has joined #RubyOnRails
[14:05:11] podman: has joined #RubyOnRails
[14:05:26] sinkensabe: has joined #RubyOnRails
[14:05:46] centrx: has joined #RubyOnRails
[14:05:53] sarink: has joined #RubyOnRails
[14:06:14] busterarm: https://momjian.us/main/writings/pgsql/yesql.pdf This talk blew my mind at the time.
[14:06:35] busterarm: but it's better to watch him give it
[14:08:13] Kedric: Alright, so if I use a balancer, I would have to serve my assets. I currently use unicorn. Thoughts? stack would be HaProxy -> container app
[14:08:25] gavit__: has joined #RubyOnRails
[14:08:50] DefV: Why not use nginx -> container app?
[14:08:55] isjaylee: has joined #RubyOnRails
[14:08:55] DefV: nginx is great at serving files
[14:09:23] k4nd4lf: has joined #RubyOnRails
[14:09:29] Kedric: DefV: cause nginx would be passing to upstream and the section about serving static files would no longner work due to the files being contained in the container
[14:09:33] Papierkorb: Yeah Postgres is awesome. You can even add indexes on JSON data. Why on earth would I want to have yet another DB system if I already have PSQL with all of its features?
[14:10:04] Trynemjoel: has joined #RubyOnRails
[14:10:05] busterarm: well, PG still doesn't have the stuff that the graph dbs do on the radar
[14:10:22] DefV: kedric: Hm, I fell into the conversation a bit late. Ignore whatever I said :-)
[14:10:38] busterarm: but screw it. I'll use them and stick in pg with the foreign data wrappers anyway
[14:10:46] shanson: has joined #RubyOnRails
[14:10:59] krz: has joined #RubyOnRails
[14:11:06] chrissonar: has joined #RubyOnRails
[14:11:35] nettoweb: has joined #RubyOnRails
[14:11:48] tenderlove: has joined #RubyOnRails
[14:11:51] Kedric: DefV: That???s the issue I am having right now. I have nginx -> unicorn app installed on same server. I want to container the apps for a number of reasons which means the apps themseves have to serve assets.
[14:12:40] chrissonar: what is a great approach to store code snippets in a blog post? with HTML tags like (<span class="class">String</span>) or something else?
[14:13:00] ArchRogem: has joined #RubyOnRails
[14:13:21] universa1: chrissonar: there are various possibilities. you can integrate some highlighting gem, use some js library to do the code highlighting, ...
[14:13:35] balr0g: has joined #RubyOnRails
[14:13:35] victortyau: has joined #RubyOnRails
[14:13:50] DefV: kedric: I'd suggest always running a webserver next to your unicorn
[14:13:57] DefV: you can run unicorn + nginx in a container
[14:14:03] busterarm: i'd probably span and style it but in my younger lazier years I'd have used a pre tag
[14:14:06] DefV: and put a haproxy before the container
[14:14:22] Kedric: DefV: hmm, is that a lot of overhead
[14:14:23] DefV: so haproxy -> [container with: nginx -> unicorn]
[14:14:24] Papierkorb: Why not use passenger?
[14:14:33] Kedric: Papierkorb: not sure, its not off the table
[14:14:40] DefV: kedric: depends how much assets you need to serve
[14:14:45] Kedric: Papierkorb: we are currently unicorn for zero downtime deployment
[14:14:47] DefV: but ruby is really bad at serving static files
[14:14:57] Kedric: DefV: some assets, and I agree with bad ruby static file serving
[14:15:11] schaerli: has joined #RubyOnRails
[14:15:37] chrissonar: universa1, I think I'd prefer backend side parsing. which highlightening gem you can advise? coderay or rouge?
[14:15:37] feignt: has joined #RubyOnRails
[14:15:39] Kedric: dumb question, when you package a docker container, everything is pre installed so its quick to install on the server right?
[14:15:57] isjaylee: anyone here fluent with react on rails? i'm trying to display an associated model's data and can't figure out the syntax to put in the component
[14:16:08] universa1: chrissonar: i personally use pygemntize
[14:16:09] Papierkorb: kedric: the free nginx passenger doesn't do zero downtime itself. For me, it's more like 5-seconds-downtime. OTOH, for it you get a full webserver with well known characteristics, which can serve static files just fine and also has a fast rails app server
[14:17:00] Rubie: has joined #RubyOnRails
[14:17:06] Kedric: Papierkorb: yeah. I may go that route.
[14:17:34] Pazician: has joined #RubyOnRails
[14:17:58] Luun: has joined #RubyOnRails
[14:18:00] ruurd: has joined #RubyOnRails
[14:18:13] Luun: has left #RubyOnRails: ()
[14:18:19] christiandsg: has joined #RubyOnRails
[14:18:22] Luun: has joined #RubyOnRails
[14:18:31] tubbo: kedric: why not serve assets from S3 and use asset_sync on deploy?
[14:18:57] Luun: has left #RubyOnRails: ()
[14:19:00] spiman: has joined #RubyOnRails
[14:19:10] chrissonar: universa1, this is JS. a npm package?
[14:19:30] JulienTant: has joined #RubyOnRails
[14:19:34] Luun: has joined #RubyOnRails
[14:19:40] universa1: chrissonar: no.
[14:20:05] umdstu: has joined #RubyOnRails
[14:20:17] universa1: chrissonar: https://rubygems.org/gems/pygmentize
[14:20:37] lxsndl: has joined #RubyOnRails
[14:20:52] universa1: there is also pygments.rb
[14:21:10] badmadrad: has joined #RubyOnRails
[14:21:18] jschoolcraft: has joined #RubyOnRails
[14:22:00] chrissonar: universa1, it runs on top of pygment, means python, right?
[14:22:16] DaniG2k: has joined #RubyOnRails
[14:22:17] umdstu: any current best practices for storing and accessing user preferences ?
[14:22:27] universa1: umdstu: database.
[14:22:45] umdstu: universa1: so just keep doing what i'm doing, a user preferences model belongs_to :user with tons of columns?
[14:22:55] DaniG2k: I have a super simple gem and I'm trying to get rake tasks hooked into the Rails apps that I'd be including the gem in
[14:23:01] DaniG2k: This is my code (super simple task)
[14:23:02] DaniG2k: https://github.com/DaniG2k/rankrb/blob/master/lib/tasks/inverted_index.rake
[14:23:10] universa1: umdstu: tbh: we don't know what you're doing.
[14:23:22] umdstu: universa1: you can't read my mind?
[14:23:35] umdstu: humans really need to advance
[14:23:37] Hates_: has joined #RubyOnRails
[14:23:40] DaniG2k: I'm not sure how I'd get this rake task to appear in the Rails app that houses this gem
[14:24:04] universa1: DaniG2k: think of any gem that provides a rake task, look how they do it, adopt it to your own problem.
[14:24:27] isjaylee: has left #RubyOnRails: ()
[14:24:31] umdstu: universa1: just store user prefs, like default sort orders, which things to see on login, etc.
[14:25:16] umdstu: maybe like this, http://joshsymonds.com/blog/2012/05/16/quick-and-easy-user-preferences-in-rails/
[14:25:34] DaniG2k: universa1: I was looking at how Sunspot does it
[14:25:37] michael_mbp: has joined #RubyOnRails
[14:26:39] DaniG2k: I see they're loading with Railtie
[14:26:46] spiman: hello, from what i figure in rails 3.2.x creating a scope where i use Time.now as a parameter will not reevaluate the timestamp properly (tested in console - not sure about it)
[14:26:50] spiman: To workaround this i'm using -> { Time.now }.call as the injected param. is this ok? is there a more elegant way to do it?
[14:27:11] spiman: sorry if i sprung up mid-conversation
[14:27:26] universa1: spiman: code
[14:27:32] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[14:27:35] spiman: coming back with gist
[14:28:41] arup_r: has joined #RubyOnRails
[14:28:48] chills42: has joined #RubyOnRails
[14:29:35] jschoolcraft: is there a guard equivalent where I can specify the watch and triggered command on the command line? something like guard lib/tasks rake foo:bar ?
[14:29:38] eyck: has joined #RubyOnRails
[14:29:57] universa1: jschoolcraft: guard-shell
[14:29:58] chrissonar: universa1, Do you run python and ruby in the same box (maybe heroku dyno)?
[14:30:05] Trynemjoel: has joined #RubyOnRails
[14:30:17] chrissonar: for that specific pygment project
[14:30:27] theery: has joined #RubyOnRails
[14:30:42] universa1: chrissonar: no. i've my own root server.
[14:30:49] zorak8: has joined #RubyOnRails
[14:31:02] chrissonar: universa1, nice. :)
[14:31:15] jschoolcraft: universa1: that's still creating a Guardfile, I want something for 45 minutes while I'm messing with something
[14:31:40] universa1: jschoolcraft: it takes 2 minutes to create the guard file? how long are you searching for an alternative?
[14:31:47] spiman: gist : https://gist.github.com/spiman/dcb66afc260a86c3caf0 -- i think it's simple enough, i just want to see if the assumptions i make in the comments are correct
[14:31:50] mloy: has joined #RubyOnRails
[14:32:07] jschoolcraft: universa1: that's not really the point :) I'm sharpening my yak shaving skills. but point taken.
[14:32:52] universa1: spiman: https://gist.github.com/universal/2827e2d573f823a02da8
[14:33:09] spiman: brilliant, thanks
[14:33:37] universa1: jschoolcraft: you can probably hack something together with whatever library guard uses, but than you can use guard directly ;)
[14:33:45] jkamenik1: has joined #RubyOnRails
[14:34:12] kies^: has joined #RubyOnRails
[14:35:03] chills42: has joined #RubyOnRails
[14:35:10] bronson: has joined #RubyOnRails
[14:35:15] Hates_: Is there a gem that highlights the cached fragments on a page? I'm trying to debug some locally
[14:35:19] jschoolcraft: universa1: just made the guardfile
[14:35:29] Hates_: I know there was one that showed which partials were rending what sections
[14:35:29] jschoolcraft: universa1: thanks for the prodding :)
[14:35:41] universa1: jschoolcraft: yw :-)
[14:36:06] Rubie: has joined #RubyOnRails
[14:36:07] kh0d: has joined #RubyOnRails
[14:37:16] Cache_Money: has joined #RubyOnRails
[14:37:45] Jarboe: has joined #RubyOnRails
[14:38:16] charliesome: has joined #RubyOnRails
[14:39:04] _lexjm: has joined #RubyOnRails
[14:40:22] The_Phoenix: has joined #RubyOnRails
[14:40:54] shanson: has joined #RubyOnRails
[14:41:19] The_Phoenix: has joined #RubyOnRails
[14:41:27] jonee: has joined #RubyOnRails
[14:41:46] r4pha: has joined #RubyOnRails
[14:42:38] mdel: has joined #RubyOnRails
[14:43:19] darutoko: has joined #RubyOnRails
[14:43:39] asheinfeld: has joined #RubyOnRails
[14:43:40] TeckniX: has joined #RubyOnRails
[14:44:57] jxf: has joined #RubyOnRails
[14:45:09] gavit_: has joined #RubyOnRails
[14:47:01] Lightsword: has joined #RubyOnRails
[14:47:31] Kedric: tubbo: the sites are incredibly small and I would rather not add another point of failure, even though it is amazon.
[14:47:51] DEA7TH: has joined #RubyOnRails
[14:48:29] disgrntld: has joined #RubyOnRails
[14:48:51] Lightsword: has joined #RubyOnRails
[14:49:47] theery: has joined #RubyOnRails
[14:50:13] mrbubbles: has joined #RubyOnRails
[14:51:37] Trynemjoel: has joined #RubyOnRails
[14:52:19] cac: has joined #RubyOnRails
[14:54:03] kham: has joined #RubyOnRails
[14:55:29] StanLee: has joined #RubyOnRails
[14:56:06] nickenchuggets: has joined #RubyOnRails
[14:56:09] jottr: has joined #RubyOnRails
[14:57:04] chintanparikh: has joined #RubyOnRails
[14:57:15] renews: has joined #RubyOnRails
[14:57:36] AzaToth: has joined #RubyOnRails
[14:57:39] safeforge: has joined #RubyOnRails
[14:58:17] ktchup: has joined #RubyOnRails
[14:59:07] Trynemjoel: has joined #RubyOnRails
[15:04:01] siemprefresco: has joined #RubyOnRails
[15:04:12] nalley: has joined #RubyOnRails
[15:05:03] Lightsword: has joined #RubyOnRails
[15:07:56] spiman_: has joined #RubyOnRails
[15:08:44] r4pha: has joined #RubyOnRails
[15:10:54] Papipo: has joined #RubyOnRails
[15:12:27] NodeNagant: has joined #RubyOnRails
[15:12:53] Papipo: Question: I want to develop a gem relying on ActiveRecord and I need it to have at least one migration. I don't want to have the full rails stack as dependency. Can the migrations live in the gem, should I add generators? How? Using thor maybe?
[15:13:26] universa1: Papipo: look at how other gems do it?
[15:13:59] bhegel: has joined #RubyOnRails
[15:14:00] universa1: and afaik you need to move the migration into the app for it to be run... so you can't run migrations from a gem.
[15:14:07] mikecmpbll: Hates_: don't know about a gem but you could do that yourself pretty easy :)
[15:14:24] annlewis: has joined #RubyOnRails
[15:14:33] universa1: Papipo: but if your gem is completely independent of rails, and to be used alone you can have migrations there.
[15:14:48] JDeen: has joined #RubyOnRails
[15:14:51] universa1: Papipo: there should be some blog post about how to use ar (migrations) in stand-alone mode.
[15:14:53] Hates_: mikecmpbll: work?!?! :(
[15:14:59] Papipo: it could have a conditional railtie, but I don't want to depend on rails
[15:15:22] mikecmpbll: Hates_: def cache(*args, &block); safe_concat("<div style='border: 1px solid red'>"); super; safe_concat("</div>"); end
[15:15:25] Papipo: it adds many gem dependencies that I don't need at all
[15:15:30] mikecmpbll: Hates_: there, don't even have to work i did it for you :P
[15:15:37] Gnut: has joined #RubyOnRails
[15:15:40] Hates_: ACTION shakes fist at mikecmpbll
[15:15:52] Hates_: mikecmpbll: hahaha, that's awesome :D
[15:15:59] theery: has joined #RubyOnRails
[15:16:09] Hates_: mikecmpbll: thanks
[15:17:11] walidvb: has joined #RubyOnRails
[15:17:37] walidvb: i'm trying to figure out how to deploy an app to a privately owned server, but see plenty of ways to do so
[15:17:46] walidvb: and i'm not exactly sure what is needed, tbh
[15:17:54] shanson: has joined #RubyOnRails
[15:17:58] Hates_: walidvb: capistrano is the most common way
[15:18:04] mikecmpbll: walidvb: not sure what difference the ownership makes? :p
[15:18:28] walidvb: i will be given ssh access to a machine running whichever OS i want
[15:18:30] universa1: walidvb: i personally use mislav's git-deploy
[15:18:37] mary5030: has joined #RubyOnRails
[15:18:39] walidvb: mikecmpbll: lol of course, i meant vs. heroku
[15:18:48] mikecmpbll: walidvb: right. and yeah capistrano is awesome.
[15:18:51] riotjones: has joined #RubyOnRails
[15:18:53] walidvb: woho. that's what i meant, 10 ways to do so
[15:18:57] walidvb: docker, no?
[15:19:01] hobodave: has joined #RubyOnRails
[15:19:17] universa1: walidvb: you need to evaluate that stuff yourself, whichever fits YOUR needs the best.
[15:19:23] walidvb: mikecmpbll: why not?
[15:19:25] mary5030: has joined #RubyOnRails
[15:19:28] mikecmpbll: walidvb: because no :(
[15:19:29] universa1: we can't really decide for you.
[15:19:39] Trynemjoel: has joined #RubyOnRails
[15:19:41] walidvb: universa1: hm agree, thing is google gives plenty of ways
[15:20:05] mikecmpbll: 1) evaluate 2) choose
[15:20:23] walidvb: but i figure you do need smth that will for example restart your app if it crashes, riught?
[15:20:26] universa1: walidvb: i'd say look at capistrano first, it is the most common thing. i'd personally have a look at git-deploy, too (result is somwhat similar to heroku)
[15:20:42] mikecmpbll: walidvb: so we're talking about more than just deployment
[15:20:46] walidvb: universa1: i would love to have smth similar to heroku!
[15:20:59] werelivi_: has joined #RubyOnRails
[15:21:06] walidvb: mikecmpbll: yes, i'm trying to understand the whole process, actually
[15:21:07] universa1: walidvb: and then there are things like ansible / chef / ...
[15:21:21] walidvb: i will be given a machine, i need it to serve pages
[15:21:40] mikecmpbll: walidvb: nginx + passenger, rvm on server, and capistrano to deploy is the easiest route imo
[15:21:49] walidvb: but i'm having difficulties finding out what's necessary
[15:21:55] walidvb: ok. any reason why not docker?
[15:22:11] mikecmpbll: you seem keen on it, so go for it if you want.
[15:22:20] mikecmpbll: i know nothing about deploying rails apps with docker.
[15:22:26] DaniG2k: has joined #RubyOnRails
[15:22:36] universa1: walidvb: my setup is the following: nginx proxying to the apps and serving static files, "vhosts" symlinked from a deploy directory from the app, bluepill for running the app processes (i have it run at user level, so no root access needed), and whenever to have bluepill be started on reboot
[15:22:40] walidvb: no no i don't care at all, i've just seen it's popular, so was curious as to why not
[15:22:41] drale2k: has joined #RubyOnRails
[15:22:48] DaniG2k: hello all, does anyone know why I'm getting a LoadError when trying to load a gem with a rake task within a Rails app?
[15:22:54] DaniG2k: here's my code: https://gist.github.com/DaniG2k/4cb4611a8a4b205319e2
[15:23:09] Lightsword: has joined #RubyOnRails
[15:23:31] gambl0re: has joined #RubyOnRails
[15:23:59] universa1: walidvb: and then i've git-deploy setup, so a simple git push restarts unicorn / puma :-)
[15:24:04] walidvb: universa1: so bluepill is managing the app process, kind of?
[15:24:14] lurch_: has joined #RubyOnRails
[15:24:17] walidvb: universa1: git-deploy does sound quite convenient
[15:24:31] walidvb: hm damn, i really don't know much about nginx and so on
[15:24:59] exadeci: has joined #RubyOnRails
[15:25:03] mikecmpbll: DaniG2k: cus it can't load lib/tasks/inverted_index.rake by the looks of it.
[15:25:10] universa1: walidvb: yes
[15:25:16] zeeraw: has joined #RubyOnRails
[15:26:13] mikecmpbll: DaniG2k: what's the absolute path for 'lib/tasks/inverted_index.rake'?
[15:26:13] sinkensabe: has joined #RubyOnRails
[15:26:34] smathy: DaniG2k, no `do` after namespace :db
[15:26:37] walidvb: universa1: so you assets:precompile, nginx serves that
[15:27:55] walidvb: bluepill run the processes, nginx routes requests to port 3000, and vhosts symlink is for..?
[15:28:07] DaniG2k: mikecmpbll: rankrb/lib/tasks/inverted_index.rake
[15:28:19] smathy: DaniG2k, ^
[15:28:21] DaniG2k: smathy: added 'do' after :db but made no difference
[15:28:26] universa1: walidvb: nginx config.
[15:28:27] mikecmpbll: yeah, that won't fix a load error
[15:28:28] DaniG2k: namespace :db do
[15:28:35] mikecmpbll: but good spot nonetheless
[15:28:44] DaniG2k: thanks for that
[15:28:49] mikecmpbll: uhm, rankrb/ isn't in your load path then?
[15:29:16] walidvb: universa1: thx, let me wrap my head around this, hopefully i can make sense out of it
[15:29:20] DaniG2k: updated https://gist.github.com/DaniG2k/4cb4611a8a4b205319e2
[15:29:39] smathy: Oh right. Rails.root.join the path.
[15:29:41] shock_one: has joined #RubyOnRails
[15:29:43] mikecmpbll: DaniG2k: use the full path
[15:30:04] sofy_arg: has joined #RubyOnRails
[15:30:09] christiandsg: has joined #RubyOnRails
[15:30:26] DaniG2k: mikecmpbll: I've added the gem to my dummy Rails app and have `require 'rankrb'` in the dummy app's model
[15:30:42] mikecmpbll: that'll load your lib/rankrb.rb
[15:31:34] DaniG2k: is there a clever way to load it
[15:31:46] DaniG2k: File.expand_path('../lib', __FILE__) or something
[15:32:26] ararog: has joined #RubyOnRails
[15:33:00] walidvb: universa1: mikecmpbll thanks!
[15:33:44] mikecmpbll: DaniG2k: where's the railtie.rb located?
[15:34:02] strcmp1: has joined #RubyOnRails
[15:34:04] ArchRogem: has joined #RubyOnRails
[15:34:17] DaniG2k: mikecmpbll: rankrb/lib/rankrb/railtie.rb
[15:34:36] kh0d: has joined #RubyOnRails
[15:35:03] naftilos76: has joined #RubyOnRails
[15:35:28] DaniG2k: mikecmpbll: I gotta go now >_< thanks for the help! I'll be back later
[15:35:36] mikecmpbll: just take the lib off
[15:35:40] mikecmpbll: that should work ..
[15:35:49] mikecmpbll: load 'tasks/inverted_index.rake'
[15:36:03] DaniG2k: I'll try :D
[15:36:08] mikecmpbll: the lib/ goes on your $LOAD_PATH not the root
[15:36:40] Trynemjoel: has joined #RubyOnRails
[15:36:53] mikecmpbll: unless i'm suffering from friday fever.
[15:36:55] helpa: http://youtu.be/kfVsfOSbJY0
[15:37:23] blackmesa: has joined #RubyOnRails
[15:38:37] dangerousdave: has joined #RubyOnRails
[15:39:53] pixelhandler: has joined #RubyOnRails
[15:42:27] towski_: has joined #RubyOnRails
[15:42:55] Papierkorb: This channel is a magical place at times.
[15:43:16] shock_one: has joined #RubyOnRails
[15:44:11] Trynemjoel: has joined #RubyOnRails
[15:45:02] chintanparikh: In a polymorphic association, should the *_type column be capitalized or not?
[15:46:19] Papierkorb: chintanparikh: do you mean the column name or its value?
[15:46:39] theery: has joined #RubyOnRails
[15:46:48] universa1: chintanparikh: the value will be automatically populated by rails
[15:46:54] chintanparikh: So if I have followable_type, should the value be 'Collection' or 'collection'
[15:46:58] universa1: chintanparikh: and it is capitalized.
[15:47:03] chintanparikh: universa1: Awesome, thanks
[15:47:12] chintanparikh: Just generating some manually for testing
[15:47:50] universa1: chintanparikh: belongs_to :followable, polymorphic: true; whatever.followable = Collection.first; this will populate both the _id and the _type columen
[15:48:03] chintanparikh: universa1: Got it, thanks!
[15:49:05] gambl0re: has joined #RubyOnRails
[15:50:37] EminenceHC: has joined #RubyOnRails
[15:51:23] mikecmpbll: constantized? i guess
[15:54:03] zuQe8: has joined #RubyOnRails
[15:56:13] michaeldeol: has joined #RubyOnRails
[15:58:04] chintanparikh: Another question, slightly more complex. My polymorphic association is actually on a join table and I'm trying to generate user.followed_collections, user.followed_users, collection.followers. Here's the relevant code: https://gist.github.com/chintanparikh/21b130e2b43d23718c9e
[15:59:12] chintanparikh: I could just create manual methods on the models but I'm wondering if there's a Rails way to do it
[16:00:19] SteenJobs: has joined #RubyOnRails
[16:01:29] shock_one: has joined #RubyOnRails
[16:02:32] tubbo: chintanparikh: i think you can do has_many :follows, as: :followable
[16:02:45] tubbo: or wait never mind
[16:02:47] tubbo: sorry i got confused
[16:03:13] polpak: has joined #RubyOnRails
[16:03:29] NodeNagant: has joined #RubyOnRails
[16:04:07] tubbo: chintanparikh: you need another has_many there
[16:04:21] chintanparikh: tubbo: For user or for collection?
[16:04:48] tubbo: chintanparikh: for User, because theoretically you can follow a User or a Collection, right?
[16:04:49] chintanparikh: Got the collection working
[16:05:05] tubbo: has_many :follows is not going to return the Follow records for which the User is followed
[16:05:17] tubbo: you'd probably need has_many :followings, as: :followable for that to work
[16:05:28] tubbo: has_many :followings, as: :followable, class_name: 'Follow'
[16:05:38] tubbo: for the same reason that you need to specify 'as:' in your other model
[16:06:52] chintanparikh: Got it, here's what I ended up doing: has_many :followers, through: :follows, source: 'followable', source_type: 'User'
[16:07:24] tubbo: oh cool :)
[16:07:59] zpe: has joined #RubyOnRails
[16:08:24] urlgrey: has joined #RubyOnRails
[16:08:39] RegulationD: has joined #RubyOnRails
[16:11:16] chouhoulis: has joined #RubyOnRails
[16:11:47] qejk: has joined #RubyOnRails
[16:11:51] shock_one: has joined #RubyOnRails
[16:12:10] zeeraw: has joined #RubyOnRails
[16:12:53] zendrix: has joined #RubyOnRails
[16:13:24] annlewis: has joined #RubyOnRails
[16:15:40] chouhoul_: has joined #RubyOnRails
[16:15:53] zeeraw: has joined #RubyOnRails
[16:16:05] JDeen: has joined #RubyOnRails
[16:17:43] Casty: has joined #RubyOnRails
[16:18:04] shock_one: has joined #RubyOnRails
[16:18:53] nalley: has joined #RubyOnRails
[16:23:12] flujan: has joined #RubyOnRails
[16:23:24] flujan: hello guys, how can I confirme my app is using turbolinks.
[16:24:20] theery: has joined #RubyOnRails
[16:26:23] zeeraw: has joined #RubyOnRails
[16:27:11] kham: has joined #RubyOnRails
[16:27:13] Papierkorb: flujan: There's a global "Turbolinks" object in JS (Check in the console.) enable progress bars and see if one shows up: Turbolinks.ProgessBar.enable(); // or do $(document).on('page:change', function(){ console.log("It works!"); });
[16:27:54] Papierkorb: Crude, but effective. Oh, and your application.html.erb (or .haml or w/e you use) mentions Turbolinks too
[16:28:08] Urban_MYT: has joined #RubyOnRails
[16:28:40] SteenJobs: has joined #RubyOnRails
[16:32:26] k4nd4lf: has joined #RubyOnRails
[16:32:57] Lightsword: has joined #RubyOnRails
[16:34:53] zorak8: has joined #RubyOnRails
[16:35:04] naftilos76: has joined #RubyOnRails
[16:35:42] kh0d: has joined #RubyOnRails
[16:36:33] rakm: has joined #RubyOnRails
[16:38:12] Rubie: has joined #RubyOnRails
[16:38:50] shock_one: has joined #RubyOnRails
[16:40:26] bricker: has joined #RubyOnRails
[16:40:46] Scriptonaut: When I fragment cache a model, will changes to taht association warm the cache?
[16:40:55] Scriptonaut: to one of its associations**
[16:41:08] asheinfeld: has joined #RubyOnRails
[16:41:17] Scriptonaut: I have a: cache marketer do. However it's not updating when I update it's association marketer.manager
[16:41:24] kh0d: has joined #RubyOnRails
[16:41:48] Hates_: Scriptonaut: have you added touch :true to your association?
[16:41:59] christiandsg: has joined #RubyOnRails
[16:41:59] Scriptonaut: let me check, thanks
[16:42:25] Hates_: Scriptonaut: it has to be on the manager side
[16:43:01] Scriptonaut: Hrm, in my marketer, I have: belongs_to :marketer_manager
[16:43:30] Lytol: has joined #RubyOnRails
[16:43:36] Hates_: Scriptonaut: that doesn't sound right
[16:43:41] Scriptonaut: so do I do: has_many :marketers, touch: true. Or belongs_to marketer_manager, touch: true
[16:44:00] Scriptonaut: the marketers belong to a marketer_manager
[16:44:09] Scriptonaut: when I update a marketer, I want to update the manager as well
[16:44:28] Hates_: Scriptonaut: yeah, so add the touch onto the belongs_to
[16:44:34] Pazician: has joined #RubyOnRails
[16:44:47] Scriptonaut: Thanks Hates_
[16:44:57] Hates_: Scriptonaut: that will update the marketer's updated_at when a manager is updated
[16:45:07] zeeraw: has joined #RubyOnRails
[16:45:20] Scriptonaut: what if I want to go the other way
[16:45:26] Scriptonaut: update manager when marketer is updated
[16:46:13] chinmay_dd: has joined #RubyOnRails
[16:46:15] erich: has joined #RubyOnRails
[16:46:36] diegoviola: has joined #RubyOnRails
[16:46:39] shock_one: has joined #RubyOnRails
[16:46:53] paulf__: has joined #RubyOnRails
[16:47:16] giowong: has joined #RubyOnRails
[16:47:58] Hates_: Scriptonaut: not entirely sure what the best way is for that, not something I've had to do
[16:48:45] manfrin: has joined #RubyOnRails
[16:48:51] giowong: anyone know a solution to searching integer types when using ransack gem?
[16:49:50] Hates_: giowong: what do you mean? searching for ints should work just like anything else
[16:50:31] SuMo_D: has joined #RubyOnRails
[16:50:46] giowong: https://gist.github.com/gwong89/86176661819bbe264983
[16:50:51] giowong: according to this error
[16:51:04] giowong: postgres is expecting a string but im passing a integer
[16:51:34] Hates_: giowong: what matcher are you using?
[16:51:36] naftilos76: has joined #RubyOnRails
[16:52:00] busterarm: has joined #RubyOnRails
[16:52:01] Hates_: giowong: you probably want eq for ints
[16:52:08] giowong: sorry what is a matcher
[16:52:21] giowong: i was just following the railscast video and did what ryan bates did
[16:52:24] Hates_: giowong: what is your current ransack code?
[16:53:04] Hates_: giowong: I'm guessing you want something like VidgenieJobs.ransack(vidgenie_video_id_eq: 0).result
[16:54:08] giowong: https://gist.github.com/gwong89/86176661819bbe264983
[16:54:59] Hates_: giowong: change vidgenie_video_id_cont on line 3 to vidgenie_video_id_eq
[16:55:13] kies^: has joined #RubyOnRails
[16:55:36] Hates_: giowong: but that will only match exact ids
[16:56:07] giowong: ok that works
[16:56:14] giowong: so eq only works on integer typeS?
[16:56:22] giowong: i mean integer search only work on eq?
[16:58:00] Hates_: giowong: as far as I know, without casting the columns
[16:58:16] giowong: is there a way to merge all the search fields into one?
[16:58:22] giowong: like the rails admin way
[16:58:29] giowong: like a super searcher
[16:58:39] joelataylor: has joined #RubyOnRails
[16:58:40] rakm: has joined #RubyOnRails
[16:58:53] Hates_: giowong: you want to search multiple columns?
[16:58:55] inoter: has joined #RubyOnRails
[17:00:07] Hates_: giowong: you can do or queries
[17:00:35] Hates_: giowong: the second example here shows how https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching
[17:01:00] artto: has joined #RubyOnRails
[17:02:23] chills42: has joined #RubyOnRails
[17:02:57] giowong: is it possible
[17:02:59] giowong: ot do like
[17:03:24] giowong: id_or_vidgenie_id_eq_or_name_cont?
[17:03:55] giowong: so regardlesss what i put in it will search all the field regarding the model?
[17:05:19] TomasAchmedovas: has joined #RubyOnRails
[17:05:43] paulcsmith: has joined #RubyOnRails
[17:07:05] mikecmpbll: has joined #RubyOnRails
[17:07:35] ktchup: has joined #RubyOnRails
[17:07:38] flujan: has joined #RubyOnRails
[17:07:39] paulcsmith: has joined #RubyOnRails
[17:07:53] flujan: Papierkorb: thanks will give it a try.
[17:07:59] ktchup: Hey guys, anyone have experience using React to upload an image?
[17:09:27] michael_mbp: hey Hates_ o/
[17:09:29] ktchup: I can't save an object, it's wrapped inside weird <# ... > notation
[17:09:45] michael_mbp: have you toyed much with ActiveMail and the sendmail config?
[17:09:53] flujan: Papierkorb: I am using rails 4.2
[17:10:14] michael_mbp: *ActionMailer
[17:11:13] Hates_: michael_mbp: sorry, I haven't :(
[17:11:14] RegulationD: has joined #RubyOnRails
[17:11:49] gentle_giant: has joined #RubyOnRails
[17:11:50] SteenJobs: has joined #RubyOnRails
[17:11:54] Papierkorb: flujan: rails 4.2 (at least, maybe earlier too) uses Turbolinks by default, if you created your app with that rails version
[17:12:33] Hates_: michael_mbp: I've only done basic smtp configs
[17:12:47] Hates_: ktchup: not sure what you mean. that's just the output of a object
[17:12:48] tuelz: has joined #RubyOnRails
[17:12:55] michael_mbp: sendmail_settings = location: '/usr/sbin/sendmail' right?
[17:13:05] Hates_: ktchup: you're problem is probably unrelated to that notation
[17:13:31] Hates_: michael_mbp: oh, I've never actually plugged into local sendmail. sorry
[17:13:33] ktchup: Yea, I just figured I got an object, it's called ActionDispatch:$Http::UploadedFile and I'm trying to get a picture from it.
[17:13:38] michael_mbp: so I'm trying to run sendmail in a separate docker container, so any linked containers would not have /usr/sbin/sendmail in the FS.
[17:13:44] michael_mbp: Hates_: no prob.
[17:14:09] annlewis: has joined #RubyOnRails
[17:14:13] michael_mbp: seems others have tried to contect to the local sendmail via host/port localhost/25. It might need some configuring.
[17:14:19] michael_mbp: I'll hack on that tomorrow.
[17:14:38] Hates_: michael_mbp: yeah, I've only dont it through localhost
[17:14:53] djbkd: has joined #RubyOnRails
[17:14:54] flujan: Papierkorb: TypeError: undefined is not an object (evaluating 'Turbolinks.ProgessBar.enable')
[17:15:07] dangerousdave: has joined #RubyOnRails
[17:15:18] Papierkorb: flujan: just try "Turbolinks"
[17:15:25] Papierkorb: if it's not there, then you're not using Turbolinks
[17:15:39] flujan: Papierkorb: yes, Turbolinks is here. :) Thanks.
[17:15:57] tubbo: isn't ProgressBar a "next turbolinks" thing?
[17:16:00] Papierkorb: flujan: you can also check the made HTTP requests to see if they're XHR requests
[17:16:15] Papierkorb: tubbo: nope, have been using progressbars without issues
[17:16:27] tubbo: i just started using turbolinks again playing with master brnach
[17:16:45] tubbo: i really like the unity between the controller and the front-end, in my controller i can tell my front-end which element to update.
[17:17:29] Papierkorb: I'm not sure yet if the controller is actually the place to tell that to the front-end
[17:19:56] tubbo: Papierkorb: well be that as it may, you have to admit that it follows "the rails way" quite succinctly. the client is dumb and thin, the server tells the client what to do, the client tells the browser how to look
[17:20:30] tubbo: one win from that approach is it keeps client-side code to a minimum, and allows caching to the maximum.
[17:20:32] sofy_arg: how can i do something like this @conversation.where(recipient_id: current_user).messages.where(read: false).update_all(read: true)
[17:21:05] tubbo: sofy_arg: what happens when you do that?
[17:21:34] Papierkorb: tubbo: sure it does, I do think it's cool too. But since using Opal, I don't mind writing client-side code heh
[17:21:36] sofy_arg: tubbo: undefined method `where' for #<Conversation:0x10799158>
[17:21:36] naftilos76: has joined #RubyOnRails
[17:21:53] zeeraw: has joined #RubyOnRails
[17:22:11] tubbo: Papierkorb: well, it's not really about that. it's more about how client-side code can be damaging to your user experience (e.g., it's slow) if you don't do it right
[17:22:27] bronson: has joined #RubyOnRails
[17:22:39] giowong: https://gist.github.com/gwong89/86176661819bbe264983
[17:22:43] tubbo: sofy_arg: oh you're trying to base stuff off of @conversation
[17:22:49] tubbo: sofy_arg: you want Conversation
[17:23:00] tubbo: sofy_arg: because @conversation is an instance, Conversation is the class...and where is a class method.
[17:23:04] kumavis_: has joined #RubyOnRails
[17:23:16] giowong: can someone help me how do i imeplement the search field for my relation :vidgenie_video => :property
[17:23:47] Hates_: giowong: I thought I already said you can't use cont on an integer?
[17:24:11] giowong: no this is a different question
[17:24:25] giowong: u already helped me solve that problem :)
[17:24:31] Hates_: giowong: ahhh
[17:24:35] sofy_arg: tubbo: but the how would it be in this case http://pastie.org/10310178
[17:24:44] Papierkorb: tubbo: I fear more that the user experience is bad because of full page replaces. I'm currently building some social service thing, and the target audience is notorious for having bad mobile internet connection. This means on the one hand that I send quite a large .js file to the client at start, which is not awesome in its own right, but also means that subsequent accesses are quiet fast when I can even render things on the client (Shared haml
[17:25:03] giowong: basically i want to do search_field :property.some_attribute but its complaining
[17:25:17] tubbo: sofy_arg: the way you have it doesn't make any sense. you're trying to call a query method on a model object, you already have the model so you can't really do that.
[17:25:17] giowong: but since property is loaded through vidgenie_video how do i access it?
[17:25:18] smathy: Hates_, you weren't expecting some sort of gratitude or even acknowledgement were you?
[17:25:25] tubbo: sofy_arg: what exactly are you trying to do here?
[17:25:29] Hates_: smathy: never :P
[17:25:45] michael_mbp: Scient: http://mwdesilva.com/posts/autoglym-product-reviews-now-get-replies
[17:26:07] Papierkorb: tubbo: though, I just dropped Turbolinks on my end. Before it the service was much much smaller, and yes, that's where Turbolinks shines brightly. Loved it.
[17:26:11] sofy_arg: tubbo: i want to update all unread messages for the recipient when the conv is opened
[17:26:42] zpe: has joined #RubyOnRails
[17:26:44] tubbo: Papierkorb: well it kinda depends...if you have good http caching set up that doesn't matter quite as much
[17:26:58] cnk: has joined #RubyOnRails
[17:27:02] allcentury: has joined #RubyOnRails
[17:27:21] tubbo: sofy_arg: so that query for `recipient_id: current_user` is really looking for messages where the recipient is the current user, right?
[17:27:33] tubbo: if that's true, why is it trying to find that from Conversation?
[17:28:21] sofy_arg: tubbo: well no.. that was a mistake. I really dont know how to achieve that
[17:28:47] tubbo: sofy_arg: have you tried tacking that query onto the messages.where() call? i think that might solve your problem
[17:28:53] zorak8: has joined #RubyOnRails
[17:29:05] sofy_arg: tubbo: can you show me
[17:29:05] Hates_: giowong: you should just be able to do something like property_some_attribute_eq
[17:29:08] amon777: has joined #RubyOnRails
[17:29:27] theery_: has joined #RubyOnRails
[17:29:29] tubbo: sofy_arg: you really want all messages in the @conversation where the recipient is current_user and read: false
[17:29:38] tubbo: sofy_arg: if i understand what you're doing
[17:29:40] barce: has joined #RubyOnRails
[17:29:41] tubbo: which i probably don't
[17:29:54] annlewis: has joined #RubyOnRails
[17:30:03] sofy_arg: tubbo: yes.. and update them all to true
[17:30:18] smathy: ...and if recipient is meant to be current_user then you shouldn't ever be using (ie. trusting) params[:recipient_id]
[17:30:22] sofy_arg: sofy_arg: obviosly if the conv exists
[17:30:34] amon777: I would like to ask, 1) if is required to put "rescue nil" at the end of a variable value assignment and 2) if the same variable is assigned two times the same value at the same controller file, and the 2nd assignment has rescue nil, could this create issues at the app ?
[17:30:51] giowong: rails is complaining undefined method
[17:30:52] tubbo: sofy_arg: seems like you're off to a great start
[17:31:26] smathy: amon777, no it's not required, and no having it won't create issues in the app.
[17:31:41] amon777: smathy: thank you
[17:32:10] amon777: smathy: actually what is the purpose of "rescue nil"..i didn't understand the reason that it exist there (i am trying to correct another's app)
[17:32:14] Hates_: giowong: show your code
[17:32:31] Hates_: giowong: I don't know what attibutes are on property so I can't help that much
[17:32:46] Hates_: giowong: ahhh full street address
[17:32:47] DEA7TH: has joined #RubyOnRails
[17:32:50] tubbo: amon777: if an exception of any kind exists on that line, the expression will just return nil rather than throw the error
[17:33:03] tubbo: amon777: so that's probably eating an error of some kind
[17:33:25] giowong: https://gist.github.com/gwong89/86176661819bbe264983
[17:33:36] giowong: actually any property attribute doesnt work..
[17:33:39] Hates_: giowong: have you tried VidgenieJob.search(property_full_free_address_matches: "test")
[17:33:56] Hates_: giowong: oh it's on a video
[17:34:09] giowong: and video doesnt work either??
[17:34:25] Hates_: giowong: maybe VidgenieJob.search(vidgenie_video_property_full_free_address_matches: "test") ? :S
[17:34:26] giowong: its weird because ransack says i cna just call the model and attribute typeon it since its included
[17:35:08] ktchup: Anyone here who knows how to save an image to Carrierwave?
[17:37:18] ktchup: I have a form trying to send a picture to be stored, but what my controller gets is a ActionDispatch:$Http::UploadedFile, and it won't be saved to the model.
[17:37:24] christiandsg: has joined #RubyOnRails
[17:37:49] nobitanobi: has joined #RubyOnRails
[17:38:37] Hates_: ktchup: have you tried assigning the uploaded file to your models carrier wave attribute?
[17:38:54] giowong: => Ransack::Search<class: VidgenieJob, base: Grouping <combinator: and>>
[17:38:58] giowong: what does this mean?
[17:39:16] hobodave: has joined #RubyOnRails
[17:39:27] Hates_: giowong: that's just the ransack object
[17:39:41] giowong: so was it a successful search??
[17:40:12] Hates_: giowong: no, I don't think it will run your search until you call .result
[17:40:50] nobitanobi: Is there any reason why in Rails 4.1.8, when trying to do session.id from an AJAX call I get nil?
[17:41:01] ktchup: Hates_: yup, I instantiate the model straight from the params.
[17:41:56] benlieb: has joined #RubyOnRails
[17:41:58] giowong: ok hates it worked in rails console
[17:42:07] giowong: but in the html.erb it doesnt like it??? im so confused
[17:43:17] Hates_: sorry, going AFK
[17:43:59] erich: has joined #RubyOnRails
[17:44:46] bronson: has joined #RubyOnRails
[17:46:48] amon777: Processing by PagesController#show as HTML
[17:46:48] amon777: Parameters: {"pages"=>"undefined"}
[17:46:48] amon777: Completed 500 Internal Server Error in 3ms
[17:47:01] amon777: any idea about what should cause that issue? I am looking into pages controller
[17:47:09] theery: has joined #RubyOnRails
[17:47:31] Mago_joao: has joined #RubyOnRails
[17:47:58] Mago_joao: I need Help in my project = http://stackoverflow.com/questions/31565554/ror-nested-form-hidden-field-value/31592999?noredirect=1#comment51170561_31592999
[17:48:01] asheinfeld: has joined #RubyOnRails
[17:48:22] vickleton: has joined #RubyOnRails
[17:48:51] flujan: has joined #RubyOnRails
[17:48:52] gusrub: has joined #RubyOnRails
[17:49:00] Rubie: has joined #RubyOnRails
[17:49:42] tubbo: Mago_joao: what is that Tsk1, Tsk2, Tsk3 stuff?
[17:49:49] tubbo: what led you to that?
[17:50:05] Mago_joao: Tubbo thanks
[17:50:18] Mago_joao: my project is about projects and tasks
[17:50:46] Mago_joao: There are a Task Controller where it record an projectID
[17:51:22] Mago_joao: and there are one tsk1 which stores TASK ID, and tsk2 should store tsk1 ID and tsk3 record TSK2 id
[17:51:31] Mago_joao: is a tree like model
[17:51:37] Mago_joao: a project hasmany tasks
[17:51:55] amon777: any advice for my error? thank you..
[17:51:57] tubbo: Mago_joao: sure, but why can't they just all be Task records? what's the point in separating? and furthermore, why can a task only have 3 levels of subtasks?
[17:51:58] Mago_joao: and a task can have a child and a child-child and child-child-child
[17:52:09] Mago_joao: tubbo they can be
[17:52:16] tubbo: Mago_joao: but they aren't
[17:52:18] smathy: amon777, !code
[17:52:18] helpa: amon777: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[17:52:20] Mago_joao: but i didn't know how to put this in a way
[17:52:21] pipework: Mago_joao: I'd just use a single Task class and put all the relations in that.
[17:52:26] tubbo: Mago_joao: ^
[17:52:31] Mago_joao: where i can add how many tasks i need
[17:52:46] tubbo: Mago_joao: check out awesome_nested_set (you might even just be able to use it) for a good way of implementing this.
[17:52:46] Mago_joao: in a single form
[17:52:59] amon777: helpa: https://gist.github.com/glouk7/42940137b054951a12dd
[17:53:00] tubbo: basically it just adds a couple columns to your model which show the position of the record in your tree
[17:53:17] pipework: Mago_joao: Nested model forms.
[17:53:18] Mago_joao: im using nested form gem
[17:53:19] smathy: amon777, include the error w/ exception backtrace please.
[17:53:34] smathy: amon777, !gist-usage in case you don't know
[17:53:34] helpa: amon777: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[17:53:45] amon777: !gist-usage
[17:53:45] tubbo: Mago_joao: cool story ;) but awesome_nested_set is totally different. it's another gem.
[17:54:33] smathy: amon777, no man, those are bot commands, helpa is a bot, you read the information at the link it sent you.
[17:54:40] smathy: amon777, also, add the view that generated the link for that request.
[17:54:45] blackmesa: has joined #RubyOnRails
[17:55:20] SteenJobs: has joined #RubyOnRails
[17:56:10] Mago_joao: can you help me set up this? if not asking too much
[17:56:24] pipework: Mago_joao: !gem awesome_nested_set
[17:56:26] Mago_joao: i'm really not very familiar with rails, only 1 month
[17:56:32] pipework: Aww no !gem
[17:56:50] tubbo: pipework: what do you have helpa on /ignore or something?
[17:57:11] tubbo: Mago_joao: well awesome_nested_set is very easy to integrate into your app, IMHO. i think it would be a great way for you to get to learn more about rails.
[17:57:17] jsrn_: has joined #RubyOnRails
[17:57:27] tubbo: pipework: the !gem command exists.. :D
[17:57:54] pipework: tubbo: I know that! helpa just didn't respond to me. :(
[17:57:54] chinmay_dd: has left #RubyOnRails: ("See ya!")
[17:58:27] flujan: has joined #RubyOnRails
[17:58:34] tubbo: helpa | Mago_joao: http://www.rubygems.org/gems/awesome_nested_set
[17:58:36] tubbo: pipework: ^
[17:58:47] tubbo: u missed out br0
[17:58:54] pipework: tubbo: I must have blinked.
[17:59:20] Mago_joao: i had it installed
[17:59:41] Mago_joao: im looking for tutorial
[18:00:47] amon777: smathy: is it ok now? I've included views, controller and log error https://gist.github.com/glouk7/42940137b054951a12dd
[18:00:49] jottr: has joined #RubyOnRails
[18:01:07] tubbo: Mago_joao: the README is pretty good.. https://github.com/collectiveidea/awesome_nested_set
[18:01:14] asheinfeld: has joined #RubyOnRails
[18:01:43] zendrix: has joined #RubyOnRails
[18:02:06] Glyphik: has joined #RubyOnRails
[18:02:32] Mago_joao: but im afraid that is not enuff to make me understand how to implement this on my project, ill try it out, thanks, if i got stuck ill be requesting help soon
[18:02:45] smathy: amon777, ok, so see in your log where it says: Started GET "/undefined" ... ?
[18:03:17] amon777: smathy: yes
[18:03:34] amon777: smathy: i see that
[18:03:36] smathy: amon777, that means that the code that generated the link that you clicked on is using a value that you're not expecting.
[18:03:55] hobodave: has joined #RubyOnRails
[18:04:00] smathy: amon777, so, which link are you clicking on? (which line in the show.html.erb file?)
[18:05:08] tubbo: Mago_joao: as a rails developer, this will not be the first time you need to integrate something into your project where there's no easy tutorial or screencast to get you by. you'll need to learn how to look up the info you need and sometimes read the source to figure out how to make it work.
[18:05:32] amon777: smathy: i think that we can't know that, because we are talking a live website, so i don't know who clicked where...i am trying to determine the error as the application stopped responding
[18:05:49] amon777: smathy: the strange thing, is after some minutes, usually, starts working again (without action)
[18:05:49] asheinfe_: has joined #RubyOnRails
[18:06:44] amon777_: has joined #RubyOnRails
[18:06:46] d5sx43: has joined #RubyOnRails
[18:07:28] smathy: amon777_, that's not strange, a 500 doesn't kill the app, just the response.
[18:07:54] smathy: amon777_, so are you telling me that you can't reproduce this error in your local development environment?
[18:08:29] doodlehaus: has joined #RubyOnRails
[18:08:37] pkrueger: has joined #RubyOnRails
[18:08:53] amon777: has joined #RubyOnRails
[18:09:13] amon777: smathy: sorry disconnected
[18:09:29] smathy: amon777, np. I said...
[18:09:40] smathy: amon777, that's not strange, a 500 doesn't kill the app, just the response.
[18:09:49] smathy: amon777, so are you telling me that you can't reproduce this error in your local development environment?
[18:10:52] paulcsmith: has joined #RubyOnRails
[18:10:59] amon777: has joined #RubyOnRails
[18:11:55] SteenJobs: has joined #RubyOnRails
[18:13:16] amon777: smathy: let me try, you believe that the error occured because something undefined clicked from show.html?
[18:14:03] amon777: smathy: can't reproduce in local env....it seems that it works fine (as it wsa working also in production, if it didn't do these random unresponsive situations)
[18:14:38] willywos: has joined #RubyOnRails
[18:15:06] dynomist: has joined #RubyOnRails
[18:16:19] dynomist: is there an easy way to convert a string to be an array such that the string becomes the first element of the array?
[18:16:38] amon777: NoMethodError in PagesController#show
[18:16:39] amon777: undefined method `title' for nil:NilClass
[18:16:40] amon777: smathy: hmm...local error found...
[18:16:40] dynomist: I would like something with the behavior of mystring.split("random string that is not included in the original") but without having to create a random string that doesn't exist
[18:17:05] amon777: smathy: app/controllers/pages_controller.rb:25:in `show'
[18:17:11] cnk: [string_here]
[18:17:31] kham: has joined #RubyOnRails
[18:17:31] dynomist: nice thanks cnk
[18:18:13] pkrueger: ACTION ** SysInfo ** Client: HexChat 2.10.2 (x64) ** OS: Microsoft Windows 7 Enterprise ** CPU: Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz (2.00 GHz) ** RAM: 16383 MB Total (12611 MB Free) ** VGA: ShoreTel Desktop Sharing Accelerator ** Uptime: 26.05 Hours **
[18:18:29] smathy: amon777, well `@page_title = @page.title` is a stupid line to start with, but that's not causing your problem.
[18:18:45] centrx: pkrueger, Congratulations
[18:18:53] amon777: smathy: true..
[18:18:53] d5sx43: has joined #RubyOnRails
[18:18:54] elia: has joined #RubyOnRails
[18:19:02] busterarm: has joined #RubyOnRails
[18:19:43] amon777: smathy: the /blogs that i see the error in local, use another controller. the posts_controller.rb (which has similar changes as pages_controller.rb)
[18:19:43] smathy: amon777, probably this is the problem link: https://gist.github.com/glouk7/42940137b054951a12dd#file-show-html-erb-L85
[18:19:59] amon777: smathy: but the error says pages_controller at /blogs
[18:21:10] amon777: smathy: hmm.. why do you believe that? it's a live i've never edited.
[18:21:40] cnk: What's a good name for a chunk of html that has the usual "signup + login" OR "your name + logout" links?
[18:21:51] smathy: amon777, no error you've shown in that gist mentions /blogs
[18:22:18] Mago_joao: tubbo i understand
[18:22:26] amon777: smathy: true...but i get that error in local environement in /blogs
[18:22:30] smathy: amon777, the error you have is caused because there was a link on your page of /undefined (ie. <a href="/undefined">some text</a>) that was clicked and your app has no idea how to handle that URL.
[18:22:38] amon777: smathy: which seems to be identical
[18:22:39] smathy: amon777, you have no idea which URL it is, so I'm guessing.
[18:22:49] smathy: amon777, my best guess is that Line 85 URL.
[18:22:51] Rubie: has joined #RubyOnRails
[18:22:53] Mago_joao: the thing that im concerned about is that i have little time to finish this project and ill be going to BI in the next one, only one rails project in my job >_<
[18:23:31] amon777: smathy: so if i try to enter a wrong url, in browser URL field... like www.myurl.com/randomlink shouldn't then get similar error?
[18:24:02] Mago_joao: but im enjoing the knowledge
[18:24:20] smathy: amon777, depends on your routes, but if you go to http://your.hostname/undefined then you will see it, yes.
[18:24:36] amon777: smathy: let me see...
[18:25:02] amon777: smathy: i get a 404 error page as expected
[18:27:17] amon777: smathy: i don't get the same error at my log
[18:27:19] DLSteve: has joined #RubyOnRails
[18:28:01] smathy: amon777, do you see the same Started GET "/undefined" ?
[18:28:26] amon777: smathy: yes
[18:28:34] amon777: smathy: but the error is 404 instead of 500
[18:29:07] smathy: amon777, then something has changed between now and then. Add your config/routes.rb to your gist.
[18:29:09] amon777: smathy: i am uploading now the pages controller, at the live website, that includes my code...to check if that makes the app unresposive
[18:29:44] smathy: amon777, oh wait, you're checking /undefined in your local machine or on the same server where the error was originally logged?
[18:30:16] amon777: smathy: now i've checked at the same server, not the local one
[18:31:18] amon777: smathy: i've added at the gist, the routes.rb
[18:32:16] Kedric: has joined #RubyOnRails
[18:32:35] robbyoconnor: has joined #RubyOnRails
[18:35:18] smathy: amon777, clean up your indentation please, it's a headache.
[18:37:41] amon777: smathy: just a sec mate
[18:37:52] Trynemjoel: has joined #RubyOnRails
[18:37:58] rakm: has joined #RubyOnRails
[18:39:59] amon777: smathy: with the pages_controller.rb at the live website, the mydomain.com/undefined gave a 500 error (instead of 404 that was without my code at pages_controller). The app is still responsive
[18:40:59] Mendenhall: has joined #RubyOnRails
[18:42:11] iamjarvo: has joined #RubyOnRails
[18:43:08] artto: has joined #RubyOnRails
[18:43:42] nickenchuggets: has joined #RubyOnRails
[18:44:51] kies^: has joined #RubyOnRails
[18:44:54] amon777: smathy: question... after i made the changes at the database with new fields, i didn't restart & reindex the beanstalk_worker...can this cause the issue?
[18:47:04] amon777: smathy: i've updated indentation in routes.rb
[18:48:00] amon777: smathy: Also, something silly....could a huge in size production.log file to make the app unresponsive for some reason ?
[18:48:38] fryguy: amon777: sure
[18:49:23] bricker: amon777: in an indirect way, sorta... the log can grow to fill up all the space on your drive and then you'd have problems
[18:49:35] giowong: so i have a custo method in my model called full_name that combines the first name and last name attributes
[18:49:51] amon777: bricker: no, there are 30GB space at our case...so the disk is not filled up...
[18:49:57] giowong: how come ransack can't identify this custom method?
[18:50:10] amon777: fryguy: you believe that i should empty the log ?
[18:50:16] ivanskie: has joined #RubyOnRails
[18:50:29] Mago_joao: Create a root node: science = Category.create!(:name => 'Science') this is a console line command or controller?
[18:50:52] badmadrad: has joined #RubyOnRails
[18:51:07] tubbo: Mago_joao: it's wherever you want it to be
[18:51:12] bricker: amon777: 30GB is a pretty small amount of space :) Hopefully you have logrotate managing your log files
[18:51:48] PhantomSpank: has joined #RubyOnRails
[18:52:15] Mago_joao: tubbo there are differences between them?
[18:53:12] tubbo: Mago_joao: !activerecord
[18:53:17] tubbo: Mago_joao: !active_record
[18:53:31] tubbo: Mago_joao: http://guides.rubyonrails.org/active_record_basics.html
[18:53:46] bricker: ACTION 100 brickercoins to tubbo for effort
[18:54:42] bricker: amon777: you should have logrotate manage the log files but a large logfile won't have any effect on app performance
[18:54:57] amon777: bricker: thank you
[18:55:18] marr: has joined #RubyOnRails
[18:55:27] fryguy: amon777: you should rotate the log
[18:55:38] safeforge: has joined #RubyOnRails
[18:55:41] smathy: amon777, the 500 is a different issue to the unresponsive site issue.
[18:56:01] amon777: fryguy: i am not sure what is to rotate to log...
[18:56:24] smathy: amon777, also, no, removing all indentation is not fixing the indentation.
[18:56:28] fryguy: amon777: http://www.rackspace.com/knowledge_center/article/understanding-logrotate-utility
[18:56:29] amon777: smathy: i am clicking here and here, trying to observe anything strange at the log...but nothing up to now
[18:56:42] dman777_alter: has joined #RubyOnRails
[18:56:56] smathy: amon777, you don't have to click, you just have to find the string "/undefined" in your HTML.
[18:56:56] jhack: has joined #RubyOnRails
[18:57:21] smathy: amon777, and then map that back to the link_to in the view that generated it.
[18:57:24] amon777: smathy: should it be founded to each page ?
[18:58:02] smathy: amon777, no, could be on any page.
[18:58:16] dman777_alter: hello, does anyone know how to make a json mock with factory girl? This is what I want to make as a mock data: {"datacenters": "TX", "WA", "MI", "foo"]} http://dpaste.com/1B3ZJTA
[18:58:30] smathy: amon777, if I was solving this, I'd start in my logs at the line showing the /undefined and then search UP for the IP address ("") to see which page they were on before that.
[18:58:49] smathy: What's with the 777s?
[18:58:50] cac: has joined #RubyOnRails
[18:59:15] Mago_joao: tubbo: are you saying then that in controller things will be recorded? and console is just momentum
[18:59:34] chills42: has joined #RubyOnRails
[18:59:58] amon777: smathy: i like your logic...but in a huge production log file, how should i find these lines? This was logged before 7-8 hours...now it must have thousand lines after it
[19:00:11] tubbo: Mago_joao: no, every time you call ActiveRecord::Base#create!, it will at least attempt to make a db query
[19:00:46] Mago_joao: if i set that my Task has task childs in console rails will always remember this?
[19:01:31] smathy: dman777_alter, .to_json
[19:01:49] tubbo: Mago_joao: i really have no idea what you're asking, but if you're asking whether executing that line of code always does the same thing, then yes. it always does the same thing.
[19:01:55] zendrix: has joined #RubyOnRails
[19:02:10] smathy: amon777, using less or grep
[19:02:24] amon777: smathy: i will try grep with the ip
[19:02:29] amon777: smathy: just a sec
[19:03:04] towski_: has joined #RubyOnRails
[19:03:51] mloy: rails is finally starting to click for me :D
[19:04:12] srinidhi: has joined #RubyOnRails
[19:04:13] raghu: has joined #RubyOnRails
[19:04:16] amon777: it's searching....waiting for the results
[19:04:24] Trynemjoel: has joined #RubyOnRails
[19:05:02] ivanskie_: has joined #RubyOnRails
[19:05:02] raghu: has left #RubyOnRails: ()
[19:05:26] smathy: amon777, FWIW, this is another reason it's good to rotate your logs - makes searching easier.
[19:05:36] Mago_joao: tubbo: those command line will go in the model?
[19:06:06] tubbo: Mago_joao: !try
[19:06:06] helpa: Mago_joao: Why don't you try it and find out for yourself?
[19:06:28] Mago_joao: please dude, dont be like this-_-'
[19:07:03] bin_005: has joined #RubyOnRails
[19:07:10] smathy: mloy, happy days.
[19:07:43] Mago_joao: somethings may be obvious for you, but not for a beginner like me
[19:07:52] christiandsg: has joined #RubyOnRails
[19:07:52] artto: has joined #RubyOnRails
[19:08:07] smathy: Mago_joao, so read the guide that you were linked to.
[19:08:31] amon777: smathy: true mate, but i am not experienced t such kind of development. If i can say, i am trying to save some supervisors by doing a job that i don't know...i am a php/mysql developer and i am trying alone to learn Ruby on Rails on a live app...
[19:09:10] amon777: smathy: by the way, it is still searching...i guess because of the huge log file it will take some time
[19:09:11] Mago_joao: im doing it, just asking things that i'm not sure about
[19:09:22] hobodave: has joined #RubyOnRails
[19:09:38] workmad3: has joined #RubyOnRails
[19:09:42] smathy: Mago_joao, we don't like just reciting the guides here in chat, it's a waste of our time, things get forgotten, real problems that need interactive help get lost, and actually the formatting and presentation of the guides is a better way for people to absorb the information.
[19:10:26] smathy: amon777, yes, probably.
[19:10:37] devdazed: has joined #RubyOnRails
[19:10:38] snophey: has joined #RubyOnRails
[19:10:57] smathy: Mago_joao, best idea is to create a new app so you can play and try out things from the guides as you go through.
[19:10:58] jonee: has joined #RubyOnRails
[19:11:31] Pazician: has joined #RubyOnRails
[19:11:38] natbo: has joined #RubyOnRails
[19:12:10] Mago_joao: i understand, but again, i have little time to do this, if i could afford an month or two for studying i'd do it. i know im bothering but im looking to key information to make a solution to my problem.
[19:12:12] tubbo: Mago_joao: it's a bot-command for a reason :) apologies if i was rude, didn't mean to be. but i found that one of the best ways to learn ruby is when you think something should work a certain way, try it out and see if it does! if not, then make a gist with the error/code and ask one of us. or on stackoverflow.
[19:13:43] snophey: has left #RubyOnRails: ()
[19:15:48] Mago_joao: tubbo: dont worry im thankful
[19:16:13] dman777_alter: http://dpaste.com/1BY5RHB I'm trying to test a controller that returns a json. I am having issue with making the mock json with factory girl. Can anyone help please :) ?
[19:18:49] kadoppe: has joined #RubyOnRails
[19:18:52] NodeNagant: has joined #RubyOnRails
[19:19:17] dman777_alter: undefined method `datacenters=' for []:Array
[19:19:23] n008f4g_: has joined #RubyOnRails
[19:19:45] tubbo: hey why do you have factory :datacenter, class: Array?
[19:19:49] tubbo: don't you want that to create a Datacenter?
[19:19:55] Trynemjoel: has joined #RubyOnRails
[19:20:07] Lightsword: has joined #RubyOnRails
[19:20:33] ivanskie: has joined #RubyOnRails
[19:21:45] mloy: If I'm writing a psql migration for a boolean matrix of variable rows and columns, is there a way to abstract away the db migration in one single migration rather than writing a different one for each specific matrix size?
[19:21:53] ktchup: has joined #RubyOnRails
[19:22:06] ascarter: has joined #RubyOnRails
[19:22:10] mloy: I spent far too long wording that and still not sure if I'm happy with how I did, so feel free to ask for clarification
[19:22:29] dman777_alter: tubbo: not sure...I have a real database with Datacenter as a collection
[19:22:53] tubbo: dman777_alter: well that factory is going to try and create an Array..
[19:23:00] tubbo: it's going to try to run Array.create which will blow up
[19:23:07] amon777: smathy: still searching...should i interrupt it and retry with another command? (i used tail with grep)
[19:23:30] smathy: amon777, what do you mean you used tail with grep?
[19:23:52] amon777: smathy: tail production.log -F | grep "the ip"
[19:24:20] smathy: ACTION doesn't know what to say
[19:24:28] asheinfeld: has joined #RubyOnRails
[19:25:10] smathy: amon777, `tail -F filename` shows the new entries added to the end of filename in real time.
[19:25:37] amon777: smathy: hm..i will retry
[19:25:56] arooni-mobile: has joined #RubyOnRails
[19:26:10] shinnya: has joined #RubyOnRails
[19:26:26] _2easy: has joined #RubyOnRails
[19:26:37] dman777_alter: tubbo: hmm...the json I have has a array in it... trying to make {"datacenters": ["TX", "WA", "MI", "foo"]}... what class: would that be?
[19:27:18] smathy: amon777, just use: grep production.log
[19:27:29] amon777: smathy: i've just done
[19:27:34] amon777: smathy: it found many entries
[19:27:37] amon777: smathy: let me check
[19:27:40] Pazician: has joined #RubyOnRails
[19:28:11] tubbo: dman777_alter: i'm confused as to what this whole thing is doing..
[19:28:39] smathy: Right, so find the one before the /undefined, could use: grep production.log | grep /undefined -B1
[19:28:41] tubbo: dman777_alter: if you already know what datacenters you need, why are you searching over them in an index action?
[19:28:43] jhack: has joined #RubyOnRails
[19:29:08] NodeNagant: has joined #RubyOnRails
[19:29:37] platosha: has joined #RubyOnRails
[19:30:46] NodeNagant: has joined #RubyOnRails
[19:30:54] amon777: smathy: very strange mate, all the entries are "Started GET "/undefined..." and it has one entry each 1 or 2 seconds (max) for about 40 mins (i guess that was also the downtime that we had in the morning)
[19:31:23] amon777: smathy: so there are hundred entries for 40 mins
[19:31:35] DoubleMalt: has joined #RubyOnRails
[19:31:54] asheinfeld: has joined #RubyOnRails
[19:32:20] iamse7en: has joined #RubyOnRails
[19:32:22] tubbo: dman777_alter: also, is your factory defined in spec/factories.rb?
[19:32:28] smathy: dman777_alter, why would you want to create a factory for class: Array ?
[19:33:11] smathy: amon777, ok, so that was an attack.
[19:34:11] amon777: smathy: so...what i did was actually remove the code from pages_controller and restart the app. But the trick that fixed the website, was the app restart..and not the code i've removed
[19:34:13] smathy: ...from some host in Amsterdam.
[19:34:33] smathy: amon777, probably.
[19:34:48] amon777: smathy: veeery strange, i will note our host provider
[19:34:54] amon777: about this information
[19:34:55] mistnim: has joined #RubyOnRails
[19:35:01] amon777: smathy: i am so thankful mate
[19:35:09] amon777: smathy: i really appreciate your patience with me
[19:35:11] amon777: smathy: thank you
[19:35:49] mistnim: hello, how does form_for knows if it has to create or update?
[19:36:17] Dbugger: has joined #RubyOnRails
[19:36:36] dman777_alter: tubbo: yes, it is defined in spec/factories/datacenter.rb. I'm new to testing in ruby..I figured this was the way to make mock json data.
[19:37:17] tubbo: dman777_alter: you could just pass get :index, format: :json, datacenters: %w(FOO BAR) and that will pass the params as json
[19:37:20] Dbugger: Hi guys. I have posted a question here about how to organize filters that work between different controllers (http://stackoverflow.com/questions/31616153/organizing-filters-in-a-rails-4-project/31616304#31616304). Do you guys mind sharing your opinion about it?
[19:37:31] dman777_alter: smathy: I was following http://stackoverflow.com/questions/10032760/how-to-define-an-array-hash-in-factory-girl
[19:37:33] Dbugger: I am not sure how to deal with this
[19:38:11] dman777_alter: tubbo: thanks...I will try that
[19:39:32] cnk: dbugger: I think the module answer is a good one
[19:40:08] cnk: most of my projects are simple enough that I put all those sorts of things in the ApplicationController. But if you don't like that, build a module and include
[19:41:12] lupine: modules don't really count :p
[19:41:32] yizr: has joined #RubyOnRails
[19:41:41] doodlehaus: has joined #RubyOnRails
[19:43:45] Hates_: mistnim: I assume it checks if the record is persisted or not
[19:44:32] Hates_: dbugger: I think concerns are a better way to handle it
[19:44:41] Hates_: dbugger: which are modules after all
[19:45:07] Hates_: dbugger: plus users_controller isn't how you would name your controller class
[19:46:13] s2013: has joined #RubyOnRails
[19:46:37] Hates_: dbugger: oh sorry, thought you wrote that answer
[19:48:29] jottr: has joined #RubyOnRails
[19:48:52] acti0nman: has joined #RubyOnRails
[19:49:23] crdpink: has joined #RubyOnRails
[19:49:34] johntrails: has joined #RubyOnRails
[19:49:43] DaniG2k: has joined #RubyOnRails
[19:50:06] romdi: has joined #RubyOnRails
[19:50:10] Rubie: has joined #RubyOnRails
[19:51:11] dman777_alter: tubbo: had alot of success with your suggestion....thanks! right now I am getting {"datacenters"=>[]} in the repsonse.body with datacenters: %w(FOO BAR)
[19:51:15] drale2k: has joined #RubyOnRails
[19:51:20] towski_: has joined #RubyOnRails
[19:51:28] s2013_: has joined #RubyOnRails
[19:51:31] NodeNagant: has joined #RubyOnRails
[19:51:46] dman777_alter: tubbo: I also tried datacenters: ["TX", "WA", "MI", "foo"] and still got {"datacenters"=>[]}
[19:52:45] NodeNagant: has joined #RubyOnRails
[19:52:53] DoubleMalt: has joined #RubyOnRails
[19:53:10] VeryBewitching: has joined #RubyOnRails
[19:53:26] elia: has joined #RubyOnRails
[19:55:08] Nuck: has joined #RubyOnRails
[19:55:36] kham: has joined #RubyOnRails
[19:55:51] safeforge: has joined #RubyOnRails
[19:56:07] rakm: has joined #RubyOnRails
[19:56:17] prettiestPony11: has joined #RubyOnRails
[19:56:59] prettiestPony11: hi trying to clone a record in the rails console and then update a relationship to point at a different record
[19:57:33] rromanchuk: has joined #RubyOnRails
[19:58:03] strcmp1: has joined #RubyOnRails
[19:58:34] prettiestPony11: has joined #RubyOnRails
[19:59:08] dman777_alter: for rspec, where can I get about the get method and the parameters?
[19:59:24] s2013: has joined #RubyOnRails
[19:59:26] dman777_alter: https://github.com/rspec/rspec-rails doesn't really give documentation on get
[19:59:48] s2013: hmm interesting.. i had <input name="filePhoto" value="" id="filePhoto" type="file" required/> in my rails form and bcause of that i couldnt submita form. no errors, nothing
[20:01:32] towski_: has joined #RubyOnRails
[20:02:04] erich: has joined #RubyOnRails
[20:05:25] dudoom: has joined #RubyOnRails
[20:06:09] krz: has joined #RubyOnRails
[20:07:48] hahuang65: has joined #RubyOnRails
[20:08:49] smathy: dman777_alter, but isn't your DataCenter a model?
[20:09:20] bhegel: has joined #RubyOnRails
[20:10:02] SteenJobs: has joined #RubyOnRails
[20:10:43] smathy: dbugger, the answer is correct, put it in a mixin.
[20:10:56] dman777_alter: smathy: yes... it a model
[20:11:10] Guest81563: has joined #RubyOnRails
[20:11:13] smathy: dman777_alter, well - you're telling FactoryGirl that it's not a model, but an Array.
[20:11:34] Guest81563: has left #RubyOnRails: ()
[20:11:51] smathy: dman777_alter, the attribute is an array right? The `DataCenter#datacenters` attribute?
[20:12:01] giowong: https://gist.github.com/gwong89/12524312476e35878d9a
[20:12:13] giowong: cna someone help me figure out why ransack is giving me this error??
[20:12:29] dman777_alter: smathy: {"datacenters": ["TX", "WA", "MI", "foo"]}
[20:12:52] smathy: dman777_alter, I don't know what you're trying to communicate there.
[20:13:09] s2013: hello beautiful railers
[20:13:15] user1138: has joined #RubyOnRails
[20:14:03] dman777_alter: smathy: this controller always sends back a json of a list of datacenters....I need to write a test for it. Right now, {"datacenters": ["TX", "WA", "MI", "foo"]} is always returned
[20:14:23] dman777_alter: I mean outside of the test...so I guess I need to test for {"datacenters": ["TX", "WA", "MI", "foo"]}
[20:14:56] blahwoop: has joined #RubyOnRails
[20:14:59] dman777_alter: like in the answer in http://stackoverflow.com/questions/8282116/rails-how-to-unit-test-a-json-controller
[20:15:40] blahwoop: hi all. is there an easy way to configure unicorn to be the default in my local env same as production?
[20:16:18] smathy: dman777_alter, !gist your controller and your spec and your factory.
[20:16:18] helpa: dman777_alter: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[20:16:34] kham: has joined #RubyOnRails
[20:16:34] dman777_alter: sure...one sec
[20:16:46] smathy: dman777_alter, !gist-usage re adding multiple files and ensuring syntax coloring pleae.
[20:16:46] helpa: dman777_alter: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[20:17:26] my_name_is_ohm: has joined #RubyOnRails
[20:17:28] Trynemjoel: has joined #RubyOnRails
[20:17:52] my_name_is_ohm: has left #RubyOnRails: ()
[20:19:28] smathy: blahwoop, include the gem in your Gemfile and run `unicorn`
[20:19:51] pixelhandler: has joined #RubyOnRails
[20:19:52] sofy_arg: im wondering why always my first post is not being prepended. Is this a js issue? http://pastie.org/10310371
[20:20:09] blahwoop: localhost:3000 didnt work though smathy
[20:20:17] bhegel_: has joined #RubyOnRails
[20:20:28] blahwoop: is there extra configuation ?
[20:21:29] yardenbar: has joined #RubyOnRails
[20:21:31] dman777_alter: smathy: https://gist.github.com/dman777/1c3c6175c703b6e46bc2 I've been changing the factory around along with spec trying to make it work.
[20:21:33] smathy: blahwoop, read the output when you run unicorn more closely.
[20:21:48] blahwoop: ah. it's at 8080
[20:22:27] nalley: has joined #RubyOnRails
[20:23:33] smathy: blahwoop, you're welcome :)
[20:24:05] Lytol: has joined #RubyOnRails
[20:26:46] smathy: sofy_arg, nope.
[20:27:27] alaing: has joined #RubyOnRails
[20:27:50] nickenchuggets: has joined #RubyOnRails
[20:28:04] smathy: sofy_arg, no, it's not a js issue.
[20:28:17] sofy_arg: smathy: what is related to
[20:29:11] smathy: dman777_alter, so, why are you trying to pass in a :datacenters parameter with your get :index?
[20:29:18] alaing: has joined #RubyOnRails
[20:29:26] alaing: hi is it possibly to pass a value to a partition using render?
[20:29:30] alaing: sorry if the terminology isn't right i'm fairly new to rails
[20:29:54] Casty: has joined #RubyOnRails
[20:29:59] ascarter: has joined #RubyOnRails
[20:30:06] alaing: basically I have two pages one public and one restricted
[20:30:22] alaing: but they use the same partial
[20:30:27] smathy: sofy_arg, something somewhere else in your app.
[20:30:47] alaing: but but need to render something slightly differently
[20:31:11] smathy: alaing, yes, you can find all the details here: http://guides.rubyonrails.org/layouts_and_rendering.html
[20:32:31] sofy_arg: smathy: but the post is being added if i reload the page. Also after the first post i can prepend posts succesfully.
[20:32:35] dman777_alter: smathy: well, I don't know...I can't find the documentation to the get used for parameters.
[20:33:14] Rubie: has joined #RubyOnRails
[20:33:44] smathy: sofy_arg, doesn't change my answer.
[20:34:03] dman777_alter: smathy: is factory girl actually supposed to query the database and get information? Or is my mock supposed to be hardcoded?
[20:34:04] smathy: dman777_alter, but why are you trying to pass ANY parameters to your index action?
[20:34:52] dman777_alter: smathy: I was following http://dpaste.com/0446S1P example I got from stackoverflow
[20:35:34] alaing: thank you smathy
[20:35:39] iamse7en: has joined #RubyOnRails
[20:35:49] smathy: dman777_alter, you're a bit lost aren't you?
[20:36:08] mfoo: has joined #RubyOnRails
[20:36:20] Mendenhall: has joined #RubyOnRails
[20:36:34] smathy: alaing, you're welcome.
[20:36:37] blahwoop: dman777_alter: doesn't query ur database. basically easilly creates fake data that u can use in ur specs
[20:36:39] dman777_alter: smathy: ya...I am totally new to rails testing.
[20:37:00] smathy: dman777_alter, what's your goal here with Rails? Are you trying to learn just enough to fix some problem that's not really of much interest to you? Or are you actually trying to become an effective Rails developer?
[20:37:07] dman777_alter: blahwoop: ok...thanks. I read somewhere I needed a model for factory girl so that is why I asked
[20:37:20] jenrzzz: has joined #RubyOnRails
[20:37:46] blahwoop: dman777_alter: you'll still need a factory file to specific what attributes it should generate
[20:38:06] Lightsword: has joined #RubyOnRails
[20:38:07] dman777_alter: smathy: no, I'm front end developer. I been assigned the task of taking a rails app and adding api's so I can query it for the information for my front end development.
[20:38:16] sofy_arg: this is my controller. I dont see anything weird http://pastie.org/10310407
[20:38:24] xkickflip: has joined #RubyOnRails
[20:38:43] smathy: dman777_alter, "no" doesn't answer my "either or" question.
[20:39:03] blahwoop: dman777_alter: there should be existing code that you can take a look at then
[20:39:08] dman777_alter: blahwoop: cool, that is what I read. But I haven't found alot of info of making a factory file for json
[20:39:57] dman777_alter: smathy: ya...but none of it deals with json.
[20:40:12] blahwoop: u can check out the testing parts of this tutorial http://apionrails.icalialabs.com/book/chapter_one
[20:40:26] MissionCritical: has joined #RubyOnRails
[20:40:49] dman777_alter: blahwoop: thanks!
[20:41:33] blahwoop: dman777_alter: hope it helps
[20:41:34] DEA7TH: has joined #RubyOnRails
[20:41:34] bronson: has joined #RubyOnRails
[20:43:18] smathy: sofy_arg, show the new view, with the code that posts to create. Also, btw, protip for pastie - if you use ## for the filename comments then it will format individual files nicely.
[20:44:39] lupine: hah, output-facts is broken
[20:44:42] sofy_arg: smathy: awesome. i wasnt aware of that
[20:48:54] cornerma1: has joined #RubyOnRails
[20:49:07] ktchup: has joined #RubyOnRails
[20:49:13] benlieb: has joined #RubyOnRails
[20:51:30] shanson: has joined #RubyOnRails
[20:52:17] mrbubbles: has joined #RubyOnRails
[20:52:30] blackmesa: has joined #RubyOnRails
[20:54:41] mhf: has joined #RubyOnRails
[20:55:24] Lightsword: has joined #RubyOnRails
[20:56:00] drale2k: has joined #RubyOnRails
[20:56:15] sofy_arg: smathy: http://pastie.org/10310429
[20:57:18] yfeldblum: has joined #RubyOnRails
[20:57:33] ktchup: has joined #RubyOnRails
[20:57:50] JeramyRR: has joined #RubyOnRails
[20:58:25] workmad3: has joined #RubyOnRails
[20:58:55] smathy: sofy_arg, I was after the code that posts to create.
[20:59:02] SteenJobs: has joined #RubyOnRails
[20:59:40] andy77: has joined #RubyOnRails
[20:59:44] smathy: sofy_arg, ...but actually, I think I see the issue here.
[20:59:47] blahwoop: omniauth only provides authentication? if i want to use the twitter api or github api i'll need to implement something else?
[21:00:08] manfrin: but both of those have many gems
[21:00:15] sofy_arg: smathy: what might be?
[21:00:16] arBmind: has joined #RubyOnRails
[21:01:05] smathy: sofy_arg, well show the feed items and post partials.
[21:01:45] blahwoop: can i use omniauth to get the credentials to tweet or create a new repo?
[21:01:57] smathy: sofy_arg, well @feed_items are `Post`s right, so show the posts/_posts and posts/_post partials.
[21:03:44] iamjarvo: has joined #RubyOnRails
[21:03:57] annlewis: has joined #RubyOnRails
[21:04:29] Papierkorb: has joined #RubyOnRails
[21:04:54] bin_005: has joined #RubyOnRails
[21:05:01] bob14: has joined #RubyOnRails
[21:05:02] erich: has joined #RubyOnRails
[21:06:03] blahwoop: im trying to implement a strategy where a user can add a twitter account and github account to tweet. is oauth necessary? the app will need access to both
[21:06:11] gambl0re: has joined #RubyOnRails
[21:06:53] bob14: does anyone know of a good guide on how to deploy a rails app to digital ocean that actually goes through the entire process? Most of them seem to just show you how to get the default rails app setup. They don't show how to remove the default one and replace it with mine.
[21:07:43] Jarboe: has joined #RubyOnRails
[21:08:50] Papierkorb: blahwoop: "Add a twitter/github account"?
[21:08:58] mistnim`: has joined #RubyOnRails
[21:09:14] Papierkorb: blahwoop: if you mean the stuff where the user gets redirected to twitter/github and is asked, if your app is allowed access, then yes, that's OAuth
[21:09:34] Papierkorb: blahwoop: never used it myself, but there's OmniAuth for that (gem), and you can integrate it with Devise if you use that
[21:09:39] cnk: bob14: I have been meaning to try out this: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[21:10:10] blahwoop: Papierkorb: yes. so the user would add an twitter account to the app and also a github account. im trying to track changes in a github repo so that it can tweet out the changes
[21:10:17] cnk: bob14: But what did you not like about the Digital Ocean guides?
[21:10:19] sofy_arg: smathy: http://pastie.org/10310443
[21:10:38] cnk: I have been using them to set up my Linode server but have been considering switching just because DO has great docs
[21:10:44] Papierkorb: blahwoop: yup, that's what OAuth is for
[21:11:29] cac: has joined #RubyOnRails
[21:11:37] blahwoop: Papierkorb: ok thanks. i'll also need the twitter-api gem and github-api gem too
[21:11:49] bob14: cnk: none of them show how to replace the default rails app with my app and then how to setup the db. They also install everything as root user, and then later on you run into issues when trying to run "bundle install" because of permissions
[21:12:15] bob14: cnk: i am on my 10th droplet right now still tying to set my app up lol
[21:12:25] giowong: if anyone can help appreciate it
[21:12:26] giowong: http://stackoverflow.com/questions/31619844/no-ransacksearch-object-was-provided-to-search-form-for-error
[21:12:46] IceyEC: has joined #RubyOnRails
[21:12:51] blahwoop: bob14: is there a default rails app on digital ocean?
[21:13:46] bob14: blahwoop: yes, if you select one of their default setups. I chose on that comes with ruby on rails, unicorn, nginx. so when you start it up there is a default rails app already running
[21:14:06] jenrzzz: has joined #RubyOnRails
[21:14:18] cnk: so what web server and app server do you want?
[21:14:27] cnk: apache? ngnix?
[21:14:41] blahwoop: bob14: oh that's nice
[21:14:54] cnk: and passenger? or one of the others that you proxy to
[21:15:12] cnk: and what linux distro?
[21:15:18] FernandoBasso: has joined #RubyOnRails
[21:15:21] bob14: ubuntu 14.04
[21:15:34] smathy: sofy_arg, spotted it.
[21:16:20] smathy: sofy_arg, when you first display the view, @feed_items.any? is false so there's no <div id="feed-post"> to prepend to.
[21:16:27] mhf: has joined #RubyOnRails
[21:16:30] bob14: i tried deploying to aws at first, but after about 2 weeks without success, i am trying digital ocean
[21:16:36] smathy: sofy_arg, move the conditional inside that div.
[21:16:54] cnk: try this: v
[21:16:55] cnk: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-nginx-on-ubuntu-14-04
[21:16:57] cored: has joined #RubyOnRails
[21:17:07] smathy: sofy_arg, or actually, just remove it entirely because `render @feed_items` will render nothing at all if @feed_items is empty.
[21:17:21] cored: I'm trying to figure the following error https://gist.github.com/cored/2d4e25c4e67aaf27c00e
[21:17:24] cnk: I should be around for the next 3 hours so feel free to ask questions by name if you have problems
[21:17:25] cored: without any luck
[21:17:41] cored: is there a reason why I'm getting that particular exception? looks like a very common thing to do to me
[21:18:18] smathy: cored, a plural association is meant to be assigned an array of models, not a single model.
[21:19:12] barce: cored: checking it out.
[21:19:25] smathy: cored, it also REPLACES the existing set of associated objects with the new set - so maybe you don't want that.
[21:19:31] sofy_arg: smathy: awesome! that worked! so is not usefull to make this condition in a collection like this?
[21:20:07] cored: smathy: I see
[21:20:08] barce: cored: looks like you're not using an array, hash, or AR collection
[21:20:12] cnk: cored: and why are you using fetch if you don't provide a default?
[21:20:24] smathy: sofy_arg, well you definitely can't have it outside the <div> you're going to prepend new elements into, but no, it serves no purpose with the code you have.
[21:20:53] cored: smathy: make sense, thanks
[21:20:56] Cache_Money: I'm trying to migrate an app from 3.2 to 4.2. I'm getting this error when I try to bundle: `Bundle could not find compatible versions for gem "railties"` https://gist.github.com/anonymous/123e899e5cd4bc4c85b6
[21:21:04] Cache_Money: Is this possible to fix?
[21:21:20] sofy_arg: smathy: thanks!!
[21:21:32] smathy: sofy_arg, you're welcome.
[21:21:53] smathy: cored, you're welcome.
[21:21:55] cnk: Cache_Money: try not pinning your sass-rails
[21:22:12] cnk: just let that upgrade along with everything else
[21:22:26] Cache_Money: cnk: the same with coffee-rails too?
[21:22:28] barce: Cache_Money: same thing with coffee-rails
[21:22:33] Trynemjoel: has joined #RubyOnRails
[21:23:14] cored: barce: what do you mean by that?
[21:23:19] cnk: Cache_Money: and use the latest 4.2.x there is a security patch for 4.2.1
[21:23:22] bulldawgden: has joined #RubyOnRails
[21:23:28] cored: cnk: I'm using fetch to just throw an exception to me if I don't have that value set
[21:23:33] Cache_Money: cnk: that worked.. thanks
[21:23:47] cored: cnk: I'm not handling the exception but that's the intention, this is value that is strongly passed by the controller
[21:24:36] bulldawgden: has joined #RubyOnRails
[21:24:42] ktchup: hello everyone
[21:24:53] barce: cored: i'm guessing each is being run on an object that doesn't have it as a method.
[21:25:04] barce: ktchup: hello!
[21:25:19] ktchup: been struggling with Carrierwave today, I have described the problem here: http://stackoverflow.com/questions/31619290/carrierwave-uploader-wont-store-uploaded-file
[21:25:21] cored: barce: oh, yes I figure that out now, thanks
[21:25:28] zorak8: has joined #RubyOnRails
[21:26:25] barce: what's the Rails way of handling migrations when you have to connect to a legacy database that doesn't use migrations to manage its changes?
[21:27:01] chintanparikh: has joined #RubyOnRails
[21:27:51] iamjarvo: has joined #RubyOnRails
[21:28:36] barce: ktchup, my guess is uploader is the nil class, since it isn't saved and so it has no id
[21:28:43] sofy_arg: smathy: one question. would you create a poly association with messages for public rooms and private conversations?
[21:29:24] bricker: barce: you can still write migrations for a legacy database, the migrations just send commands to the database
[21:29:46] ktchup: barce: that makes sense, I will play with this
[21:31:18] smathy: sofy_arg, you think I know your app a lot more than I do, sorry, there's no way I can give you that level of input.
[21:32:10] The_Phoenix: has joined #RubyOnRails
[21:32:31] jamon_: has joined #RubyOnRails
[21:34:03] Cache_Money: cnk: now that I'm using Rails 4.2.3 I can't run `rails s` - it says "Looks like your app's ./bin/rails is a stub that was generated by Bundler."
[21:35:04] lxsameer: has joined #RubyOnRails
[21:35:08] cnk: try bundle install rails --binstubs and see if that will overwrite that
[21:35:39] ktchup: barce: any idea where to instantiate the uploader? The mount_uploader helper in the Micropost model needs me to pass the Class
[21:36:30] Cache_Money: cnk: i got this error this time: ERROR: "bundle install" was called with arguments ["rails"]
[21:37:02] cnk: ah right
[21:37:14] cnk: how about just bundle install --binstubs
[21:37:18] smathy: ktchup, you're going to be using the model id or something in your PictureUploader. Add your PictureUploader to your question.
[21:37:21] crdpink2: has joined #RubyOnRails
[21:37:29] gaboesquivel: has joined #RubyOnRails
[21:37:29] cnk: (which may have a - in it)
[21:37:48] glenn: has joined #RubyOnRails
[21:38:02] ktchup: smathy: I will, although it's just a default Uploader
[21:38:05] cnk: basically you need to update what is in ./bin/ - or remove it
[21:38:29] smathy: ktchup, ok then add the rest of the error output, the lines after the exception.
[21:39:12] Cache_Money: cnk: should I manually delete what's in the /bin/ directory?
[21:39:44] cnk: if the bundle install doesn't fix it, then I would
[21:39:51] fighella: has joined #RubyOnRails
[21:39:56] blackmesa: has joined #RubyOnRails
[21:41:00] ktchup: smathy: I'm making the edits now
[21:41:29] EminenceHC: has joined #RubyOnRails
[21:41:44] user1138_: has joined #RubyOnRails
[21:42:51] crdpink: has joined #RubyOnRails
[21:44:27] roolo: has joined #RubyOnRails
[21:44:52] eggoez: has joined #RubyOnRails
[21:45:37] zpe: has joined #RubyOnRails
[21:46:32] ktchup: smathy: the PictureUploader code is now available, with the output from the terminal.
[21:46:54] ktchup: Here's the link if anyone else can help with Carrierwave: http://stackoverflow.com/questions/31619290/carrierwave-uploader-wont-store-uploaded-file
[21:47:07] Cache_Money: cnk: i've deleted everything in /bin/, now when I try running `rails server` it just gives the the man for `rails`
[21:47:07] smathy: ktchup, and it has `model.id` in the store_dir method.
[21:47:16] Cache_Money: cnk: how do i revert back to just using rails 4.2.1?
[21:47:18] smathy: ktchup, heh, so much for being "just a default Uploader" :)
[21:47:31] smathy: ktchup, so yeah, you can't use the .store! method directly in uploaders like that.
[21:47:49] ktchup: hm, what should I edit?
[21:48:12] ktchup: remove model.id and put model.name?
[21:48:27] cnk: Cache_Money: upate your gem file and then 'bundle upgrade rails" - or maybe it is bundle update
[21:49:18] Cache_Money: cnk: I tried that and it still says "Using rails 4.2.3"
[21:49:33] cnk: what still says that?
[21:49:55] Cache_Money: the output from running `bundle update rails`
[21:50:15] gusrub: has joined #RubyOnRails
[21:50:47] jottr: has joined #RubyOnRails
[21:51:10] cnk: It may not like downgrading
[21:51:39] cnk: you can remove your gemfile.lock and rerun bundle. But why are you trying to downgrade?
[21:52:47] smathy: ktchup, it doesn't really matter because your debug session is invalid anyway.
[21:53:21] smathy: ktchup, Micropost.new(micropost_params) won't work in a debug console because the file contents have gone already - they're not *in* the micropost_params hash.
[21:53:57] smathy: ktchup, so, instead of pursuing that "how to validly debug a file upload" problem, can you instead explain your actual/original problem here?
[21:54:19] smathy: ktchup, what leads you to believe that the file wasn't saved originally?
[21:54:25] Cache_Money: cnk: i removed the Gemfile.lock and reran bundle but that didn't work :/
[21:54:56] smathy: ktchup, because the ActionDispatch::Http::UploadedFile header in your tmux screenshot looks fine.
[21:55:08] ktchup: smathy: I can't retrieve it and it's not displayed.
[21:55:42] glenn: has joined #RubyOnRails
[21:56:18] cnk: define 'didn't work'
[21:57:08] drale2k: has joined #RubyOnRails
[21:57:19] Lytol: has joined #RubyOnRails
[21:58:01] pixelhan_: has joined #RubyOnRails
[21:58:14] Cache_Money: cnk: It still says "Using rails 4.2.3" in the output, running `rails --version` says 4.2.3. And now when I run `rails server` it doesn't start the server it just gives me output as if I ran `rails --help`
[21:58:32] smathy: ktchup, !gist the result of this: ls -lR public/uploads
[21:58:32] helpa: ktchup: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:59:24] cnk: what is the output of 'which rails'
[22:00:01] ktchup: smathy: I have a confession to mkae
[22:00:02] Radar: Cache_Money: Do you have a script/rails file in that directory where you're running "rails s"?
[22:00:11] ktchup: and I will not have a good weekend because of this
[22:00:12] Radar: ktchup: you're the Zodiac Killer?
[22:00:18] Cache_Money: cnk: /Users/cm/.rvm/gems/ruby-2.1.0/bin/rails
[22:00:23] ktchup: I have been chasing an unexisting bug
[22:00:25] smathy: ktchup, honestly is the best medicine.
[22:00:30] smathy: ktchup, yeah, I thought so :)
[22:00:47] ktchup: been passing the
[22:01:05] ktchup: been passing the pictures from the wrong controller
[22:01:14] Cache_Money: Radar: I don't have a /scripts/ directory in the root of my Rails app
[22:01:14] ktchup: FKSADNFKFNSADfdasL:GJERKALNQAKVNegra
[22:01:16] charliesome: has joined #RubyOnRails
[22:01:18] smathy: ktchup, heh, happens to the best of us.
[22:01:24] Radar: Cache_Money: I didn't say /scripts, I said /script
[22:01:34] smathy: ktchup, thanks for fessing up, lots of people try to fake it to save face.
[22:01:36] Cache_Money: Radar: no /script either
[22:01:51] Radar: Cache_Money: What version of Rails is this?
[22:02:03] smathy: ktchup, and definitely that `id` error was a misleading annoyance :)
[22:02:19] smathy: ktchup, don't be offended but I voted to close your question because it's no longer reproducible.
[22:02:21] Cache_Money: Radar: I was using 4.2.1, then cnk suggested I upgrade to 4.2.3 (which I'm now using)
[22:02:21] ktchup: smathy: yea well, I owe it to you for telling me there was nothing wrong there
[22:02:29] smathy: ktchup, you're welcome :)
[22:02:32] ktchup: yea, now worries, I'll delete it
[22:02:48] smathy: So now you CAN have a good weekend ktchup
[22:03:12] ktchup: I'll have a weekend of excess to forget this
[22:03:20] smathy: That works too.
[22:03:31] Cache_Money: cnk: do you think the `which rails` output is the reason why I'm having trouble?
[22:03:32] workmad3: has joined #RubyOnRails
[22:03:56] cnk: no that looks like a totally reasonable place for your rails to be
[22:04:16] cnk: it is not using ./bin/rails but I think you sort of wanted that removed
[22:04:18] Radar: Cache_Money: Do you have a `bin/rails`?
[22:04:32] Radar: cnk: bin/rails is what Rails uses to determine if it is inside of a Rails application.
[22:04:35] Radar: Removing it is... wrong
[22:04:50] Cache_Money: Radar: I have nothing in my /bin/ directory b/c cnk told me to delete everything in there
[22:04:59] Radar: #welltheresyourproblem
[22:05:00] glenn: has joined #RubyOnRails
[22:05:13] Radar: https://gist.github.com/radar/0f8cebf16755f1ace75a
[22:05:16] Radar: Put this as bin/rails in your app
[22:05:43] s2013: has joined #RubyOnRails
[22:05:58] Radar: https://github.com/rails/rails/blob/master/railties/lib/rails/app_loader.rb#L32-L59
[22:06:04] cnk: so does bin/rails replace script/server?
[22:06:21] user1138: has joined #RubyOnRails
[22:06:25] cnk: I mistook it for something binstubs added
[22:06:32] Radar: bin/rails is responsible for initializing the loading process of Rails
[22:06:45] Radar: It's one of the first files that gets loaded.
[22:06:52] cac: has joined #RubyOnRails
[22:07:02] cnk: Cache_Money: OK sorry about that.
[22:07:08] Cache_Money: cnk: no worries
[22:07:09] Radar: If it or script/rails are not present then Rails will assume that you're not in a Rails app's directory.
[22:07:17] cnk: so when upgrading, has that changed since 3.2?
[22:07:35] cnk: Cache_Money was having trouble with picking up the correct rails version
[22:07:43] Radar: cnk: It's been that way since Rails 3 afaik
[22:07:57] Cache_Money: Radar: thanks, now I'm getting one last error: "dyld: lazy symbol binding failed: Symbol not found: _rb_id2sym"
[22:08:11] cnk: OK if it hasn't change then Cache_Money should be able to restore from version control
[22:08:31] Radar: Cache_Money: What OS are you on?
[22:08:35] chintanparikh: has joined #RubyOnRails
[22:08:47] Radar: Cache_Money: Specific version of OS X?
[22:08:57] Radar: You're seeing the same issue as https://github.com/tenderlove/syck/issues/5
[22:09:07] FernandoBasso: has joined #RubyOnRails
[22:09:12] Radar: gem update syck
[22:09:15] lxsameer: has joined #RubyOnRails
[22:09:26] elia: has joined #RubyOnRails
[22:09:32] smathy: bundle --binstubs whould restore your bin Cache_Money
[22:09:55] earksiinni: has joined #RubyOnRails
[22:10:15] Radar: this is what got him into the mess in the first bloody place
[22:10:25] robbyoconnor: has joined #RubyOnRails
[22:10:38] smathy: My work here is done.
[22:10:39] Radar: If he did that, he will see this error: https://github.com/rails/rails/blob/master/railties/lib/rails/app_loader.rb#L10-L30
[22:11:07] erich: has joined #RubyOnRails
[22:11:18] cnk: excellent! so line 19 fixes his issue
[22:11:18] smathy: Radar, I think the latest bundler must have fixed that.
[22:11:22] Cache_Money: Radar: Yes, I was seeing that previously
[22:11:36] Radar: p.s. all of this is explained starting on Page 10 of Deep Dive Rails: https://leanpub.com/ddr
[22:11:36] cnk: Thanks Radar, I learned something today
[22:11:51] Radar: If my help has meant anything today, please buy yourself a copy :)
[22:11:57] earksiinni: has left #RubyOnRails: ()
[22:11:58] urlgrey_: has joined #RubyOnRails
[22:12:04] earksiinni: has joined #RubyOnRails
[22:12:05] cnk: Cool - but first I have to finish MultiTenancy Rails
[22:12:47] cnk: I should really get back to my ruby study group
[22:12:58] chintanparikh1: has joined #RubyOnRails
[22:12:58] Cache_Money: Radar: running `gem update syck` didn't fix that error
[22:14:19] Cache_Money: I still see "dyld: lazy symbol binding failed: Symbol not found: _rb_id2sym" when running `rails server`
[22:14:35] earksiinni: n00b question: I just wrote my first fix for a Rails bug that has a ticket on GH, but I don't know what the protocol is for committing. I've read the guide at http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#contributing-to-the-rails-code, but should I first contact people who are following the ticket on GH? Or do I just do a pull r
[22:14:38] cnk: and your syck gem is not pinned in your Gemfile?
[22:15:03] Cache_Money: cnk: no, I've never even seen the syck gem before
[22:15:39] Cache_Money: the output from `gem update syck` is "Updating installed gems. Nothing to update"
[22:16:00] dman777_alter: Does ruby use hashrockets in json or is that only in hashes?
[22:16:02] cnk: gem list syck gives?
[22:16:16] FernandoBasso: If I want to create a directory to store some txt files with notes and things like that, can I create something like "other/" in the root dir of the app?
[22:16:20] Cache_Money: "*** LOCAL GEMS *** with nothing after it
[22:16:35] joelataylor: has joined #RubyOnRails
[22:17:23] cnk: interesting. I similarly don't have it in my rails 4 project
[22:17:45] barce: ktchup: sorry afk
[22:18:08] cnk: Cache_Money: what yml files do you have?
[22:18:26] cnk: database.yml, secrets.yml + ? anything custom?
[22:18:30] zorak8: has joined #RubyOnRails
[22:18:49] Cache_Money: there is the default /config/locales/en.yml
[22:19:59] cnk: and any of them use any odd syntax?
[22:20:35] Cache_Money: they are all just what comes default when you create a new rails app
[22:20:47] Cache_Money: i did create this app with Rails 4.2.1
[22:21:00] Cache_Money: now i'm using 4.2.3
[22:21:08] cnk: those won't have changed with a point release
[22:21:32] cnk: so is this a new project? I thought it was an overlay / update on a 3.2 project
[22:21:50] centrx: has joined #RubyOnRails
[22:22:15] Cache_Money: I'm rebuilding an existing project that is in 3.2
[22:23:04] cnk: how about get a whole new terminal, cd somewhere, and do 'rails new george'
[22:23:09] cnk: see if that project works
[22:23:54] cnk: make sure your rvm is using the ruby (and gemset?) you intend
[22:24:02] Cache_Money: cnk: that worked fine
[22:24:28] cnk: try from that new window to go to your troubled proejct and see if that now works
[22:24:43] Cache_Money: cnk: that worked. I opened a new terminal and ran `rails server` and it worked like normal
[22:24:44] Radar: Cache_Money: Did you fix the symbol error?
[22:24:56] shanson: has joined #RubyOnRails
[22:25:08] Cache_Money: Radar: I did run `gem update syck` but it didn't do anything
[22:25:18] idd2d_: has joined #RubyOnRails
[22:25:18] Cache_Money: I just opened a new terminal and `rails s` worked without a problem
[22:25:19] Radar: Cache_Money: But is the error fixed now or not?
[22:25:26] Cache_Money: it is no longer occurring
[22:25:43] cnk: He is using RVM and I suspect something got messed up in the shell he was using
[22:25:50] cnk: new shell -> no problems
[22:26:08] cnk: I love RVM but occasionally things get wierd and a new shell is the answer
[22:27:08] cnk: I actually tried converting to rbenv last night (because RVM and pyenv were conflicting) but I totally could not get a consistent set of ruby, gem, and bundler with rbenv and I ended up going back to RVM
[22:27:37] sar1nk: has joined #RubyOnRails
[22:29:24] smathy: FernandoBasso, yes.
[22:29:55] FernandoBasso: smathy, Thanks.
[22:30:59] sypheren: has joined #RubyOnRails
[22:31:54] johnMcLain: has joined #RubyOnRails
[22:32:31] johnMcLain: has joined #RubyOnRails
[22:32:48] Guest93100: has joined #RubyOnRails
[22:32:58] czerasz: has joined #RubyOnRails
[22:33:07] smathy: dman777_alter, if a string had hashrockets in it as the key => value separator, then it wouldn't be (valid) JSON.
[22:33:08] johnMcLain: has joined #RubyOnRails
[22:33:53] johnMcLain_: has joined #RubyOnRails
[22:34:27] johnMcLain: has joined #RubyOnRails
[22:35:06] johnMcLain_: has joined #RubyOnRails
[22:35:35] johnMcLain: has joined #RubyOnRails
[22:36:13] johnMcLain: has joined #RubyOnRails
[22:36:32] Jarboe: has joined #RubyOnRails
[22:36:33] nickenchuggets: has joined #RubyOnRails
[22:36:46] johnMcLain: has joined #RubyOnRails
[22:37:23] johnMcLain: has joined #RubyOnRails
[22:37:25] smathy: earksiinni, just include the issue number in your pull request (either description or body) like: Closes #1234
[22:37:49] earksiinni: smathy, thanks
[22:37:50] smathy: earksiinni, that will notify anyone watching the issue of your PR, and if your PR is merged into master it will also close that issue.
[22:37:57] dented42: has joined #RubyOnRails
[22:38:01] johnMcLain: has joined #RubyOnRails
[22:38:10] smathy: earksiinni, you're welcome, and nice work.
[22:38:35] smathy: (yes, even without seeing your PR, just that you're reading the contributing guide and taking the initiative is nice work :)
[22:38:46] johnMcLain_: has joined #RubyOnRails
[22:39:01] earksiinni: haha, I appreciate it
[22:39:13] johnMcLain: has joined #RubyOnRails
[22:39:52] johnMcLain: has joined #RubyOnRails
[22:40:04] FernandoBasso: I am confused about singular and plurals. `rails generate controler <plural>`, and `rails generate model <singular>`, right?
[22:40:29] johnMcLain: has joined #RubyOnRails
[22:41:03] johnMcLain: has joined #RubyOnRails
[22:41:06] Papierkorb: FernandoBasso: Yes. a single model instance manages a single instance of it, while a controller may manage multiple models of its kind
[22:41:16] FernandoBasso: Wonderful. Thanks.
[22:41:27] Papierkorb: *model instances
[22:48:07] DEA7TH: has joined #RubyOnRails
[22:48:53] dented42: has joined #RubyOnRails
[22:48:55] smathy: FernandoBasso, use the resource generator to do both model and controller at once (and routes) and you can use either plural or singular and it'll do the right thing.
[22:49:55] messine: has joined #RubyOnRails
[22:50:11] FernandoBasso: smathy, All right. Thanks.
[22:51:07] Cache_Money: I copied /app/assets/images/ from an existing 3.2 Rails app. When I run the same view code I get this error: "ActionView::Template::Error (File not found or cannot be read: ./images/learnmore_btn.png):" even though that image exists in that location. Do I need to handle images differently in Rails 4.2.x
[22:52:00] smathy: Cache_Money, what's the line of view code look like?
[22:54:34] sarink: has joined #RubyOnRails
[22:54:35] Cache_Money: smathy: I think it's just the `stylesheet_link_tag`. I see that the img is being called in the /stylesheets/components/_box.css.scss file
[22:55:26] smathy: Cache_Money, what's the line of the [whatever word works for you to describe the code in your SCSS files] look like?
[22:56:08] earksiinni: smathy: is it OK to put explanatory comments in the code if it's not obvious?
[22:56:08] Cache_Money: smathy: @include data-uri-bg("learnmore_btn.png");
[22:56:33] dented42: has joined #RubyOnRails
[22:58:15] drale2k: has joined #RubyOnRails
[22:58:40] smathy: Cache_Money, ok, wrap that string in asset-path()
[22:58:51] smathy: Cache_Money, read more here: https://github.com/rails/sass-rails
[22:59:31] dman777_alter: response.body.should eql.... I noticed the json body gets converted to hash automatically for asserting with rspec. Why is this?
[23:00:22] Cache_Money: smathy: so it should look like this now? @include data-uri-bg(asset-path("learnmore_btn.png"));
[23:00:33] iamse7en: has joined #RubyOnRails
[23:00:40] Dfoolz: has joined #RubyOnRails
[23:01:20] Cache_Money: smathy: it looks like there are a lot of instances of the above. Is there some type of configuration I can set so that I don't have to add `asset-path()` to each image?
[23:01:59] smathy: Cache_Money, no.
[23:02:10] smathy: Cache_Money, and yes, it should look like that.
[23:02:29] rakm: has joined #RubyOnRails
[23:02:31] messine: How do you set the foreign key of an associated model? Like when I create a new Topic I want to ensure it belongs to the correct Forum
[23:03:00] Cache_Money: smathy: I made that change and now it says: "ActionView::Template::Error (File not found or cannot be read: ./images/assets/learnmore_btn-61c6724bfdacd25ad6cca950766351bb60064603d902d7a0b752f257433dec1b.png):" The file is located at /app/assets/images/learnmore_btn.png
[23:03:06] cnk: my_forum.topic.build
[23:03:28] Cache_Money: smathy: before I added asset-path() the error said: "ActionView::Template::Error (File not found or cannot be read: ./images/learnmore_btn.png):"
[23:03:59] arBmind1: has joined #RubyOnRails
[23:04:14] mary5030: has joined #RubyOnRails
[23:05:12] rakm_: has joined #RubyOnRails
[23:05:38] messine: thanks cnk, but I don't think that solves my problem
[23:05:41] _utah_: has joined #RubyOnRails
[23:05:57] messine: here is my flow: forum show ???> link ???> topics new ???> form for ???> topic create
[23:06:44] messine: I pass the forum instance in the link but can't decide how to pass it on to the create action in the Topic's controller
[23:07:04] cnk: your form should have a hidden field with the forum_id
[23:07:14] cnk: query for the forum - fail if not found
[23:07:20] cnk: then forum.topic.create
[23:07:28] messine: awesome that's what I needed
[23:07:52] messine: Is that convention?
[23:09:10] messine: It feels insecure, could a user alter that hidden field and post to a forum they do not have access to
[23:09:46] messine: I guess I would check that in the controller! Thanks
[23:09:52] cnk: exactly
[23:10:24] SteenJobs: has joined #RubyOnRails
[23:11:22] smathy: Cache_Money, sounds like your data-uri-bg macro is broken.
[23:11:54] smathy: Cache_Money, looks like it's just prepending "./images/" to whatever it's passed
[23:11:58] Cache_Money: smathy: is the data-uri-bg macro provided by the sass gem?
[23:12:34] smathy: Cache_Money, not that I'm aware of.
[23:12:45] smathy: Cache_Money, you don't find the definition of it in your app?
[23:12:59] Cache_Money: smathy: i haven't come across it yet. I'll search for it
[23:14:15] EminenceHC: has joined #RubyOnRails
[23:16:20] Palsson: has joined #RubyOnRails
[23:17:24] smathy: ...unless you or your predecessors "borrowed" it from here: https://github.com/turingschool/turing.io
[23:18:05] mrbubbles: has joined #RubyOnRails
[23:19:07] EduardoBautista: has joined #RubyOnRails
[23:20:44] tuelz: has joined #RubyOnRails
[23:23:12] hahuang65: has joined #RubyOnRails
[23:23:14] icaro: has joined #RubyOnRails
[23:23:59] lemur: has joined #RubyOnRails
[23:24:00] FernandoBasso: So, if I have app/controllers/admin/UsersController, should a route like "users GET /users(.:format) users#index" work or I have to do something special since the controller is in a subdir?
[23:24:31] FernandoBasso: I'm getting: uninitialized constant UsersController and the class is indeed "UsersController".
[23:25:13] FernandoBasso: I am hitting the url http://localhost:3000/users
[23:26:02] Scriptonaut: has left #RubyOnRails: ()
[23:27:10] eggoez: has joined #RubyOnRails
[23:27:45] smathy: FernandoBasso, read http://guides.rubyonrails.org/routing.html - look for namespace and scope. One or the other will be what you want.
[23:28:03] FernandoBasso: Okay. Thanks once more.
[23:28:30] werelivinginthef: has joined #RubyOnRails
[23:29:14] debajit: has joined #RubyOnRails
[23:30:07] debajit: I would like to do a Rails.cache.fetch around a render call in a controller --- How can I do this? When I wrap the render with a Rails.cache.fetch, it does not seem to be caching the results of the render
[23:31:07] FernandoBasso: I just took a quick look and it worked. I'll go to bed now because I am too tired today.
[23:33:45] stantonnet: has joined #RubyOnRails
[23:35:25] a346: has joined #RubyOnRails
[23:36:41] zorak8: has joined #RubyOnRails
[23:36:51] eGGsha: has joined #RubyOnRails
[23:38:35] smathy: debajit, just cache do
[23:38:43] smathy: debajit, fetch is the explicit getter.
[23:39:09] smathy: debajit, http://guides.rubyonrails.org/caching_with_rails.html
[23:39:31] smathy: debajit, specifically: http://guides.rubyonrails.org/caching_with_rails.html#fragment-caching
[23:41:20] idd2d_: has joined #RubyOnRails
[23:50:53] corioliss_: has joined #RubyOnRails
[23:51:13] urlgrey: has joined #RubyOnRails
[23:51:20] balr0g_: has joined #RubyOnRails
[23:51:21] hahuang65: has joined #RubyOnRails
[23:51:25] hellschreiber_: has joined #RubyOnRails
[23:51:33] pusewicz_: has joined #RubyOnRails
[23:51:38] neilfse_: has joined #RubyOnRails
[23:51:47] EduardoBautista_: has joined #RubyOnRails
[23:52:11] shock_one: has joined #RubyOnRails
[23:52:35] RegulationD: has joined #RubyOnRails
[23:52:45] lacrosse_: has joined #RubyOnRails
[23:53:34] cntrx: has joined #RubyOnRails
[23:53:38] richipar1o: has joined #RubyOnRails
[23:54:02] silverdust: has joined #RubyOnRails
[23:54:09] pipework: has joined #RubyOnRails
[23:54:28] debajit: smathy: Trying that out. Thanks a ton! I knew cache worked in views, didnt know it works in controllers
[23:56:22] merryfett: has joined #RubyOnRails
[23:56:55] lele: has joined #RubyOnRails
[23:59:19] drale2k: has joined #RubyOnRails
[23:59:41] SteenJobs: has joined #RubyOnRails