« Back to channel list

#RubyOnRails - 07 March 2016

« Back 1 day Forward 1 day »
[00:01:47] failproofshark: is there a specific way of using url_for outside of a controller?
[00:04:23] josephkokenge: has joined #RubyOnRails
[00:05:51] chouhoulis: has joined #RubyOnRails
[00:05:53] jeanlinux: has joined #RubyOnRails
[00:09:50] kdough: has joined #RubyOnRails
[00:10:44] pawnbox: has joined #RubyOnRails
[00:19:46] chouhoulis: has joined #RubyOnRails
[00:25:01] jstransky: has joined #RubyOnRails
[00:27:56] Radar: failproofshark: Where are you queueing up the job? Is it possible to generate the URL in that class instead?
[00:31:46] pawnbox: has joined #RubyOnRails
[00:33:05] EasyRider0: has joined #RubyOnRails
[00:33:24] DragonPunch: has joined #RubyOnRails
[00:34:32] smoitra: has joined #RubyOnRails
[00:40:08] failproofshark: Radar: I figured out a work around
[00:40:12] failproofshark: thanks for the response though
[00:40:15] failproofshark: has left #RubyOnRails: ()
[00:40:18] Intii: has joined #RubyOnRails
[00:41:35] Devalo: has joined #RubyOnRails
[00:43:19] SteenJobs: has joined #RubyOnRails
[00:43:28] mercwithamouth: has joined #RubyOnRails
[00:43:36] bob434: has joined #RubyOnRails
[00:44:17] mercwithamouth: can someone tell me why my scheduled_date is showing but not the end_date in the Events show view? https://github.com/jamalburgess/saga
[00:44:40] mercwithamouth: new to haml...i'm sure it's something simple but that should work.... i've goof'd =P
[00:45:55] dalbuschat: has joined #RubyOnRails
[00:46:08] Rodya_: has joined #RubyOnRails
[00:46:26] rizenine: has joined #RubyOnRails
[00:49:22] one_zero: has joined #RubyOnRails
[00:49:41] Intii: Hi everyone, I'm using the Her gem in a Rails app I have. I have a User model with a custom action called cancel. After sucessfully patching to the API, I get this error: undefined method `map' for nil:NilClass. I'm not sure what's going on here... https://gist.github.com/dsarhadian/4b2ad13163f9d74f01b8
[00:51:01] Radar: mercwithamouth: is it nil?
[00:51:14] Radar: Intii: !didntwork
[00:51:14] helpa: Intii: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[00:51:19] Radar: Intii: Stacktrace please.
[00:51:43] bob434: has joined #RubyOnRails
[00:52:07] mercwithamouth: Radar, nope just literally not showing up. the location and scheduled date show fine
[00:52:35] Intii: Well I know for a fact that the server responds successfully to the patch call. Going to post the stacktrace to Gist right now Radar
[00:52:37] Radar: mercwithamouth: I don't know then. What does = debug @event.end_date show up?
[00:53:22] Radar: mercwithamouth: literally just that?
[00:53:23] ur5us: has joined #RubyOnRails
[00:53:34] mercwithamouth: never seen that before...
[00:53:36] ur5us: has joined #RubyOnRails
[00:53:52] Radar: = debug @event.end_date.inspect
[00:54:30] Intii: Radar: https://gist.github.com/dsarhadian/8b5de686f110b2236be0
[00:54:38] mercwithamouth: Radar: http://imgur.com/1A2oU9L
[00:54:49] Intii: When I check the database, I see my cancellation reason and the status has been correctly changed.
[00:55:02] mercwithamouth: hmm ok that's a little better. so the value isn't being saved
[00:55:04] Radar: mercwithamouth: oh surprise
[00:55:11] Radar: Intii: No idea. Put a breakpoint there in at " her (0.8.1) lib/her/model/attributes.rb:35:in `initialize_collection'" and see what it's getting back?
[00:55:24] Intii: Okay. Let me try that
[00:55:25] Radar: mercwithamouth: Didn't add it to the strong parameters list?
[00:55:34] mercwithamouth: you are right... lol
[00:55:38] Radar: thanks :)
[00:58:06] darkxploit: has joined #RubyOnRails
[01:05:10] ewnd9: has joined #RubyOnRails
[01:10:15] jeanlinux: has joined #RubyOnRails
[01:17:59] DragonPunch: what templating language does reuby use
[01:18:21] delgiudices: has joined #RubyOnRails
[01:20:56] godzillaenlacasa: has joined #RubyOnRails
[01:21:07] ace05: has joined #RubyOnRails
[01:21:29] pawnbox: has joined #RubyOnRails
[01:28:42] Ebok: has joined #RubyOnRails
[01:28:59] chipotle: has joined #RubyOnRails
[01:29:13] puff: has joined #RubyOnRails
[01:31:19] Guest34101: has joined #RubyOnRails
[01:35:01] DoctorMonocular: has joined #RubyOnRails
[01:36:24] ebbflowgo: has joined #RubyOnRails
[01:38:37] arBmind: has joined #RubyOnRails
[01:39:58] bool_: has joined #RubyOnRails
[01:42:18] bachmann: has joined #RubyOnRails
[01:43:11] TinkerTyper: has joined #RubyOnRails
[01:44:13] d0nn1e: has joined #RubyOnRails
[01:47:02] Rodya_: has joined #RubyOnRails
[01:47:05] djbkd: has joined #RubyOnRails
[01:50:00] swarm_lurker: has joined #RubyOnRails
[01:51:34] baweaver: has joined #RubyOnRails
[01:51:39] bool_: has joined #RubyOnRails
[01:52:29] jinette: has joined #RubyOnRails
[01:56:02] Mchl: has joined #RubyOnRails
[01:56:28] stannard: has joined #RubyOnRails
[01:56:48] cabinB: has joined #RubyOnRails
[01:57:46] lyoshajapan: has joined #RubyOnRails
[01:59:48] pyemkey: has joined #RubyOnRails
[02:01:24] pawnbox: has joined #RubyOnRails
[02:01:57] jinette: havenwood,yes!!
[02:02:05] jinette: it worked!
[02:02:20] jinette: thank you very much!!
[02:04:05] Rodya_: has joined #RubyOnRails
[02:04:44] winfli_: has joined #RubyOnRails
[02:05:45] fryguy: DragonPunch: it uses erb by default. haml and slim are popular alternatives
[02:07:37] bachmann: has joined #RubyOnRails
[02:08:36] braincrash: has joined #RubyOnRails
[02:09:44] chagel: has joined #RubyOnRails
[02:14:07] catcher: has joined #RubyOnRails
[02:15:10] delgiudices: has joined #RubyOnRails
[02:15:31] delgiudices: Any recommendations of an email service to use with rails?
[02:15:41] Radar: delgiudices: sendgrid or mailgun
[02:16:16] _lazarevsky: has joined #RubyOnRails
[02:20:13] S1kx: has joined #RubyOnRails
[02:22:45] bachmann: has joined #RubyOnRails
[02:30:03] jenrzzz: has joined #RubyOnRails
[02:33:08] ace05: has joined #RubyOnRails
[02:34:57] chipotle: has joined #RubyOnRails
[02:38:18] bachmann: has joined #RubyOnRails
[02:41:19] circ-user-53WM5: has joined #RubyOnRails
[02:41:38] S1kx: has joined #RubyOnRails
[02:42:37] catcher: has joined #RubyOnRails
[02:45:29] norc_: has joined #RubyOnRails
[02:46:56] winfli_: has left #RubyOnRails: ()
[02:47:29] Chagel_: has joined #RubyOnRails
[02:50:29] baweaver: has joined #RubyOnRails
[02:53:35] chagel: has joined #RubyOnRails
[02:56:41] chouhoulis: has joined #RubyOnRails
[02:56:46] tsujp: has joined #RubyOnRails
[02:56:47] _Tariq: has joined #RubyOnRails
[02:57:12] _lazarevsky: good evening all
[02:57:14] _lazarevsky: anyone around?
[02:57:23] havenwood: _lazarevsky: always
[02:58:15] havenwood: _lazarevsky: good evening
[02:58:20] diego2: has joined #RubyOnRails
[02:59:28] _lazarevsky: havenwood: a bit of googling lead me to the answer to my question
[02:59:32] _lazarevsky: :) thanks tho
[02:59:35] diego2: has joined #RubyOnRails
[03:00:06] jstransky: has joined #RubyOnRails
[03:01:57] dandaman: has joined #RubyOnRails
[03:05:12] SteenJobs: has anyone experienced any rails helpers or ‘render’ in an html file slowing down or adversely affecting any css styling?
[03:07:56] sypheren: has joined #RubyOnRails
[03:10:00] Radar: SteenJobs: no
[03:10:17] Radar: SteenJobs: How many elements are you rendering?
[03:13:37] SteenJobs: Radar: not exceptionally many
[03:13:52] SteenJobs: but if i simply paste the rendered html into my view file, the issue i’m having goes away
[03:14:27] SteenJobs: basically i added a blur to a login panel to appear as though the body’s background image is being blurred, but upon scroll the background image of the login panel only adjusts its position like 60% of the time, and when it does it’s delayed and choppy
[03:16:35] rubyonrailed: has joined #RubyOnRails
[03:17:08] _Tariq: has joined #RubyOnRails
[03:18:12] ace05: has joined #RubyOnRails
[03:21:40] ewnd9: has joined #RubyOnRails
[03:21:46] pawnbox: has joined #RubyOnRails
[03:28:40] jeanlinux: has joined #RubyOnRails
[03:28:56] SteenJobs: Radar: i got things working, but it’s still very choppy, and only seems to work in safari - the updated background position is only observed in chrome when the tab in the login panel is switched
[03:29:15] Radar: SteenJobs Hard for me to debug without toying with it myself.
[03:29:38] SteenJobs: Radar: fair - i have a codepen of it, but it obvs won’t give you the full app
[03:29:47] Radar: SteenJobs: Does it reproduce the problem?
[03:29:48] mrgreenfur: has joined #RubyOnRails
[03:30:15] SteenJobs: so that’s what’s weird - it seems to be muuuuch smoother in the codepen, where i merely copied the generated html (sans any rendering or rails helpers, etc.)
[03:30:44] SteenJobs: Radar: wait, yea it does. still only works in safari
[03:31:12] Radar: Once Rails has done its thing it doesn't do anything else that would lag down the rendering of the page.
[03:31:28] SteenJobs: right. hm, so not sure where the lag is coming from.
[03:31:30] SteenJobs: i’ll keep at it
[03:32:28] ivanskie_: has joined #RubyOnRails
[03:32:47] pawnbox: has joined #RubyOnRails
[03:35:23] Rodya_: has joined #RubyOnRails
[03:38:35] IrishGringo: has joined #RubyOnRails
[03:41:10] dandaman: has joined #RubyOnRails
[03:42:57] lyoshajapan: has joined #RubyOnRails
[03:43:41] tjbiddle: has joined #RubyOnRails
[03:45:26] lyoshajapan: has joined #RubyOnRails
[03:49:30] jscheel: has joined #RubyOnRails
[03:51:01] _Tariq: has joined #RubyOnRails
[03:51:20] qejk: has joined #RubyOnRails
[03:53:08] DmitryBochkarev: has joined #RubyOnRails
[03:54:43] uglybandersnatch: has joined #RubyOnRails
[04:00:34] pwnd_nsfw`: has joined #RubyOnRails
[04:01:04] jstransky: has joined #RubyOnRails
[04:04:29] pawnbox: has joined #RubyOnRails
[04:04:51] blackmesa: has joined #RubyOnRails
[04:05:36] krz: has joined #RubyOnRails
[04:06:09] cabinB: has joined #RubyOnRails
[04:08:17] Limix: has joined #RubyOnRails
[04:16:31] agoldboi: has joined #RubyOnRails
[04:17:13] ace05: has joined #RubyOnRails
[04:18:24] braincrash: has joined #RubyOnRails
[04:19:14] baweaver: has joined #RubyOnRails
[04:19:29] maxz: has joined #RubyOnRails
[04:27:36] DragonPunch: has joined #RubyOnRails
[04:30:03] jeanlinux: has joined #RubyOnRails
[04:30:16] BtcBen: has joined #RubyOnRails
[04:31:21] Chagel_: has joined #RubyOnRails
[04:36:39] Rodya_: has joined #RubyOnRails
[04:37:59] chagel: has joined #RubyOnRails
[04:38:04] Eswar: has joined #RubyOnRails
[04:40:43] treaki_: has joined #RubyOnRails
[04:43:28] chagel: has joined #RubyOnRails
[04:44:18] Megamos: has joined #RubyOnRails
[04:45:40] bachmann: has joined #RubyOnRails
[04:47:52] DragonPunch: Does anyone have a good Ruby on Rails tutorial guides (other than the one provided by the Rails Organization, as I have already gone through that )
[04:49:18] P0w3r3d: has joined #RubyOnRails
[04:51:22] Radar: DragonPunch: !r4ia
[04:51:22] helpa: DragonPunch: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[04:51:41] Ropeney: DragonPunch, or more a tutorial https://www.railstutorial.org/book
[04:52:12] smoitra: has joined #RubyOnRails
[04:55:29] Ropeney: the book will prep you better if you want a job though
[04:57:07] chagel: has joined #RubyOnRails
[04:57:27] Radar: Consider the Rails Tutorial like a "trial version" Rails 4 in Action ;)
[05:00:30] arup_r: has joined #RubyOnRails
[05:01:33] jstransky: has joined #RubyOnRails
[05:05:38] blackmesa: has joined #RubyOnRails
[05:05:41] lyoshajapan: has joined #RubyOnRails
[05:08:48] jake_g: has joined #RubyOnRails
[05:09:56] pawnbox: has joined #RubyOnRails
[05:10:38] jake_g: Hi. I have a model that has an enum called types and I am trying to access it in a fixture yml file. When I do `<%= Ride.types[:commute] %>` in the fixture file, I get `undefined method types`. Was I incorrect in thinking I could access the class like this while setting up fixtures?
[05:10:58] jake_g: Rails 5 beta 3
[05:12:02] deuxclique: has joined #RubyOnRails
[05:12:13] Guest34101: has joined #RubyOnRails
[05:14:03] DmitryBochkarev: has joined #RubyOnRails
[05:15:55] uglybandersnatch: has joined #RubyOnRails
[05:16:07] DmitryBochkarev: has joined #RubyOnRails
[05:17:12] duncannz: has joined #RubyOnRails
[05:19:09] jake_g: I think its not finding the fixtures model class because label references for associations (belongs_to) also arent working
[05:20:06] lyoshajapan: has joined #RubyOnRails
[05:20:27] ace05: has joined #RubyOnRails
[05:20:52] jake_g: I have included `fixtures :all` in the test helper and the spec requires the test helper. What else should I check?
[05:21:12] arup_r: jake_g: I am not 100% sure. In enum, if you have a field called staus say in Post model. Then you access them like Post.statuses ( see the PLURAL )
[05:21:44] arup_r: but you have a field, *types* ( plural ), .. it is just a matter of doubt in my side..
[05:21:50] arup_r: I am not sure though.
[05:22:02] Eswar: has joined #RubyOnRails
[05:22:45] arup_r: another thing, never use `type` field, in models. Because Rails use it for STI. so choose something else if possible.
[05:23:06] jake_g: Oh yeah… forgot about that. I wonder if thats messing it up. I’ll try cahnging to kind
[05:23:12] arup_r: You can just for testing, can change the field name as I said, and try if it works..
[05:23:29] arup_r: if still doesn't work, then may be issue with Rails 5 ..
[05:23:44] lyoshajapan: has joined #RubyOnRails
[05:24:12] EasyRider0: has joined #RubyOnRails
[05:25:30] jake_g: I shouldn’t have decided to experiment with rails 5 and fixtures (i’ve always done factory_girl) at the same time haha too many moving pieces.
[05:25:51] maxz: has joined #RubyOnRails
[05:26:51] arup_r: yeah, jake_g. don't do until rolled out.. :D
[05:27:45] djbkd: has joined #RubyOnRails
[05:27:52] SteenJobs: has joined #RubyOnRails
[05:27:56] matthewd: arup_r: You can be conservative if you like, but I really wish you wouldn't quite so actively discourage people from using the betas... that's kinda what they're for.
[05:28:22] DragonPunch: has joined #RubyOnRails
[05:29:15] jake_g: Haha yeah Im just working on a side project so I decided to try out everything I don’t use in my day job (minitest instead of rspec, fixtures instead of factory_girl, rails 5 instead of 4, some react stuff) but I’m thinking I bit off too much new stuff at once
[05:30:20] arup_r: matthewd: humm, true
[05:32:23] arup_r: matthewd: many many people like me expressed the same thing like me.. so I thought, I also should say. But, I will not again.. Let keep my own things inside me.. :)
[05:34:17] arup_r: My main point was, if you are thinking to start some client project with Rails 5, be careful, because you may get stuck to add features there due to many breaking changes.. it happened.. And if you want to just try the new features no business implementation with it, The Go Try For it.
[05:34:32] arup_r: This is what I actually wanted to say
[05:35:54] jake_g: Regarding fixtures, is there some setup that needs to happen out side of adding `fixtures :all` to the test helper? Mine dont seem to be behaving correctly. Associations aren’t working if I use labels from another fixture. Also, they’re not autofilling the timestamps so the database isn’t accepting them (since timestamp columns have a `null: false` on them)
[05:38:10] Rodya_: has joined #RubyOnRails
[05:39:01] uglybandersnatch: has joined #RubyOnRails
[05:41:41] chagel: has joined #RubyOnRails
[05:45:49] Eswar: has joined #RubyOnRails
[05:46:33] Zggb: has joined #RubyOnRails
[05:52:32] baweaver: has joined #RubyOnRails
[05:52:45] pawnbox: has joined #RubyOnRails
[05:58:05] jake_g: Hmm I have no idea why it wasn’t able to associate the fixture with the model but i deleted everything related to the model (tests/migratins/class definition) and recreated it and it workd :/
[06:01:53] baweaver: has joined #RubyOnRails
[06:02:04] agoldboi: has joined #RubyOnRails
[06:02:13] jstransky: has joined #RubyOnRails
[06:05:37] IFrank00: has joined #RubyOnRails
[06:06:25] blackmesa: has joined #RubyOnRails
[06:07:41] ur5us: has joined #RubyOnRails
[06:09:46] SteenJobs: has joined #RubyOnRails
[06:10:40] jwang: has joined #RubyOnRails
[06:11:36] kirillzh: has joined #RubyOnRails
[06:12:36] DoctorMonocular: has joined #RubyOnRails
[06:17:46] tjbiddle: has joined #RubyOnRails
[06:21:42] ace05: has joined #RubyOnRails
[06:22:07] hashtd: has joined #RubyOnRails
[06:22:08] scope: has joined #RubyOnRails
[06:22:16] scope: hey guys how is everyone
[06:22:48] scope: quick question im trying to get the page title to say Name | Home
[06:22:59] scope: and i actualy want the |
[06:23:37] scope: in the rails console i tested this def full_title(page_title = '') 2.2.2 :002?> base_title = "Micro-Blog" 2.2.2 :003?> if page_title.empty? 2.2.2 :004?> base_title 2.2.2 :005?> else 2.2.2 :006 > "#{page_title} + '|' + #{base_title}" 2.2.2 :007?> end 2.2.2 :008?> end => :full_title
[06:23:49] scope: but the outcome is just full title
[06:23:57] scope: what am i doing wrong
[06:28:32] pyemkey: has joined #RubyOnRails
[06:28:43] chouhoulis: has joined #RubyOnRails
[06:28:56] rickmasta: has joined #RubyOnRails
[06:30:01] Devalo: has joined #RubyOnRails
[06:30:06] rafaelfranca: has joined #RubyOnRails
[06:30:34] rafaelfranca: has joined #RubyOnRails
[06:31:35] jeanlinux: has joined #RubyOnRails
[06:32:03] ace05: has joined #RubyOnRails
[06:33:17] Guest34101: has joined #RubyOnRails
[06:33:54] ur5us: has joined #RubyOnRails
[06:36:53] techsethi: has joined #RubyOnRails
[06:40:39] Rodya_: has joined #RubyOnRails
[06:41:12] jstransky: has joined #RubyOnRails
[06:42:06] scepticulous: has joined #RubyOnRails
[06:42:26] tsujp: has joined #RubyOnRails
[06:44:07] lyoshajapan: has joined #RubyOnRails
[06:50:44] tjbiddle: Would you that that if I have two models that are identical; with the only difference being they have one foreign key that's different - is that a sign I should have a polymorphic base model?
[06:55:30] scepticulous: has joined #RubyOnRails
[06:58:27] AntiSpamMeta: has joined #RubyOnRails
[07:01:10] nfk: has joined #RubyOnRails
[07:06:42] sp1rs: has joined #RubyOnRails
[07:08:25] blackmesa: has joined #RubyOnRails
[07:08:56] IFrank00: has joined #RubyOnRails
[07:10:37] nerium: has joined #RubyOnRails
[07:11:48] r00tl3ss: has joined #RubyOnRails
[07:11:48] Cervajz: has joined #RubyOnRails
[07:12:31] EasyRider0: has joined #RubyOnRails
[07:15:24] Chagel_: has joined #RubyOnRails
[07:17:51] sandstrom: has joined #RubyOnRails
[07:18:43] p1k: has joined #RubyOnRails
[07:19:23] p1k: how can I get the url for a controller action defined in routes I tried url_for(controller: <controller>, action: <action>) but that doesn't seem to work for custom routes
[07:19:31] rvanlieshout: has joined #RubyOnRails
[07:19:33] dionysus69: has joined #RubyOnRails
[07:20:38] lyoshajapan: p1k try running bundle exec rake routes | grep <controller> in the console
[07:21:31] lyoshajapan: then, taking the name of the route that you're intersted in and putting it in link_to(<name of route>_path)
[07:22:02] p1k: lyoshjapan: link_to isn't available inside action controller though is it?
[07:22:12] lyoshajapan: if there is no name to the route, you might want to specify in the routes.rb using the `as:` keyward
[07:24:20] p1k: won't let me as: a resource
[07:25:05] bga57: has joined #RubyOnRails
[07:25:14] Palsson: has joined #RubyOnRails
[07:25:28] solars: has joined #RubyOnRails
[07:25:59] lyoshajapan: you can you use <name of resource>_path ?
[07:26:28] djbkd: has joined #RubyOnRails
[07:27:25] p1k: ah yeah resource_path works
[07:27:53] sp1rs: has joined #RubyOnRails
[07:28:21] jas02: has joined #RubyOnRails
[07:28:45] p1k: idk why action_name works for .e.g create but not for custom resources though :o
[07:29:39] chouhoulis: has joined #RubyOnRails
[07:32:41] ayoros: has joined #RubyOnRails
[07:33:53] quazimodo: has joined #RubyOnRails
[07:34:09] DmitryBochkarev: has joined #RubyOnRails
[07:35:06] aganov: has joined #RubyOnRails
[07:35:12] defsdoor: has joined #RubyOnRails
[07:38:33] lyoshajapan: has joined #RubyOnRails
[07:39:58] fiver: has joined #RubyOnRails
[07:40:34] sp1rs1: has joined #RubyOnRails
[07:41:41] Rodya_: has joined #RubyOnRails
[07:47:12] baweaver: has joined #RubyOnRails
[07:49:05] Pazician: has joined #RubyOnRails
[07:49:05] Pazician: has joined #RubyOnRails
[07:49:56] ziyadb: has joined #RubyOnRails
[07:52:50] siaW: has joined #RubyOnRails
[07:54:28] yxejamir: has joined #RubyOnRails
[07:54:50] artto: has joined #RubyOnRails
[07:55:52] pawnbox: has joined #RubyOnRails
[07:55:58] lxsameer: has joined #RubyOnRails
[07:58:20] armyriad: has joined #RubyOnRails
[08:00:21] matthias_: has joined #RubyOnRails
[08:00:32] scepticulous: has joined #RubyOnRails
[08:01:26] ayoros: has joined #RubyOnRails
[08:03:46] Guest34101: has joined #RubyOnRails
[08:06:51] comrad: has joined #RubyOnRails
[08:08:10] mfaeh: has joined #RubyOnRails
[08:09:14] blackmesa: has joined #RubyOnRails
[08:11:17] quce: has joined #RubyOnRails
[08:11:32] rickmasta: has joined #RubyOnRails
[08:13:30] darutoko: has joined #RubyOnRails
[08:14:05] sandstrom: has joined #RubyOnRails
[08:15:07] Mia: has joined #RubyOnRails
[08:16:15] Palsson: has joined #RubyOnRails
[08:21:50] godzillaenlacasa: has joined #RubyOnRails
[08:22:28] moeabdol: has joined #RubyOnRails
[08:23:40] Palsson: has joined #RubyOnRails
[08:27:13] arup_r: has joined #RubyOnRails
[08:30:05] antgel: has joined #RubyOnRails
[08:30:34] chouhoulis: has joined #RubyOnRails
[08:30:46] mts_forever: has joined #RubyOnRails
[08:33:00] roshanavand: has joined #RubyOnRails
[08:33:03] mts_forever: in ROR context , setting a mongoid model class with rails g model .... I get "field" keywords, where can I find documentation on this keyword?
[08:33:29] jeanlinux: has joined #RubyOnRails
[08:33:45] lyoshajapan: has joined #RubyOnRails
[08:33:45] baweaver: has joined #RubyOnRails
[08:33:57] jhass: http://www.rubydoc.info/gems/mongoid/Mongoid/Fields/ClassMethods#field-instance_method
[08:34:29] moeabdol1: has joined #RubyOnRails
[08:40:26] syf-revk: has joined #RubyOnRails
[08:42:31] Rodya_: has joined #RubyOnRails
[08:43:47] siaw_: has joined #RubyOnRails
[08:44:32] srinidhi: has joined #RubyOnRails
[08:49:26] Macaveli: has joined #RubyOnRails
[08:50:00] pawnbox: has joined #RubyOnRails
[08:50:29] Ergo: has joined #RubyOnRails
[08:51:25] chagel: has joined #RubyOnRails
[08:54:29] ace05: has joined #RubyOnRails
[08:54:54] kp666: has joined #RubyOnRails
[08:59:27] pawnbox: has joined #RubyOnRails
[08:59:51] pawnbox: has joined #RubyOnRails
[09:01:00] EasyRider0: has joined #RubyOnRails
[09:03:20] agent008: has joined #RubyOnRails
[09:05:20] tvw: has joined #RubyOnRails
[09:05:36] darkxploit: has joined #RubyOnRails
[09:07:27] Ropeney: has joined #RubyOnRails
[09:09:41] worknick: has joined #RubyOnRails
[09:09:51] jenrzzz: has joined #RubyOnRails
[09:09:57] blackmesa: has joined #RubyOnRails
[09:10:03] worknick: how can i call custom method from my cotrollers destroy action by passing it params.
[09:10:27] universa1: the same as with any other action?
[09:11:19] worknick: yeah but what about params?
[09:11:29] universa1: what about them?
[09:11:31] worknick: just method(:id => id)
[09:11:46] universa1: how do you use params in any other action?
[09:11:49] worknick: i want to pass params also to that custom method.
[09:12:01] worknick: universa1: in other actions they are passed by vies to action
[09:12:15] universa1: destroy is the same.
[09:12:19] drptbl: has joined #RubyOnRails
[09:12:25] worknick: i dont want to call destroy.
[09:12:40] universa1: def destroy; do_whatever_you_want_here; end
[09:12:46] n008f4g_: has joined #RubyOnRails
[09:13:06] jeanlinux: has joined #RubyOnRails
[09:13:22] worknick: see i have two methods in my controller def clearrate.... end and def destroy ... end. "inside" def destroy i have to call clearrate!
[09:13:25] worknick: along with params
[09:13:40] universa1: worknick: !code
[09:13:40] helpa: worknick: 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.
[09:14:24] worknick: its not a problem.
[09:14:33] worknick: its so simple.
[09:14:33] DoubleMalt: has joined #RubyOnRails
[09:14:42] worknick: just another method from destroy method.
[09:14:44] universa1: ok, then do it your own... if it is so simple.
[09:15:21] jsrn: has joined #RubyOnRails
[09:17:22] moeabdol: has joined #RubyOnRails
[09:18:26] blackhuey: has joined #RubyOnRails
[09:20:44] snowy: has joined #RubyOnRails
[09:22:28] sp1rs: has joined #RubyOnRails
[09:23:30] adac: has joined #RubyOnRails
[09:23:36] chagel: has joined #RubyOnRails
[09:23:41] mark2: has joined #RubyOnRails
[09:25:36] svkurowski: has joined #RubyOnRails
[09:29:13] chagel: has joined #RubyOnRails
[09:29:49] smoitra: has joined #RubyOnRails
[09:31:25] techsethi: has joined #RubyOnRails
[09:32:35] chouhoulis: has joined #RubyOnRails
[09:34:00] five5: has joined #RubyOnRails
[09:35:06] drptbl: has joined #RubyOnRails
[09:35:17] jenrzzz: has joined #RubyOnRails
[09:36:49] fiver: has joined #RubyOnRails
[09:37:13] marr: has joined #RubyOnRails
[09:37:59] solars: hi, anyone using rubycritic and knows if it can ignore things like 'Rails.logger' somehow? I couldn't find anything
[09:40:29] mfaeh: has joined #RubyOnRails
[09:40:41] marr: has joined #RubyOnRails
[09:42:36] mts_forever: found it : https://docs.mongodb.org/ecosystem/tutorial/mongoid-documents/#fields
[09:42:38] mrbubbles: has joined #RubyOnRails
[09:42:39] konsolebox: has joined #RubyOnRails
[09:44:06] duderonomy: has joined #RubyOnRails
[09:45:52] arBmind: has joined #RubyOnRails
[09:49:53] moep: has joined #RubyOnRails
[09:51:09] sandstrom: has joined #RubyOnRails
[09:53:13] moep: Can I configure dragonfly to not persist remote images to my data store on before_save and rather process it lazily on image access?
[09:53:55] tetraktys: has joined #RubyOnRails
[09:57:11] ferr: has joined #RubyOnRails
[09:57:25] uglybandersnatch: has joined #RubyOnRails
[09:58:51] Quintasan: Any ideas why am I getting NoMethodError (private method `permit' called for #<Devise::ParameterSanitizer:0x00000007109c10> when I am using "the lazy way" as in https://github.com/plataformatec/devise#strong-parameters
[09:59:58] ensyde__: has joined #RubyOnRails
[10:00:02] ayoros: has joined #RubyOnRails
[10:05:07] chagel: has joined #RubyOnRails
[10:06:30] universa1: Quintasan: you might need to look at the docs for the version of devise you're using
[10:06:44] universa1: Quintasan: the master branch docs have changed and diverged from the current release iirc
[10:06:51] universa1: someone else had a similar problem last week
[10:07:20] universa1: Quintasan: are you using devise 4?
[10:07:27] smoitra: has joined #RubyOnRails
[10:07:34] sandstrom: has joined #RubyOnRails
[10:07:42] Quintasan: universa1: I'm using devise-token-auth and it's probably a bug
[10:08:18] universa1: Quintasan: so your gemfile has an explicit reference to 4.0.0.rc1 or to the git master branch?
[10:08:32] lipoqil: has joined #RubyOnRails
[10:08:32] universa1: Quintasan: if you just have gem 'devise', you are using devise 3!
[10:09:11] Quintasan: universa1: No explicit reference to Devise, but I bet that devise_token_auth uses Devise 3. Thanks for pointing it out.
[10:09:11] universa1: Quintasan: open up Gemfile.lock and search for devise, and check the version!
[10:10:43] blackmesa: has joined #RubyOnRails
[10:12:25] dgncn: has joined #RubyOnRails
[10:22:45] sp1rs: has joined #RubyOnRails
[10:24:44] ayoros: has joined #RubyOnRails
[10:27:55] blackmesa: has joined #RubyOnRails
[10:28:02] fox_mulder_cp: has joined #RubyOnRails
[10:31:58] chagel: has joined #RubyOnRails
[10:33:20] chouhoulis: has joined #RubyOnRails
[10:33:24] futilegames: has joined #RubyOnRails
[10:42:33] chagel: has joined #RubyOnRails
[10:42:59] FooMunki: has joined #RubyOnRails
[10:43:55] arup_r: has joined #RubyOnRails
[10:44:03] Rodya_: has joined #RubyOnRails
[10:44:19] p1k: has joined #RubyOnRails
[10:45:21] baweaver: has joined #RubyOnRails
[10:45:54] workmad3: has joined #RubyOnRails
[10:46:08] arBmind1: has joined #RubyOnRails
[10:46:38] sandstrom: has joined #RubyOnRails
[10:49:25] Ergo^: has joined #RubyOnRails
[10:49:35] arBmind1: has joined #RubyOnRails
[10:49:43] sandstrom: has joined #RubyOnRails
[10:52:52] tsujp: has joined #RubyOnRails
[10:53:18] sandstrom: has joined #RubyOnRails
[10:53:37] sevenseacat: has joined #RubyOnRails
[10:57:04] Fernando-Basso: has joined #RubyOnRails
[10:58:06] ace05: has joined #RubyOnRails
[10:58:15] jenrzzz: has joined #RubyOnRails
[10:58:26] Tempesta: has joined #RubyOnRails
[11:00:42] EasyRider0: has joined #RubyOnRails
[11:05:50] Ropeney: has joined #RubyOnRails
[11:06:35] mfaeh: has joined #RubyOnRails
[11:10:43] ewnd9_: has joined #RubyOnRails
[11:14:38] techsethi: has joined #RubyOnRails
[11:14:57] artto: has joined #RubyOnRails
[11:15:51] lee0417: has joined #RubyOnRails
[11:16:30] ziyadb: has joined #RubyOnRails
[11:16:55] rodfersou: has joined #RubyOnRails
[11:19:53] tsujp: has joined #RubyOnRails
[11:24:45] scope: has joined #RubyOnRails
[11:24:48] smoitra: has joined #RubyOnRails
[11:25:33] scope_: has joined #RubyOnRails
[11:25:45] ldnunes: has joined #RubyOnRails
[11:30:38] DmitryBochkarev: has joined #RubyOnRails
[11:30:41] c355E3B: has joined #RubyOnRails
[11:30:58] artto: has joined #RubyOnRails
[11:34:06] chouhoulis: has joined #RubyOnRails
[11:34:17] delgiudices: has joined #RubyOnRails
[11:34:19] jottr: has joined #RubyOnRails
[11:37:32] Cervajz_: has joined #RubyOnRails
[11:38:22] sp1rs: has joined #RubyOnRails
[11:38:33] ruler_: has joined #RubyOnRails
[11:41:08] syf-revk: has joined #RubyOnRails
[11:43:17] ql6wlld: has joined #RubyOnRails
[11:43:56] ayoros: has joined #RubyOnRails
[11:45:51] Rodya_: has joined #RubyOnRails
[11:46:46] syf-revk: Having some trouble using the image helper to resize an image on a static page.
[11:47:06] syf-revk: Anyone know how I would go about setting a fixed height, but a dynamic width?
[11:47:50] fox_mulder_cp: syf-revk: may be img html tag and css for it...
[11:47:58] workmad3: syf-revk: how are you trying to set it currently?
[11:48:19] bibek22: has joined #RubyOnRails
[11:48:45] bibek22: has left #RubyOnRails: ("Leaving")
[11:48:57] syf-revk: workmad3: basically just tried resizing in gimp and stretching by changing the :width of the image tag
[11:49:49] syf-revk: Essentially I'd like to use a much larger image as a 'base' that stretches width depending on the user's resolution/display, but that could have a static height (maybe by being cropped)?
[11:50:12] syf-revk: Haven't been able to find much documentation on it, mostly just found other cloud-type services advertising their product. But I'm probably looking in the wrong places.
[11:51:51] techsethi_: has joined #RubyOnRails
[11:52:49] syf-revk: fox_mulder_cp: thanks, it looks like that would probably be the best way to do it.
[11:53:33] tetraktys: has joined #RubyOnRails
[11:53:47] jammanbo: has joined #RubyOnRails
[11:54:13] drptbl: has joined #RubyOnRails
[11:55:29] arup_r: has joined #RubyOnRails
[11:57:39] fox_mulder_cp: glad to help u
[11:59:05] ace05: has joined #RubyOnRails
[11:59:24] qejk: has joined #RubyOnRails
[11:59:58] jammanbo: I've got a PORO called Results and a subclass Adapter::Results < ::Results. What would I have to do to make an Adapter::Results use my ResultsSerializer < ActiveModel::Serializer? I'd like to use the same serializer for all Result classes.
[12:03:51] darkxploit: has joined #RubyOnRails
[12:06:13] Pathfinder: has joined #RubyOnRails
[12:10:03] finnnnnnnnnnn: has joined #RubyOnRails
[12:14:06] mfaeh: has joined #RubyOnRails
[12:17:22] banister: has joined #RubyOnRails
[12:17:40] antgel: has joined #RubyOnRails
[12:17:45] finnnnnnnnnnn: I have an active record set which I got using Model.where(key: key).limit(5).order(id: :desc). How can I test that the Ids in the set are consecutive?
[12:19:17] rvanlieshout: finnnnnnnnnnn: why would you care?
[12:20:14] finnnnnnnnnnn: rvanlieshout: I’m saving records in batches, I want to make sure that this set are a part of a certain batch.
[12:20:29] rvanlieshout: and having an consecutive id does that?
[12:20:37] finnnnnnnnnnn: it’s brittle, but yeah
[12:21:30] rvanlieshout: imo it's wrong
[12:21:45] rvanlieshout: you should compare the difference pre and post executing a batch
[12:21:54] finnnnnnnnnnn: how is it wrong?
[12:22:08] rvanlieshout: id generation is a db task
[12:22:11] rvanlieshout: and it could be consecutive
[12:22:29] rvanlieshout: but it's not really required nor is it part of you really want to test
[12:22:36] finnnnnnnnnnn: yeah, true enough
[12:22:49] finnnnnnnnnnn: what I’m trying to do..
[12:22:59] apeiros: finnnnnnnnnnn: you realize that the order and limit are part of the same query, so the id is guaranteed to be ordered?
[12:23:22] apeiros: oh, consecutive, not just ordered
[12:23:38] apeiros: .each_slice(2) { |a,b| a.id+1 == b.id }
[12:23:42] rvanlieshout: but find other ways
[12:24:06] apeiros: but IMO rvanlieshout is pointing out the right thing
[12:24:10] finnnnnnnnnnn: rvanlieshout: will do
[12:24:23] rvanlieshout: do you save that it's part of 'a batch'?
[12:24:49] finnnnnnnnnnn: nah, I don’t
[12:24:52] finnnnnnnnnnn: that’s the issue really
[12:24:57] rvanlieshout: then what exactly do you want to test?
[12:25:28] finnnnnnnnnnn: you’re right, I need to save a reference to the batch
[12:25:38] finnnnnnnnnnn: I’ll do that
[12:27:15] siaW: has joined #RubyOnRails
[12:28:18] lyoshajapan: has joined #RubyOnRails
[12:29:08] stannard: has joined #RubyOnRails
[12:30:14] blackmesa: has joined #RubyOnRails
[12:31:08] tetraktys: has joined #RubyOnRails
[12:31:26] jeanlinux: has joined #RubyOnRails
[12:32:51] artto: has joined #RubyOnRails
[12:33:14] armyriad: has joined #RubyOnRails
[12:34:57] chouhoulis: has joined #RubyOnRails
[12:41:18] daveomcd: has joined #RubyOnRails
[12:42:31] EasyRider0: has joined #RubyOnRails
[12:43:22] artto: has joined #RubyOnRails
[12:43:42] nettoweb: has joined #RubyOnRails
[12:43:47] daveomcd: I have a User model and a Reports model. Based on the role of the user I want to limit which reports they can see. A manager can see everyone's reports, employee can only see their own reports, etc. What's the best way to do this where I don't have to put in a bunch of if/else statements every time I want to show reports?
[12:44:38] daveomcd: I was going to try doing a scope and pass the current_user.role, but don't think that's possible without additional gems, which makes me think that its likely not the best way -- would I possibly use a method on the User model?
[12:44:55] artto: has joined #RubyOnRails
[12:44:58] IFrank00: has joined #RubyOnRails
[12:45:51] worknick: daveomcd: cancan?
[12:46:22] worknick: oh without additional gem
[12:47:01] worknick: daveomcd: why not just extra column to store user.role and checking if user.role?
[12:47:26] Rodya_: has joined #RubyOnRails
[12:48:08] daveomcd: worknick, well I'm tagging my users so I have that, but right now I have 6 or 7 different possibilities. I'm trying to avoid having to do several if/else statements for each role when display a list of reports. If that makes sense?
[12:48:13] techsethi: has joined #RubyOnRails
[12:48:14] artto_: has joined #RubyOnRails
[12:49:30] daveomcd: tagging my users = roles for users
[12:51:25] workmad3: daveomcd: I'd personally go with authorizer-type objects, along with a method on the user that takes an action, an authorizer and a model instance or class and uses those to determine if the user can perform an action
[12:51:44] workmad3: daveomcd: so you end up with code like `current_user.can? :read, SomeModel, with: SomeAuthorizer`
[12:52:04] njero: has joined #RubyOnRails
[12:52:25] workmad3: daveomcd: you can use naming conventions, etc. to make the authorizer somewhat implicit... or you could use a gem like pundit/authority to give you the framework for that sort of setup
[12:52:25] daveomcd: workmad3, ok let me look into that. thanks
[12:53:00] jhass: I think they want something simple as class User; def visible_reports; role == MANAGER ? Report.all : reports; end; end; current_user.visible_reports
[12:53:54] augcesar: has joined #RubyOnRails
[12:54:09] workmad3: daveomcd: but the general principle is easy enough to implement yourself... you have an object that represents your authorization rules, and it takes in a user, an action and the object or class you're interested in, and lets you know if the rules allow that action... then you can use that instead of dozens/hundreds of if/else checks against roles directly throughout your codebase :)
[12:54:12] daveomcd: jhass, ya maybe that's a way to go. I was looking for something simpler, just didn't know the best way of organizing it. I'll look into both ways I appreciate the help and discussing the different options
[12:56:48] njero: has joined #RubyOnRails
[12:58:14] sandstrom: has joined #RubyOnRails
[12:59:46] ace05: has joined #RubyOnRails
[13:03:59] techsethi: has joined #RubyOnRails
[13:04:01] quazimodo: has joined #RubyOnRails
[13:05:55] siaW: has joined #RubyOnRails
[13:07:46] blackmesa: has joined #RubyOnRails
[13:09:11] stannard: has joined #RubyOnRails
[13:12:35] cabinB: has joined #RubyOnRails
[13:16:49] chagel: has joined #RubyOnRails
[13:17:56] mfaeh: has joined #RubyOnRails
[13:19:03] gbgdev: has joined #RubyOnRails
[13:20:28] gbgdev: hi guys... i need to make a performance/stress test on a service that i made.
[13:20:36] gbgdev: Do you guys recommend some gems to do it?
[13:21:18] gbgdev: i am thinking about use rspec with rspec-prof gem. But this kind of tests can conflict with my unit tests
[13:21:49] gbgdev: i want it executes in a separate way
[13:22:16] gbgdev: (when i execute my unit tests, the performance test don't run)
[13:22:50] brunto: has joined #RubyOnRails
[13:23:12] arup_r: has joined #RubyOnRails
[13:24:24] chagel: has joined #RubyOnRails
[13:26:01] krz: has joined #RubyOnRails
[13:26:39] sp1rs: has joined #RubyOnRails
[13:26:59] mostlybadfly: has joined #RubyOnRails
[13:27:56] DragonPunch: has joined #RubyOnRails
[13:28:56] shanemcd: has joined #RubyOnRails
[13:29:54] sp1rs: has joined #RubyOnRails
[13:31:27] DragonPunch: has joined #RubyOnRails
[13:31:44] _bogus_: has joined #RubyOnRails
[13:31:44] _bogus_: has joined #RubyOnRails
[13:31:51] marr: has joined #RubyOnRails
[13:32:15] shanemcd: has joined #RubyOnRails
[13:33:20] artto: has joined #RubyOnRails
[13:35:32] bbrowning: has joined #RubyOnRails
[13:35:41] chouhoulis: has joined #RubyOnRails
[13:36:42] Megamos: has joined #RubyOnRails
[13:37:45] arup_r: yes, _bogus_
[13:38:24] SteenJobs: has joined #RubyOnRails
[13:38:42] sp1rs: has joined #RubyOnRails
[13:39:33] _bogus_: how can I assure a model with a has_many association will have always a fixed number of objects? like, User has always 4 Cars ? For now i'm using a bad solution in the view with <% 4.times do %> for the fields_for, and having some problems btw as it's probably not the best approach
[13:41:51] rvanlieshout: _bogus_: add it as a validation?
[13:42:59] stannard: has joined #RubyOnRails
[13:43:53] _bogus_: rvanlieshout, no, because the user can't see an error about this, it must be invisible... actually the way I'm doing it was working not that bad, except when it's a new form and the user submits it and get validation errors, then the 4 objects that I created returns and the form shows 4*4 fields for it
[13:44:13] _bogus_: but the way i'm doing it isnt the best way to do this probably
[13:44:14] rvanlieshout: then don't display it? :)
[13:44:55] _bogus_: but if there
[13:45:32] rvanlieshout: then still don't display it if you don't want to display it
[13:45:35] _bogus_: but if there's an error with validation the model wont save. not displaying it will bring the user to the form again, even if im not showing any errors
[13:46:13] sandstrom: has joined #RubyOnRails
[13:46:23] _bogus_: actually my worry is not about checking for a number of "has many" objects
[13:46:44] _bogus_: my worry is about to create those objects when creating the model
[13:46:56] mfaeh: has joined #RubyOnRails
[13:47:02] rvanlieshout: what's the issue with that?
[13:47:06] _bogus_: using the Model.field.build , the fields_for shows fields for only 1 object
[13:47:28] _bogus_: but if im editing this object, and there's more than 1 object, it shows it that many times
[13:48:17] _bogus_: or if i submit my form and there's errors on it, but i submitted 4 objects, those 4 objects will return to the form along with the errors
[13:48:20] rvanlieshout: i think you need to read about how this works
[13:48:54] Rodya_: has joined #RubyOnRails
[13:49:09] _bogus_: the build method ?
[13:50:24] finnnnnnnnnnn: Should this be returning true? Foo.order(created_at: :asc).first == Foo.order(created_at: :desc).first
[13:51:03] rvanlieshout: finnnnnnnnnnn: nope
[13:51:12] rvanlieshout: not if you have 2 Foo'swith the same created_at
[13:51:40] finnnnnnnnnnn: thought not, something’s up with my db
[13:52:52] finnnnnnnnnnn: Foo.order(created_at: :desc).first and Foo.order(created_at: :asc).first are the same thing!
[13:53:24] rvanlieshout: then read about identity mapping (iirc that's the name) and why they didn't include it
[13:53:24] finnnnnnnnnnn: something’s up with the ordering
[13:54:14] sp1rs: has joined #RubyOnRails
[13:55:01] rvanlieshout: finnnnnnnnnnn: because?
[13:55:14] finnnnnnnnnnn: rvanlieshout: no idea at all
[13:55:41] rvanlieshout: then why do you think it's wrong?
[13:55:55] rvanlieshout: then why do you think it's wrong?
[13:55:57] _bogus_: rvanlieshout, i did it already tho i am still not sure about how to solve this problem... there seems to be a nice way doing it on the controller: apparently, calling 4 times the Object.field.build method, maybe this is a better way to do this on the controller's new method?
[13:56:38] czerasz: has joined #RubyOnRails
[13:57:11] rvanlieshout: _bogus_: there is nothing wrong with calling that method 4 times (in a 4.times loop)
[13:57:36] ramortegui: has joined #RubyOnRails
[13:57:47] finnnnnnnnnnn: rvanlieshout: why do I think it’s wrong? Because Foo.all.order(created_at: :desc)[0] == Foo.all.order(created_at: :asc)[0] is true and I thought the ordering would ensure that it’s not.
[13:57:53] _bogus_: yeah, I was calling it from inside the views, so I was getting trouble sometimes... but this seems to be a better approach
[13:58:13] finnnnnnnnnnn: rvanlieshout: Test.all.length is 100
[13:58:34] czerasz: hi, how to run capistrano in interactive mode - I want to be asked what to do with each command
[13:58:40] rvanlieshout: finnnnnnnnnnn: they just aren't the same object
[13:59:06] rvanlieshout: rails had an identity map
[13:59:15] rvanlieshout: for that. has issues, so it's not included by default
[13:59:16] rvanlieshout: read about it
[14:00:16] finnnnnnnnnnn: rvanlieshout: will check it out
[14:00:22] SeanLazer: has joined #RubyOnRails
[14:00:35] ace05: has joined #RubyOnRails
[14:02:21] finnnnnnnnnnn: ok, I think I need to go back to basics. How can I get the last five records saved using a where? Foo.where(key: key).limit(5).order(id: :asc)
[14:02:56] apeiros: rvanlieshout: I think you're misreading the question. finnnnnnnnnnn queries the first and last record and expects them to differ. but they're equal. that's unrelated to identity maps.
[14:02:59] rvanlieshout: finnnnnnnnnnn: what exactly is the problem?
[14:03:24] apeiros: finnnnnnnnnnn: created_at for those two records is not null? and created_at is not equal for those two records?
[14:03:51] dede: has joined #RubyOnRails
[14:04:03] finnnnnnnnnnn: thanks for the help but perhaps best ignoring my created_at problem
[14:04:09] flashpoint9: has joined #RubyOnRails
[14:04:22] flashpoint9: has joined #RubyOnRails
[14:04:25] finnnnnnnnnnn: more important is simply getting the last five records saved while using a where
[14:04:32] p8m: has joined #RubyOnRails
[14:04:33] finnnnnnnnnnn: I thought where(key: key).limit(5).order(id: :asc) would do it
[14:04:42] rvanlieshout: and it didn't?
[14:05:16] apeiros: finnnnnnnnnnn: id is not necessarily in the order the records were saved
[14:05:17] pawnbox: has joined #RubyOnRails
[14:05:38] apeiros: f.ex. oracle will prefetch sequences per connection
[14:05:57] finnnnnnnnnnn: then this? where(key: key).limit(5).order(created_at: :asc)
[14:06:04] apeiros: that will get you the first 5
[14:06:46] apeiros: then yes, that should get you the last 5 records saved having the given key.
[14:07:25] chipotle: has joined #RubyOnRails
[14:07:56] finnnnnnnnnnn: apeiros: and based on that the first item in the return should be the most recent?
[14:08:17] apeiros: the most recently created
[14:08:37] apeiros: oh, by "saved", you did mean "created", right? because usually I'd assume saved = "created or updated"
[14:09:19] finnnnnnnnnnn: apeiros: I meant created
[14:09:43] nerium: has joined #RubyOnRails
[14:18:11] tetraktys: has joined #RubyOnRails
[14:20:25] scope: has joined #RubyOnRails
[14:21:00] czerasz: has joined #RubyOnRails
[14:21:13] aegis3121: has joined #RubyOnRails
[14:21:28] siaW: has joined #RubyOnRails
[14:21:38] drbayer: has joined #RubyOnRails
[14:22:31] roshanavand: has joined #RubyOnRails
[14:23:32] czerasz: does capistrano support something like step in ansible? http://docs.ansible.com/ansible/playbooks_startnstep.html#step
[14:26:12] tsujp: has joined #RubyOnRails
[14:26:41] mrgreenfur: has joined #RubyOnRails
[14:26:52] chouhoulis: has joined #RubyOnRails
[14:27:44] artto_: has joined #RubyOnRails
[14:29:55] DragonPunch: has joined #RubyOnRails
[14:29:59] sandstrom: has joined #RubyOnRails
[14:31:38] rafaelfranca: has joined #RubyOnRails
[14:32:44] chouhoulis: has joined #RubyOnRails
[14:33:54] RockLee: has joined #RubyOnRails
[14:35:22] EasyRider0: has joined #RubyOnRails
[14:36:19] konsolebox: has joined #RubyOnRails
[14:38:40] siaW: question on scope
[14:38:42] siaW: i have this
[14:38:43] siaW: https://gist.github.com/siaw23/1c88d008d788dfcadc99
[14:39:06] scope: 1 sec i'll check
[14:39:14] siaW: i expect it to list the account in descending order, meaning oldest account first
[14:39:23] bmalum: has joined #RubyOnRails
[14:39:30] siaW: so in the index action i call the scope and #all
[14:39:37] siaW: it should work right? well it’s not working
[14:39:44] siaW: anything i’m doing wrong?
[14:39:46] scepticulous: has joined #RubyOnRails
[14:40:10] fmcgeough: has joined #RubyOnRails
[14:40:29] scope: have you tryed using the rails console to see the error report
[14:40:37] scope: do you get any error
[14:42:47] DmitryBochkarev: has joined #RubyOnRails
[14:43:38] siaW: i should call the scope on the class
[14:43:43] siaW: and not #all
[14:44:50] jeanlinux: has joined #RubyOnRails
[14:46:35] rrawlins: has joined #RubyOnRails
[14:46:59] flashpoint9: has joined #RubyOnRails
[14:47:13] baweaver: has joined #RubyOnRails
[14:47:41] banister: has joined #RubyOnRails
[14:48:45] aegis3121: has joined #RubyOnRails
[14:48:52] sonofdirt: has joined #RubyOnRails
[14:49:36] rubyonrailed: has joined #RubyOnRails
[14:50:23] Rodya_: has joined #RubyOnRails
[14:51:51] rrawlins: Hey Gang. Working with empty strings submitted by the user, do you prefer to store them as empty strings in the DB? Or nillify them using something like the nilify_blanks gem?
[14:52:35] nfk: has joined #RubyOnRails
[14:53:31] trosborn: has joined #RubyOnRails
[14:54:16] artto: has joined #RubyOnRails
[14:54:32] lyoshajapan: has joined #RubyOnRails
[14:54:34] yellow5: has joined #RubyOnRails
[14:55:12] jayp: has joined #RubyOnRails
[14:55:13] stannard: has joined #RubyOnRails
[14:55:33] adavia: has joined #RubyOnRails
[14:55:56] delgiudices: has joined #RubyOnRails
[14:57:02] banister: has joined #RubyOnRails
[14:58:38] nicnilov: has joined #RubyOnRails
[14:58:49] stannard: has joined #RubyOnRails
[14:59:27] sonofdirt: has joined #RubyOnRails
[15:01:11] ace05: has joined #RubyOnRails
[15:01:49] griffindy: has joined #RubyOnRails
[15:03:38] rafaelfranca: has joined #RubyOnRails
[15:03:57] maxz: has joined #RubyOnRails
[15:03:58] dopamean_: has joined #RubyOnRails
[15:04:05] jhass: slight preference to the former (always store user input as unmodified as possible, modify on render/output/usage), but can't say I can generalize it and replacing them by null is invalid in all usecases
[15:04:14] ikarius: has joined #RubyOnRails
[15:04:41] HalcyonicStorm: has joined #RubyOnRails
[15:04:43] IrishGringo: has joined #RubyOnRails
[15:04:45] rrawlins: jhass: thanks, that seems like a logical approach to me also.
[15:05:52] n008f4g_: has joined #RubyOnRails
[15:06:06] SeanLazer: does anyone know what the correct procedure is with the apartment gem if i want to move an existing model into the excluded_models list?
[15:06:13] emachnic: has joined #RubyOnRails
[15:06:31] SeanLazer: i'm not sure what i need to do to update the schema
[15:06:50] maxz: has joined #RubyOnRails
[15:09:09] mfaeh: has joined #RubyOnRails
[15:10:17] ryanRT: has joined #RubyOnRails
[15:10:28] jscheel: has joined #RubyOnRails
[15:12:44] shanemcd: has joined #RubyOnRails
[15:14:37] techsethi: has joined #RubyOnRails
[15:17:25] sandstrom: has joined #RubyOnRails
[15:17:27] balexander: has joined #RubyOnRails
[15:18:19] jstew: has joined #RubyOnRails
[15:19:14] AntiSpamMeta: has joined #RubyOnRails
[15:20:39] stannard: has joined #RubyOnRails
[15:22:18] B1n4r10: has joined #RubyOnRails
[15:22:18] statelesscode: has joined #RubyOnRails
[15:22:53] axl_: has joined #RubyOnRails
[15:24:50] crst: has joined #RubyOnRails
[15:25:42] dEPy: has joined #RubyOnRails
[15:26:04] crst: Hi guys, pretty dumb noob question here: How exactly can I add enable_extension "pg_trgm" in my rails app. Do I need to generate something first?
[15:26:29] lyoshajapan: has joined #RubyOnRails
[15:27:21] EdwardIII: crst: is it in your gemfile?
[15:27:46] fox_mulder_cp: crst: u can do it by migrstion, or plain sql code
[15:27:54] crystal77: has joined #RubyOnRails
[15:29:21] EdwardIII: if i want to get access to a controller method in my erb file, should i implement ActiveSupport::Concern ?
[15:29:35] EdwardIII: i should probably say "include ActiveSupport::Concern on my controller?"
[15:29:40] moeabdol: has joined #RubyOnRails
[15:29:42] EdwardIII: looks like normal methods aren't accessible in erb
[15:30:31] crst: EdwardIII: No, I think there is no gem for this. fox_mulder_cp: In my psql console I alreade added: CREATE EXTENSION IF NOT EXISTS pg_trgm; bu I have no Idea if it is working. I manually added it in schema.rb, but I disappears after rake db:migrate
[15:31:16] mary5030: has joined #RubyOnRails
[15:31:23] EdwardIII: oh, i should just use helper_method i think
[15:31:55] EdwardIII: ah no, i should just put the methods on app/helpers/mycontroller_helper.rb i think
[15:32:17] Rodya_: has joined #RubyOnRails
[15:32:38] mary5030: has joined #RubyOnRails
[15:33:09] EdwardIII: yes, that's it
[15:34:53] stannard: has joined #RubyOnRails
[15:37:28] tbuehlmann: crst: you would add a migration and call `enable_extension('pg_trgm')` in it (http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html#method-i-enable_extension)
[15:39:22] DragonPunch: has joined #RubyOnRails
[15:39:28] red_horned_rihno: has joined #RubyOnRails
[15:39:37] arup_r: has joined #RubyOnRails
[15:39:50] scope: has joined #RubyOnRails
[15:40:11] gbgdev: has joined #RubyOnRails
[15:41:05] crst_alt: has joined #RubyOnRails
[15:41:18] diegoviola: has joined #RubyOnRails
[15:41:22] crst_alt: tbuehlmann: So in effect I type: `rails g migration enable_extension('pg_trgm')` and then `rails db:migrate`. Am I right?
[15:42:50] crst_alt: has left #RubyOnRails: ()
[15:43:17] tbuehlmann: `$ bin/rails generate migration EnablePgTrgmExtension` and add the method call to it, then migrate it
[15:43:32] mag42c: has joined #RubyOnRails
[15:43:55] DragonPunch: Does ruby automatically include jqUERY?
[15:43:56] crst: has joined #RubyOnRails
[15:44:04] tbuehlmann: per default, yes
[15:44:23] scope: hey guys this is off topic but a security update... If you are on mac os x and downloaded transmission check your version if 2.90 you need to fix it fast if anyone is unsure let me know ill walk you through it
[15:44:24] sp1rs: has joined #RubyOnRails
[15:44:25] DragonPunch: why can't isee the jquery file/href in my assets directory
[15:44:38] scope: you have 3 days before KeRanger is activated
[15:45:23] crst: has joined #RubyOnRails
[15:45:36] crst: tbuehlmann: So in effect I type: `rails g migration enable_extension('pg_trgm')` and then `rails db:migrate`. Am I right?
[15:45:48] DragonPunch: so by default, it's coffee script and scss how can i turn that off?
[15:45:58] tbuehlmann: DragonPunch, the file itself is located in the jquery-rails gem: https://github.com/rails/jquery-rails/tree/master/vendor/assets/javascripts
[15:46:27] tbuehlmann: crst, no. as I wrote above
[15:46:49] mfaeh: has joined #RubyOnRails
[15:47:01] crst: tbuehlmann: Sorry, I was having connection issues. Can you show it to me again?
[15:47:15] tbuehlmann: sure: `$ bin/rails generate migration EnablePgTrgmExtension` and add the method call to it, then migrate it
[15:47:52] scope_: has joined #RubyOnRails
[15:47:57] crst: cool, thank you!
[15:48:16] arup_r: hi tbuehlmann. :)
[15:49:09] tbuehlmann: you got this, I'm leaving now. bye!
[15:49:13] Pathfinder: has joined #RubyOnRails
[15:49:55] DragonPunch: does anyone know if i can write vanilla javascript/css into .coffee and .scss ?
[15:50:31] DragonPunch: also, how do i turn scss and coffee OFF so that when i generate my new controllers, it will suffix the files with normal css/js
[15:50:47] pvertenten: has joined #RubyOnRails
[15:51:44] EdwardIII: heh this is odd, just trying to throw together a project in /tmp/ to show an issue, but 'rails g controller Welcomer index about' seems to be just hanging (mac osx )
[15:52:24] arup_r: DragonPunch: you can change that settings, so that you get always .css and .js
[15:52:29] EdwardIII: ACTION creates it with a new name
[15:52:32] EdwardIII: seems to work now
[15:52:33] tubbo: DragonPunch: just remove the gems from your Gemfile
[15:52:37] DragonPunch: tubbo: thanks
[15:52:46] rrawlins_: has joined #RubyOnRails
[15:52:53] tubbo: i think when you generate new rails apps you can also --skip-coffee
[15:52:54] arup_r: what gem?
[15:54:06] arup_r: ok. so creating new rails app by default choose coffee and sass, I didn't know.. Or I may forgot, because long time I didn't run any rails new some_new_business .. all old projects I am working on. haha
[15:55:16] uglybandersnatch: has joined #RubyOnRails
[15:56:10] scope: has joined #RubyOnRails
[15:58:10] techsethi: has joined #RubyOnRails
[15:58:48] stannard: has joined #RubyOnRails
[15:58:56] DragonPunch: what does the syntax/format look like when adding javascript to the application.js file
[15:59:32] arup_r: DragonPunch: lets create a scaffold rails app.
[15:59:42] arup_r: and then check there, how it looks like
[15:59:53] DragonPunch: arup_r well, it's just a require then i think a gem name atm
[16:00:49] arup_r: i don't know what you mean... do what you think better.
[16:01:54] ace05: has joined #RubyOnRails
[16:01:55] DragonPunch: how do i include an external javascript file to application.js would probably be a better question
[16:02:18] EdwardIII: grr this is weird
[16:02:42] EdwardIII: i created an empty project to replicate my turbolinks-not-firing-events-issue, but of course, on the plain app the issue doesn't happen
[16:03:20] EdwardIII: but this is the first custom js i've added so far in the project, they should be pretty damn similar
[16:03:59] EdwardIII: ah i did include bootstrap
[16:04:18] EdwardIII: well, the bootstrap rails pack thing
[16:05:34] Cervajz_: has joined #RubyOnRails
[16:06:16] sonofdirt: has joined #RubyOnRails
[16:07:15] scepticulous: has joined #RubyOnRails
[16:08:32] sandstrom: has joined #RubyOnRails
[16:08:36] tubbo: DragonPunch: !assets
[16:08:36] helpa: DragonPunch: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[16:08:55] mDuff: has joined #RubyOnRails
[16:08:57] tubbo: DragonPunch: you know about guides.rubyonrails.org right? most of the questions you've asked so far can be solved by reading them, especially the one involving getting started.
[16:08:59] yellow5: has joined #RubyOnRails
[16:09:47] EdwardIII: ah wait, it's my expectations that are to blame
[16:09:59] EdwardIII: dumb. i'm expecting forms with GET to use turbolinks, but they aren't links
[16:10:04] EdwardIII: so it doesn't heh
[16:10:10] shanemcd: has joined #RubyOnRails
[16:10:37] Devalo: has joined #RubyOnRails
[16:13:47] chouhoulis: has joined #RubyOnRails
[16:15:10] nerium: has joined #RubyOnRails
[16:16:26] makerops: has joined #RubyOnRails
[16:17:26] makerops: in a SOA collection of apps, is it stupid to have "end user" apps, authenticate against the same mechanism as the Apps in the service?
[16:18:08] zave: has joined #RubyOnRails
[16:18:27] makerops: ie, I want end users to be able to write command line clines for the app, but I also want a Web front end for them to sign up and pay
[16:19:07] Rodya_: has joined #RubyOnRails
[16:19:20] arup_r: has joined #RubyOnRails
[16:19:58] CodaBrink: has joined #RubyOnRails
[16:22:17] jmignault: has joined #RubyOnRails
[16:22:24] tubbo: makerop_: kinda depends on how granular your authorization is/needs to be, and whether the same requirements exist for both service and end-user client
[16:22:34] shinnya: has joined #RubyOnRails
[16:22:57] makerops: tubbo: there will be very little where the requirements don't overlap
[16:23:18] makerops: ie, the only thing I can see differing is stuff that relates to monthly plans etc
[16:23:46] makerops: basically, I was going to use rails 5.0, --api, with doorkeeper/devise, and setup namespaces for admin, public
[16:24:23] EdwardIII: hrm, is there not a way to make remote: true on forms use GET rather than POST for the xhr?
[16:24:37] makerops: all the other apps that I create will use the admin namespaces, and then I'll reduce the functionality exposed in the API via public
[16:24:42] EdwardIII: when i do method: 'get', it seems to turn off remote: true
[16:25:14] EdwardIII: eh ok weird, i swapped the order of args around and now it seems to work. uses xhr & get
[16:27:59] adavia: has joined #RubyOnRails
[16:28:09] KensoDev: has joined #RubyOnRails
[16:28:20] qejk: has joined #RubyOnRails
[16:28:26] techsethi: has joined #RubyOnRails
[16:28:31] EdwardIII: now i just need to figure out why it's saying 'Turbolinks.replace is not a function' when my script is called after tubolinks, when afaik i'm running the exact same version as https://github.com/turbolinks/turbolinks-classic and i copied & pasted from the readme..
[16:28:48] scope: has joined #RubyOnRails
[16:28:55] disgrntld: has joined #RubyOnRails
[16:29:45] scope_: has joined #RubyOnRails
[16:30:19] finnnnnnnnnnn: has joined #RubyOnRails
[16:31:02] mfaeh: has joined #RubyOnRails
[16:31:37] gabeodess: has joined #RubyOnRails
[16:33:46] yellow5: has joined #RubyOnRails
[16:33:48] AzaToth: has joined #RubyOnRails
[16:34:35] EdwardIII: hrm although that kind of isn't even what i want to do
[16:34:47] EdwardIII: it's a GET form, so i want the url to change to match the params so it'll work if they bookmark it or email it or whatever
[16:35:03] EdwardIII: to ajax:success stuff doesn't seem to really do what i want
[16:36:01] Rodya_: has joined #RubyOnRails
[16:36:40] EdwardIII: how do you guys handle this?
[16:36:43] scope: has joined #RubyOnRails
[16:36:46] arup_r: has joined #RubyOnRails
[16:38:27] maxz: has joined #RubyOnRails
[16:40:33] scope_: has joined #RubyOnRails
[16:46:23] mrgreenfur: is it recommended in rails 4.2+ to change the session_store in production?
[16:48:16] EdwardIII: ah it looks like all that .replace & form handling helper stuff isn't available in 2.5-stable
[16:48:27] SteenJobs: has joined #RubyOnRails
[16:48:47] baweaver: has joined #RubyOnRails
[16:48:50] EdwardIII: but it is in master? but then the big header on master says: "Turbolinks Classic is now deprecated" - this is kinda confusing heh
[16:49:20] matthewd: mrgreenfur: Have you seen a recommendation to do so?
[16:49:45] Macaveli: has joined #RubyOnRails
[16:50:00] Cervajz__: has joined #RubyOnRails
[16:50:21] flashpoint9: has joined #RubyOnRails
[16:51:27] fedexo: has joined #RubyOnRails
[16:52:13] nettoweb: has joined #RubyOnRails
[16:52:14] EdwardIII: it's confusing because turbolinks is deprecated, but turbolinks 5 is in beta
[16:52:20] EdwardIII: am i not getting something?
[16:53:05] pixelhandler: has joined #RubyOnRails
[16:53:10] tubbo: EdwardIII: haha no, we're all just as confused as you are.
[16:54:09] mrgreenfur: matthewd: I have not. But i see the option and many examples of how to change it to use redis/database/etc. I also see in older versions there was security problems with it.
[16:54:14] EdwardIII: heh ok well that makes me feel slightly better
[16:54:23] EdwardIII: i might try beta2 as it looks like it does a lot of stuff we need
[16:54:45] EdwardIII: well, i'm not sure whether to use classic's master branch, or turbolinks 5's latest beta
[16:55:12] mrgreenfur: turbolinks is deprecated?
[16:55:40] EdwardIII: mrgreenfur: https://github.com/turbolinks/turbolinks-classic#turbolinks-classic-is-now-deprecated
[16:56:02] mrgreenfur: EdwardIII: ah, thanks!
[16:56:46] shanemcd: has joined #RubyOnRails
[16:58:14] matthewd: EdwardIII: Classic's master branch is not destined to be released
[16:59:44] EdwardIII: that sounds like it's a bad candidate for use then
[17:00:01] EdwardIII: i just want to make turbolinks DWIM with a GET form to be clear
[17:00:11] EdwardIII: i.e. follow the link, show th eresults
[17:00:59] KensoDev: has joined #RubyOnRails
[17:01:05] EdwardIII: this sounds like what i want: https://github.com/turbolinks/turbolinks#redirecting-after-a-form-submission
[17:03:00] mrgreenfur: so erm, no one changes the session_store these days right?
[17:03:17] tubbo: mrgreenfur: false.
[17:03:49] mrgreenfur: tubbo: so i should use redis for sessions?
[17:04:32] abracadaniel: has joined #RubyOnRails
[17:04:53] arthurix_: has joined #RubyOnRails
[17:05:04] EdwardIII: hrm actually no this isn't what i want: https://github.com/turbolinks/turbolinks#redirecting-after-a-form-submission
[17:05:13] EdwardIII: this sounds like redirecting to a new resource after a POST, i want to just follow the GET url
[17:05:15] tubbo: mrgreenfur: i can't tell you what to do :)
[17:05:18] EdwardIII: this must be a common request right?
[17:05:33] mrgreenfur: tubbo: command me!
[17:05:44] mrgreenfur: I do thy bidding!
[17:06:07] drbayer: has joined #RubyOnRails
[17:06:13] mrgreenfur: erm, is there any good reason to use redis for session stores over the default?
[17:06:20] matthias_: has joined #RubyOnRails
[17:07:36] tubbo: mrgreenfur: one major reason is that the cookie store can only store a limited amount of information.
[17:07:43] tubbo: whereas the redis session can store a lot more
[17:07:54] tubbo: so if you wanted to store a bunch of data in the session, that might be a better solution
[17:08:30] mrgreenfur: tubbo: i dont put much in the session, isn’t that bad practice?
[17:08:39] drbayer: has joined #RubyOnRails
[17:08:40] mrgreenfur: err bad practice to put much in here
[17:08:41] matthewd: mrgreenfur: It's not fun to have a conversation when one party invents a conclusion, then asks the other to explain why they should do things that way
[17:09:02] mrgreenfur: matthewd: fair enough, i’ll rephrase
[17:09:10] tubbo: there is no single answer to that question :)
[17:09:25] mrgreenfur: i don’t put much in my sessions, always thought it was bad practice, in my situation is there any reason to think about changing session store?
[17:09:36] kies: has joined #RubyOnRails
[17:09:55] tubbo: if you don't need to change where the session is stored, my suggestion is not to change it until you have a really good reason to stray from the default.
[17:10:15] tubbo: this goes for literally everything in rails and programming apps in general
[17:10:44] mrgreenfur: truth. ok, thanks much, i will leave it alone :)
[17:10:54] mrgreenfur: in defaults i trust
[17:12:54] B1n4r10: has joined #RubyOnRails
[17:13:09] jscheel: has joined #RubyOnRails
[17:13:30] scope: has joined #RubyOnRails
[17:13:34] workmad3: tubbo: sometimes the defaults are braindead and useless, so you always want to stray for them... but in fairness, a knowledge that defaults are useless is a good reason to stray :)
[17:14:00] workmad3: (annoyingly, one of the offenders for that is OpenSSL...)
[17:14:12] tubbo: workmad3: yeah, that's what we like to call in the business "shitty software"
[17:15:46] codepete: has joined #RubyOnRails
[17:16:23] sandstrom: has joined #RubyOnRails
[17:16:43] tubbo: besides vim, of course
[17:17:00] tubbo: but frankly vim's defaults are great for basic shell editing. i'd rather if we all just used tabs instead of spaces too :P
[17:18:13] artto: has joined #RubyOnRails
[17:18:45] Peteykun: has joined #RubyOnRails
[17:20:13] EdwardIII: hey look i made a nice little xss exploit: https://gist.github.com/EdwardIII/72efce0e8e5def5b700a#file-c-rb-L4-L7
[17:20:25] EdwardIII: i'm surely just missing a general solution for this right?
[17:22:15] FooMunki: has joined #RubyOnRails
[17:22:25] chouhoulis: has joined #RubyOnRails
[17:23:20] crystal77: has joined #RubyOnRails
[17:23:50] Rodya_: has joined #RubyOnRails
[17:24:27] ferr: I have input with rails jquery ujs which works fine, however, I need to retrieve the value on page reload as well. https://gist.github.com/Fercell/57802d3b560cb3e59295 Shall I use checkbox_tag in this case?
[17:25:39] shanemcd: has joined #RubyOnRails
[17:26:52] arup_r: has joined #RubyOnRails
[17:27:38] mostlybadfly: has joined #RubyOnRails
[17:28:00] Maletor: has joined #RubyOnRails
[17:28:49] rubyonrailed: has joined #RubyOnRails
[17:33:55] marr: has joined #RubyOnRails
[17:34:58] sneakerhax: has joined #RubyOnRails
[17:35:48] EdwardIII: hmm no, this is so ugly heh
[17:35:57] EdwardIII: this must be the wrong approach
[17:36:12] tubbo: EdwardIII: i think the root cause is that the method you're working with is poorly designed
[17:36:19] tubbo: EdwardIII: in the sense that it seems to be doing two separate things
[17:36:28] EdwardIII: tubbo: i agree
[17:36:35] EdwardIII: but i had to design it poorly to make it work with turbolinks?
[17:36:49] tubbo: EdwardIII: it's hard to figure out what this method is even doing
[17:36:59] EdwardIII: so either i must be using turbolinks incorrectly, or turbolinks is the wrong tool for the job
[17:37:15] EdwardIII: if the request is coming from turbolinks, it just gives turbolinks itself as a url
[17:37:18] EdwardIII: it's horrible
[17:37:28] EdwardIII: see the erb file: https://gist.github.com/EdwardIII/72efce0e8e5def5b700a#file-v-js-erb
[17:37:48] EdwardIII: because i can't figure out how to make turbolinks just do the right thing with a GET ajax form
[17:37:48] nobitanobi: has joined #RubyOnRails
[17:38:02] EdwardIII: i just want it to act like a normal GET form, but turbolinksy
[17:38:45] tubbo: EdwardIII: i'm not sure i understand what the root problem is here. is Turbolinks getting in your way when you don't want to use it, or are you _trying_ to use Turbolinks here for some reason?
[17:38:51] czerasz: has joined #RubyOnRails
[17:40:13] lxsameer: has joined #RubyOnRails
[17:40:27] nobitanobi: What is a proper way to know if a transaction has been successful or not, in order to do something or something else? I am currently doing this: https://gist.github.com/novito/8ddf17de0b503cce6d1c
[17:41:06] EdwardIII: tubbo: yeah i want to use turbolinks
[17:41:13] EdwardIII: tubbo: so the next page loads faster by not reloading head, etc
[17:41:40] EdwardIII: is this madness?
[17:42:28] tubbo: EdwardIII: i mean i tried to use turbolinks on http://www.brother.ly/ but as you can see, the page is refreshing. it only works in development.
[17:42:33] tubbo: haven't cared enough to figure out why
[17:42:47] tubbo: we don't use turbolinks at work, it's just too hard to deal with
[17:42:54] EdwardIII: hey your cdn doesn't work for me
[17:43:09] EdwardIII: Font from origin 'http://files.brother.ly' has been blocked from loading by Cross-Origin Resource Sharing policy
[17:43:25] tubbo: EdwardIII: what do you mean, the fonts? yeah i broke my phone yesterday so i can't auth into AWS and fix the CORS on that bucket lo
[17:43:38] EdwardIII: ok that makes me sad, but maybe for now then i should just accept it
[17:43:50] EdwardIII: as you're a superpro and i'm basic, so if you find it a hassle i will probably find it impossible
[17:43:52] matthewd: nobitanobi: What are you trying to do?
[17:44:09] EdwardIII: but it's just, it seems like such a basic thing. submit a GET form. like the turbolinks devs must have come across that usecase in their own apps?
[17:44:13] nobitanobi: if transaction is successful I want to do something, otherwise something else.
[17:44:14] tubbo: EdwardIII: i think it's more like the version of turbolinks i'm using is "turbolinks 3" or whatever, not "turbolinks 5", which is what they're working toward now
[17:44:22] tubbo: the turbolinks i'm using is effectively abandoned
[17:44:27] Kryptonical: has joined #RubyOnRails
[17:44:54] matthewd: nobitanobi: What are "something" and "something else"?
[17:44:57] adkdev: has joined #RubyOnRails
[17:45:08] EdwardIII: tubbo: mmmrm i just switched to 5 and this particular thing isn't any clearer
[17:45:11] nobitanobi: if successful I want to increment an in memory counter
[17:45:22] nobitanobi: if not, I don't want to do anything. Just make sure that it rollbacks (that's why I re-raise)
[17:45:35] tenderlove: has joined #RubyOnRails
[17:45:35] tubbo: EdwardIII: well what i'm using is 3, and i've been able to get a remote GET form to submit. try typing in 'brother' in the search bar.
[17:45:37] tubbo: it autocompletes.
[17:45:40] EdwardIII: 1) how to do a redirect to a new resource after POST: easy. 2) how to do a normal redirect, easy. 3) how to do a GET submit? unclear
[17:45:47] theblang: has joined #RubyOnRails
[17:45:59] matthewd: nobitanobi: Okay, and what's causing the rollback here?
[17:46:12] arup_r: has joined #RubyOnRails
[17:46:12] EdwardIII: tubbo: but i want it to work like a normal method=GET form
[17:46:40] nobitanobi: it could either be the create or the update not being successful.
[17:46:46] nobitanobi: * update_all
[17:46:47] rakm: has joined #RubyOnRails
[17:46:56] tubbo: EdwardIII: what i meant was that maybe if you use the same version of turbolinks that i'm using, it will work?
[17:46:58] EdwardIII: i really just want to submit this GET form but with the benefits of turbolinks
[17:47:25] EdwardIII: tubbo: version 3.x seems to ignore GET forms by default. i changed it to ajax... but then i'm stuck again
[17:47:38] tubbo: EdwardIII: ahhhhh that's why it works for me :D
[17:47:39] EdwardIII: tubbo: i get the page results, but i can't really do anything with them
[17:48:22] tubbo: EdwardIII: well this is what i'm doing to make it autocomplete https://github.com/waxpoetic/brotherly/blob/master/app/assets/javascripts/searches.coffee, if you want the search results to display without refreshing the page you could just bind to 'ajax:success' and insert the html manually on turbolinks 3..
[17:48:54] EdwardIII: tubbo: i tried that too, but it seems the .replace function spoken of in master branch's docu doesn't exist
[17:49:03] fox_mulder_cp: has joined #RubyOnRails
[17:49:11] tubbo: EdwardIII: as you can see from my JS, i don't need turbolinks at all to update a DOM element :)
[17:49:20] EdwardIII: but you don't update the uri either
[17:49:22] tubbo: EdwardIII: $('body').html(response);
[17:49:30] EdwardIII: i really just want it to work exactly like a normal method=GET form
[17:50:31] sandstrom: has joined #RubyOnRails
[17:50:34] matthewd: nobitanobi: How can the update_all fail? :/
[17:50:52] nobitanobi: deadlock for example?
[17:51:17] Kryptonical: has joined #RubyOnRails
[17:51:18] matthewd: Fair enough
[17:51:37] flashpoint9: has joined #RubyOnRails
[17:51:44] tubbo: EdwardIII: that begs an interesting question. is it possible to change the URL to add query parameters?
[17:51:49] EdwardIII: i think i should perhaps just throw together a quick ajax handler that says "if the form is get, put the url together and fire it off with Turbolinks.visit()"
[17:51:52] tubbo: like /search?query=foo+bar
[17:51:52] EdwardIII: ACTION tries that
[17:51:53] matthewd: update_all will raise an exception (not AR::Rollback -- something describing what actually went wrong)
[17:52:03] EdwardIII: tubbo: right exactly
[17:52:14] EdwardIII: tubbo: really really basic heh
[17:52:49] sbarg: has joined #RubyOnRails
[17:53:18] sbarg: has left #RubyOnRails: ()
[17:53:20] matthewd: create *could* raise for a similar SQL-level failure, but will more often fail silently, if it's because of a validation failure
[17:53:34] nobitanobi: matthewd: that's what the transaction block would do. Catch that exception and raise the Rollback exception
[17:53:37] nobitanobi: which would rollback the DB
[17:54:04] matthewd: nobitanobi: Umm... no?
[17:54:14] rakm: has joined #RubyOnRails
[17:54:21] ace05: has joined #RubyOnRails
[17:54:21] nobitanobi: how does otherwise rails raise a rollback?
[17:54:24] matthewd: nobitanobi: If you know more about AR than me, I'm not sure how I can help you
[17:54:25] workmad3: nobitanobi: not quite... the transaction just rolls back on exception
[17:54:38] timdotrb: has joined #RubyOnRails
[17:54:46] workmad3: nobitanobi: a transaction block swallows a Rollback though, but re-raises any other exception after rolling back
[17:55:00] cac: has joined #RubyOnRails
[17:55:20] nobitanobi: workmad3: but on any exception happening, it will catch it and raise a rollback from it. Then re-raise the original exception
[17:55:38] nobitanobi: so if create! fails, a rollback will happen, and then the original exception from create! will be re-raisen
[17:56:08] workmad3: nobitanobi: yes... but an ActiveRecord::Rollback exception isn't raised in that process (which you seemed to imply would happen :) )
[17:56:17] matthewd: nobitanobi: If you're sure about how it works, we can't help you
[17:56:27] VeryBewitching: has joined #RubyOnRails
[17:56:30] nobitanobi: matthewd: I am not sure, that's why I am still discussing
[17:56:49] nobitanobi: sorry if it implied that I knew. I didn't mean that at all.
[17:57:26] Kryptonical: has joined #RubyOnRails
[17:57:33] workmad3: nobitanobi: an ActiveRecord::Rollback doesn't propagate outside of a transaction block btw
[17:57:46] techsethi: has joined #RubyOnRails
[17:58:11] nobitanobi: right. I guess my confusion is the following: If an exception happens within the transaction block, does the rollback happens first, or the rollback happens as a consequence of the rollback exception being risen
[17:58:41] _bogus_: has joined #RubyOnRails
[17:58:46] workmad3: nobitanobi: the transaction would be rolled back as a consequence of an exception happening
[17:58:49] matthewd: nobitanobi: There is no rollback exception
[17:59:04] timdotrb: Morning, all
[17:59:11] workmad3: nobitanobi: but no ActiveRecord::Rollback exception would be raised in that circumstance
[17:59:31] rubyonrailed: has joined #RubyOnRails
[18:00:08] workmad3: nobitanobi: ActiveRecord::Rollback exists purely so you can raise it yourself to trigger a rollback of a transaction, and the transaction block will swallow it and allow code to continue afterwards
[18:00:21] nobitanobi: workmad3: that makes sense
[18:00:35] nobitanobi: so that code I wrote doesn't make much sense
[18:00:40] workmad3: nobitanobi: not at all :)
[18:00:56] sypheren: has joined #RubyOnRails
[18:01:04] EdwardIII: there you go, much better: https://gist.github.com/EdwardIII/f84f5347f153cbc112e2
[18:01:06] banister: has joined #RubyOnRails
[18:01:09] nobitanobi: so, how do people usually deal with the scenario when other business logic needs to happen if transaction was successful?
[18:01:12] EdwardIII: thanks for the pointers tubbo
[18:01:19] workmad3: nobitanobi: on the plus side... if you're not raising ActiveRecord::Rollback, then you can just say "If this is after my transaction, then it committed fine"
[18:01:51] nobitanobi: oh workmad3 so any code after transaction assumes that the transaction was successful?
[18:02:37] sleungcy: has joined #RubyOnRails
[18:02:41] timdotrb: I’m experiencing some odd behavior with file uploads. When I try to do like @profile.image1.path I get undefined method ‘path’ for “#<File>”:String. These methods are accessible when I try params[:profile][:image1]
[18:02:51] workmad3: nobitanobi: pretty much... if you wanted, you could set a flag right at the end of the transaction block of 'transaction_successful = true' too... that line would be skipped if a Rollback exception caused the transaction to be rolled back
[18:03:13] arup_r: timdotrb: what gem are you using ?
[18:03:18] djbkd: has joined #RubyOnRails
[18:03:23] arup_r: is you using to upload file?**
[18:03:38] timdotrb: arup_r: paperclip
[18:03:57] nobitanobi: workmad3: that makes sense :)
[18:04:07] nobitanobi: I even thought that the last line would be executed
[18:04:18] nobitanobi: and then rollbacked, but that variable would still be set
[18:04:28] nobitanobi: because reseting the variable is not part of the rollback
[18:04:38] arup_r: i'm a carrierwave lover..haha. I can't help without read the readme of them.. better wait.. and show the code and error in a gist
[18:04:58] workmad3: nobitanobi: heh :) no... because the rollback would be triggered by an exception, all the code between raising the rollback and it actually being rolled back would be skipped ;)
[18:05:15] nobitanobi: I was overcomplicating this
[18:05:20] workmad3: nobitanobi: yup
[18:05:23] nobitanobi: thanks workmad3 and matthewd
[18:05:33] nobitanobi: it's hard to write tests for this
[18:05:34] aegis3121: has joined #RubyOnRails
[18:05:59] djbkd: has joined #RubyOnRails
[18:06:49] workmad3: nobitanobi: I personally wouldn't try to test transaction mechanics... that stuff is pretty well tested by ActiveRecord itself, I'd only write tests for it if something happened that made me doubt AR was doing it correctly
[18:07:22] nobitanobi: workmad3: fair enough
[18:07:23] tubbo: yeah frankly i've never had to do AR.transaction { } in my life
[18:07:39] tubbo: yeah, usually AR handles the transaction stuff for me
[18:07:47] workmad3: tubbo: heh :) I have a couple of times... but it's pretty rare
[18:07:55] tubbo: or at least if i did it's been so long that i've blocked it out of my memory
[18:08:01] nobitanobi: that's really interesting
[18:08:03] workmad3: it starts to appear more often if you start to abandon callbacks
[18:08:03] pramsky: has joined #RubyOnRails
[18:08:33] pramsky: has joined #RubyOnRails
[18:08:41] tubbo: ahh i knew i was using callbacks for a good reason ;)
[18:08:53] workmad3: tubbo: I've also had to use `with_lock` a couple of times :)
[18:09:25] tubbo: i'm pretty wary whenever people are like "DON'T USE <giant feature of the framwork />" because i wonder how much of that feature's functionality am i taking for granted?
[18:09:34] moeabdol1: has joined #RubyOnRails
[18:10:58] nobitanobi: workmad3: tubbo I gotta go. Thanks for your thoughts
[18:11:50] kies: has joined #RubyOnRails
[18:12:07] kdough: has joined #RubyOnRails
[18:12:18] shinnya: has joined #RubyOnRails
[18:12:46] shanemcd: has joined #RubyOnRails
[18:13:08] n008f4g_: has joined #RubyOnRails
[18:14:03] cnk: has joined #RubyOnRails
[18:15:00] scepticulous: has joined #RubyOnRails
[18:15:14] Fernando-Basso: has joined #RubyOnRails
[18:16:11] Havoc][: has joined #RubyOnRails
[18:19:02] yellow5: has joined #RubyOnRails
[18:19:44] rikkipitt: has joined #RubyOnRails
[18:20:56] hahuang65: has joined #RubyOnRails
[18:21:42] blackmesa: has joined #RubyOnRails
[18:24:38] EdwardIII: ah poo, you can't use translation context in partials
[18:25:40] konsolebox: has joined #RubyOnRails
[18:25:47] josephkokenge: has joined #RubyOnRails
[18:26:05] Havoc][: has left #RubyOnRails: ()
[18:26:16] Havoc][: has joined #RubyOnRails
[18:26:27] tubbo: EdwardIII: context?
[18:26:35] tubbo: oh you mean like automatic context? t('.whatever'0?
[18:26:41] tubbo: t('.whatever')*
[18:26:59] EdwardIII: tubbo: i do
[18:27:18] EdwardIII: it says "Automatic translation scoping by partial is only available from the translate view helper method."
[18:27:36] EdwardIII: i'm actually not sure what that means
[18:27:48] EdwardIII: <%=t('.feh') %> is the translate view helper, isn't it?
[18:27:51] shanemcd: has joined #RubyOnRails
[18:28:41] tubbo: EdwardIII: it means if you start the translation key off with '.', rails will try to figure out where that key is based on the path to your view
[18:28:56] tubbo: so if you call t('.name') and you're in the template posts/show.html, it will look for posts.show.name iir
[18:29:33] EdwardIII: doesn't seem to do it in posts/_show.html.erb though
[18:29:36] tubbo: but a partial doesn't have its own scope, which is kind-of a feature because in theory you can use the same translation key, but nest it in a different structure, so that way you don't have to have as many `if <this route> then <this translation> else <that translation>`
[18:29:41] EdwardIII: yeah makes sense
[18:29:49] EdwardIII: you could always pass in the scope as a var i guess somehow
[18:29:56] RockLee: has joined #RubyOnRails
[18:30:14] tubbo: it kinda depends on what you need
[18:30:46] scope: has joined #RubyOnRails
[18:30:51] _bogus_: whats the minimum ruby version needd to run rails 4.2 ?
[18:31:14] scope: its best to use rvm
[18:31:26] scope: and have ruby 2.2.2 as it supports web console
[18:31:36] gugl: has joined #RubyOnRails
[18:31:42] _bogus_: but whats the minimum ?
[18:32:01] scope: thats depends
[18:32:02] EdwardIII: right i think i'm gonna call it a day. thanks again for all the pointers tubbo
[18:32:16] scope: what gems you wish to run
[18:32:23] Havoc][: Does anyone know what iam doing wrong? http://pastebin.com/0gEeTrf2 i cant find the correct syntax in my js.erb for environment.context_class.instance_eval
[18:32:27] scope: if you need web console then you need 2.2.2
[18:32:40] scope: if you dont you can get away with 2.0.0
[18:32:50] scope: if your really curious
[18:33:07] scope: what you can do is use rvm to create a new enviroment
[18:33:11] shanemcd: has joined #RubyOnRails
[18:33:21] _bogus_: actually i need to deploy an app to a host server and the ruby's version in that server is 1.8.7 :/
[18:33:34] scope: ok thats a bit easier to help you now
[18:33:40] _bogus_: there's no rvm in the machine
[18:33:48] Havoc][: okay, sorry, here is the gist one: https://gist.github.com/anonymous/90b8929b8bfda58e8ba5
[18:33:49] scope: you dont need to have rvm
[18:33:53] _bogus_: and im not sure if I can install it (specially without messing everything up)
[18:34:26] scope: rvm is more your side so when your developing if someonegives you a project to improve on you can set up and environment on your local machine to develop
[18:34:46] scope: if you look inside the gemlock file and the gemfile
[18:34:56] scope: that will tell you exactly what version you need to use
[18:35:16] scope: if your adapting on a old app you need to follow the gemfil
[18:35:33] scope: if your creating a new app then dont even bother with anything lower than 2.2.2
[18:35:54] scope: ok can you paste the gem file inside gist
[18:36:01] scope: ill take a look at it for you
[18:36:14] _bogus_: its a new app.. im running it on 2.2.1 on my machine
[18:36:32] scope: ok question for you if its a new app why the older versions
[18:36:36] IrishGringo: has joined #RubyOnRails
[18:36:48] scope: its always better to start off with upto date software if its possible
[18:37:11] _bogus_: https://gist.github.com/anonymous/eebc8f8d8d1003179958
[18:37:44] scope: you need ruby version 2.2.2
[18:37:51] scope: as you have web console installed
[18:37:53] _bogus_: yeah but the server is a hostgator account my client already have
[18:38:08] neohunter: has joined #RubyOnRails
[18:38:10] scope: is there anyway to update the server
[18:38:13] scope: do you have access
[18:38:31] _bogus_: i have ssh access, not sure what my permissions are
[18:38:50] scope: check your permissions
[18:39:09] scope: if its your client advise them to update their system
[18:39:31] scope: other wise if its a new app try to use rails 4.2.0
[18:40:28] scope: but to be honest from my experiance using web console on something less than 2.2.2 gets a lot of errors
[18:41:05] Havoc][: or is there any why how i can call a helper method from a .js.erb?
[18:41:07] _bogus_: actually im not using the web console.. the gems Im using are at the end of the file... the rest is what came preset
[18:41:27] scope: ok then you need to completly re write the gemfile
[18:41:38] copperb0lt: has joined #RubyOnRails
[18:41:39] scope: remove everything your not using and only keep in what you need
[18:41:56] scope: once you do that you wont have problems
[18:41:57] delgiudices: has joined #RubyOnRails
[18:41:59] scope: shouldnt have problems
[18:42:27] scope: ill show you how i write my gemfiles
[18:43:31] scope: https://gist.github.com/scope2229/f072550c84febaa099f8
[18:44:00] scope: there you go if you think that the client needs to know what each file is you can leave a comment between eqch but honestly theres no need
[18:44:24] Cache_Money: has joined #RubyOnRails
[18:44:27] scope: im new to ROR and i dont need to have the comments to understand what the gem is and what it does i have google for that
[18:44:32] scope: hope that helps
[18:44:33] Limix: has joined #RubyOnRails
[18:45:40] Limix: Hi all, is there a way to load different sets of fixture data?
[18:45:55] Limix: and then unload for different tests?
[18:46:04] Limix: or should I look at factory girl
[18:46:53] Limix: I recently read an article about using minitest and fixtures over rspec and factory girl, and it sounds very convincing
[18:47:14] cnk: Limix: as always, it depends
[18:47:20] chouhoul_: has joined #RubyOnRails
[18:47:30] cnk: do you need a lot of interrelated data for your app?
[18:47:36] sp1rs: has joined #RubyOnRails
[18:47:39] rubyonrailed: has joined #RubyOnRails
[18:47:40] arup_r: Limix: there must be another article which will tell the opposite.. so pick what you like most.. :D
[18:47:42] cnk: if so, setting that up as a fixture is great
[18:47:54] cnk: I actually use a mix of fixtures and factories
[18:48:18] Limix: is there a way to load and unload specific sets of fixtures?
[18:48:24] cnk: I use a fixture to get a reasonable set of fixed data for runnig the site - and then factories for more focused tests
[18:48:26] Limix: yes the data is pretty interconnected
[18:48:48] cnk: I don't know of one - but that doesn't mean it doesn't exist
[18:48:57] Limix: so factory girl or is there another factory lib I should look at?
[18:48:58] arup_r: cnk: I would like to know, why fixture is good for interconnected data, but factories are not
[18:49:01] cnk: I think the usual is to load all and then use selectively
[18:49:46] _bogus_: scope thanks, im trying to open a ticket at hostgator's support to have ruby's updated
[18:49:50] cnk: arup_r: You can make sets of interconnected data with factories but that work gets done each test
[18:49:54] cnk: the fixture loads and stays
[18:50:28] gbgdev: has joined #RubyOnRails
[18:50:29] arup_r: so you use fixture and factories both in test?
[18:50:50] yxejamir: has joined #RubyOnRails
[18:50:59] arup_r: and by interconnected data you meant, the associations in between models?
[18:51:03] arup_r: or something else..
[18:51:15] cabinB: has joined #RubyOnRails
[18:51:21] jbrinkmusic: has joined #RubyOnRails
[18:51:26] shanemcd: has joined #RubyOnRails
[18:51:39] cnk: For example, I am modeling courses - which have lectures, questions, etc
[18:51:51] drbayer: has joined #RubyOnRails
[18:51:53] pixelhandler: has joined #RubyOnRails
[18:52:05] cnk: so I load a fixture with a reasonable set of course data as a base
[18:52:33] cnk: then I use factories to set up things around the edges - like student's answers to questions, etc.
[18:52:46] chouhoulis: has joined #RubyOnRails
[18:52:50] jottr: has joined #RubyOnRails
[18:52:52] jstransky: has joined #RubyOnRails
[18:53:17] cnk: If I didn't use the fixture, I would have to either mock out all the course stuff - or build it in a before method
[18:55:02] cabinB: I'm planning on using DHTMLX scheduler. http://dhtmlx.com/docs/products/dhtmlxScheduler/ Currently I'm building my model and controller. Assuming that all goes fine and users input data, what is the best practice to serve JSON to something like DHTMLX? From a view? From a controller?
[18:55:04] cnk: If my course model were jumping around, making sure my course fixture kept up would be a liability. But it is now fairly stable and so can be used so I don't have to do much mocking
[18:55:07] arup_r: cnk: thanks for explaining
[18:55:59] diego3: has joined #RubyOnRails
[18:56:00] Pulp: has joined #RubyOnRails
[18:56:10] cabinB: BTW... same question for using bootstrap-table gem. (https://github.com/bjevanchiu/bootstrap-table-rails). What's the best way to "feed" data to this?
[18:56:35] Cohedrin: has joined #RubyOnRails
[18:57:03] diego3: has joined #RubyOnRails
[18:58:18] manfrin: has joined #RubyOnRails
[19:01:44] shanemcd: has joined #RubyOnRails
[19:03:09] djbkd: has joined #RubyOnRails
[19:04:48] djbkd: has joined #RubyOnRails
[19:05:16] judetucker: has joined #RubyOnRails
[19:05:28] judetucker: has left #RubyOnRails: ()
[19:05:36] sypheren: has joined #RubyOnRails
[19:05:44] kknight: has joined #RubyOnRails
[19:06:05] DoctorMonocular: has joined #RubyOnRails
[19:06:29] srinidhi: has joined #RubyOnRails
[19:06:50] cabinB: maybe a more general way to phrase my question: I have some front-end code that wants to consume & display JSON data. What is a Rails best practice to serve that data. Assume I already have the model built, and plenty of clean data. The question really is focused on "how to serve it up".
[19:07:04] jmignault: has joined #RubyOnRails
[19:10:36] Cervajz_: has joined #RubyOnRails
[19:11:25] machuga: cabinB do you want it to fetch the data from a route or inject it into the page?
[19:11:31] Cervajz_: has joined #RubyOnRails
[19:11:50] aegis3121: has joined #RubyOnRails
[19:11:55] shanemcd: has joined #RubyOnRails
[19:12:05] cabinB: either one, but I suppose injecting it into a page may be more suitable for me. It's just rows of data for pagination.
[19:13:26] machuga: If you want to plop it into your page you can declare a var inside a JS block and then just output the var serialized to json
[19:14:29] cabinB: yes, that I can do...
[19:15:00] machuga: ERB would be <script>var foo = "<%= bar.to_json %>";</script> pretty much
[19:15:01] cabinB: I was thinking there would be a route or view I could provide a paramater to (like "page=" or something that would return the data to my ajax
[19:15:15] machuga: You definitely can do it that way
[19:15:26] cabinB: but i'm uncertain what's best... a route or a view
[19:15:30] machuga: or just return format.json
[19:16:04] cabinB: is there a "best" rails way to do this sort of thing. this is mostly for pagination.
[19:16:16] baweaver: has joined #RubyOnRails
[19:16:34] pvertenten: has joined #RubyOnRails
[19:16:49] machuga: if you want the same data available and paginatable via json or page browsing I'd probably render it as both html and json
[19:17:31] cabinB: do you think serving it via a view is the best way to go?
[19:17:39] djbkd: has joined #RubyOnRails
[19:20:07] machuga: for simple things or page specific code I'll drop it straight into the view, but if you are paginating the JS it'll probably be easier to just always fetch from an endpoint
[19:20:27] machuga: Because you'll always be fetching new data, and dropping it to the view would mean having to get your data from two places
[19:20:52] _djbkd: has joined #RubyOnRails
[19:21:03] cabinB: that makes sense. thank you very much for your input.
[19:21:23] _djbkd: has joined #RubyOnRails
[19:21:53] shanemcd: has joined #RubyOnRails
[19:22:38] machuga: sure thing
[19:23:23] dopie: has joined #RubyOnRails
[19:28:30] intrigueD: has joined #RubyOnRails
[19:28:46] i: has joined #RubyOnRails
[19:28:53] baweaver: has joined #RubyOnRails
[19:29:09] sunny36: has joined #RubyOnRails
[19:29:56] dopie: has joined #RubyOnRails
[19:30:16] chouhoulis: has joined #RubyOnRails
[19:31:47] ivanskie: has joined #RubyOnRails
[19:32:14] shanemcd: has joined #RubyOnRails
[19:32:16] delgiudices: has joined #RubyOnRails
[19:33:53] lyoshajapan: has joined #RubyOnRails
[19:34:14] Cache_Money: has joined #RubyOnRails
[19:34:59] tjohnson: has joined #RubyOnRails
[19:36:25] pixelhandler: has joined #RubyOnRails
[19:38:55] Radar: GOOD MORNING
[19:41:08] delgiudices: has joined #RubyOnRails
[19:41:23] bbrowning_: has joined #RubyOnRails
[19:41:28] rakm_: has joined #RubyOnRails
[19:42:00] cabinB: hi @radar
[19:43:08] delgiudices: has joined #RubyOnRails
[19:46:04] tubbo: cabinB: "DHTML" is a phrase i haven't heard in literally 15 years
[19:47:49] cabinB: product is called "DHTMLX" after all. But yeah, remember there was a time when the "D" in made a big difference.
[19:48:20] inoic: has joined #RubyOnRails
[19:48:36] shanemcd: has joined #RubyOnRails
[19:48:51] LowTemplar: has joined #RubyOnRails
[19:50:18] delgiudices: has joined #RubyOnRails
[19:50:18] swarm_lurker: has left #RubyOnRails: ()
[19:50:35] LowTemplar: Is there an equivelant to binary tree type in ORM?
[19:51:06] Pazician: has joined #RubyOnRails
[19:51:24] tubbo: LowTemplar: you can create a b-tree index on a postgres column iirc
[19:51:54] LowTemplar: I see, is there an option for using mySql2?
[19:52:49] lyoshajapan: has joined #RubyOnRails
[19:53:02] tubbo: LowTemplar: not sure
[19:53:41] LowTemplar: Ok, tubbo. Thanks for making that option known to me, i'll go crawl through a few references and see if I can't find something else as well
[19:55:24] bbrowning__: has joined #RubyOnRails
[19:57:06] uglybandersnatch: has joined #RubyOnRails
[19:57:09] djbkd: has joined #RubyOnRails
[20:04:52] mary5030: has joined #RubyOnRails
[20:05:04] rikkipitt: has joined #RubyOnRails
[20:07:44] arBmind: has joined #RubyOnRails
[20:09:53] banister: has joined #RubyOnRails
[20:11:17] pawnbox: has joined #RubyOnRails
[20:12:24] jeanlinux: has joined #RubyOnRails
[20:13:25] robbyoconnor: has joined #RubyOnRails
[20:16:36] gbgdev: has joined #RubyOnRails
[20:17:06] CodaBrink: has joined #RubyOnRails
[20:17:49] sandstrom: has joined #RubyOnRails
[20:17:57] robbyoconnor: has joined #RubyOnRails
[20:18:52] flashpoint9: has joined #RubyOnRails
[20:20:41] aegis3121: has joined #RubyOnRails
[20:23:12] lyoshajapan: has joined #RubyOnRails
[20:23:50] mdw: has joined #RubyOnRails
[20:26:29] delgiudices: has joined #RubyOnRails
[20:27:17] KensoDev: has joined #RubyOnRails
[20:27:37] KensoDev: has joined #RubyOnRails
[20:28:32] jayp: has left #RubyOnRails: ("Using Circe, the loveliest of all IRC clients")
[20:28:53] inoic: has left #RubyOnRails: ()
[20:28:58] jstransky: has joined #RubyOnRails
[20:30:57] Maletor: has joined #RubyOnRails
[20:32:04] lyoshajapan: has joined #RubyOnRails
[20:32:14] aldodelgado: has joined #RubyOnRails
[20:33:53] pixelhandler: has joined #RubyOnRails
[20:33:55] zave: has joined #RubyOnRails
[20:34:04] aldodelgado: Question? I just ran bundle update and now when I start my webserver it looks ok but the broswer does not route to the application and I'm getting "No data received". I have checked my host file, I have tried making a curl request to 127.0.0.1 and my internal ip address and nothing. Does anyone here have any suggestions?
[20:34:04] Cesarecf: has joined #RubyOnRails
[20:34:15] bronson: has joined #RubyOnRails
[20:36:28] djbkd: has joined #RubyOnRails
[20:37:44] Rodya_: has joined #RubyOnRails
[20:38:07] blackmesa: has joined #RubyOnRails
[20:41:10] pawnbox: has joined #RubyOnRails
[20:44:21] baweaver: has joined #RubyOnRails
[20:49:43] codepete: has joined #RubyOnRails
[20:50:08] shanemcd: has joined #RubyOnRails
[20:50:39] cac: has joined #RubyOnRails
[20:51:08] baweaver: has joined #RubyOnRails
[20:52:15] Radar: aldodelgado: what does it say when your server starts?
[20:55:19] copperb0lt: has left #RubyOnRails: ("WeeChat 1.4")
[20:55:21] n1lo: has joined #RubyOnRails
[20:56:29] uglybandersnatch: has joined #RubyOnRails
[20:57:10] aldodelgado: Radar: http://cl.ly/293H3k3p2y2j
[20:57:11] DmitryBochkarev: has joined #RubyOnRails
[20:57:18] aldodelgado: Nothing boots just fine
[20:57:49] B1n4r10: has joined #RubyOnRails
[20:57:55] aldodelgado: the broswer does not route so I figured it was my host file. However nothing changed other then updating gems
[20:59:19] Radar: Waiting for my train internet to not be shit
[20:59:24] Radar: It can't resolve cl.ly right now :(
[20:59:27] Radar: Maybe when the thousand people who are on this train get off the train it might be better
[21:00:40] griffindy: has joined #RubyOnRails
[21:00:40] aldodelgado: Radar: no worries. I actully tested another app and it loaded fine. So that tells me something broken after the update
[21:02:01] yellow5: has joined #RubyOnRails
[21:03:04] Radar: Well look at that, the thousand people get off the train and now the internet is no longer shithouse.
[21:04:25] w0bni: has joined #RubyOnRails
[21:04:33] DoctorMonocular: has joined #RubyOnRails
[21:07:31] cabinB_: has joined #RubyOnRails
[21:08:47] lyoshajapan: has joined #RubyOnRails
[21:08:52] Rodya_: has joined #RubyOnRails
[21:09:06] ner0x: has joined #RubyOnRails
[21:09:50] ivanskie: has joined #RubyOnRails
[21:11:11] djbkd: has joined #RubyOnRails
[21:11:25] ziyadb: has joined #RubyOnRails
[21:14:02] xxx1337: has joined #RubyOnRails
[21:14:39] xxx1337: Guys, I want to work on ruby on rails for my day job. The problem is I can't find a single opportunity. I need more resources. Do any of you have any ideas on how I can find myself in a position where I work on rails apps for my day job?
[21:15:07] xxx1337: All of the stuff on craigslist or career websites are senior level only
[21:15:24] aldodelgado: xxx1337: https://weworkremotely.com/
[21:15:27] tubbo: xxx1337: http://www.toprubyjobs.com
[21:15:29] mary5030: has joined #RubyOnRails
[21:15:35] tubbo: xxx1337: http://jobs.github.com
[21:15:48] xxx1337: Thanks guys
[21:15:51] aldodelgado: xxx1337: http://careers.stackoverflow.com/
[21:15:52] xxx1337: Exactly what I need
[21:16:05] flappynerd: has joined #RubyOnRails
[21:16:11] xxx1337: Hopefully I can find some type of lead.
[21:16:43] baweaver: has joined #RubyOnRails
[21:17:33] tubbo: xxx1337: i'd start with a junior first if i were you ;)
[21:17:41] tubbo: don't wanna just jump into lead territory you know
[21:17:56] FooMunki: has joined #RubyOnRails
[21:18:06] _bogus_: has joined #RubyOnRails
[21:18:35] xxx1337: I honestly feel like I could search each one of those sites
[21:18:38] xxx1337: and not find a junior role
[21:18:59] djbkd: has joined #RubyOnRails
[21:19:35] djbkd: has joined #RubyOnRails
[21:20:08] CodaBrink: has joined #RubyOnRails
[21:20:09] alaing: has joined #RubyOnRails
[21:20:22] alaing: has joined #RubyOnRails
[21:21:00] SteenJobs: has joined #RubyOnRails
[21:21:01] pawnbox: has joined #RubyOnRails
[21:22:03] alaing: hi is there a way of getting the form field that caused the form to fail validation?
[21:22:47] alaing: I would like to return a link in the view so a user and quickly navigate to the error
[21:22:50] flappynerd: if I define a route with a custom as: handler, how do I reference that route?
[21:23:00] flappynerd: I'm getting undefined method for my route path
[21:23:46] tubbo: flappynerd: if it's like as: :foo, i think you'd use foo_path
[21:23:55] tubbo: unless it's in a namespace or something
[21:23:58] flappynerd: tubbo, ok what about a route that requires a param?
[21:24:03] flappynerd: tubbo, http://pastebin.com/c59SrKNu
[21:24:13] intrigueD: has joined #RubyOnRails
[21:24:15] tubbo: flappynerd: params to the route are passed in as the function's arguments
[21:24:45] meoblast001: has joined #RubyOnRails
[21:24:49] flappynerd: https://gist.github.com/anonymous/ab89382249d6fb8441de
[21:25:00] tubbo: flappynerd: what is the route named now? you can type `rake routes | grep customthings` to find its path name
[21:25:03] DoctorMonocular: has joined #RubyOnRails
[21:25:10] flappynerd: tubbo, ah, yes rake routes, thanks, I'll check
[21:29:14] flappynerd: tubbo, huh, in fact yes, post_customthings_post ... odd, but whatever
[21:29:41] aldodelgado: Radar: Wow you'll never guess what the problem was. I had made edits to a rake task before updating the gems. when I fires rails server or foreman start no errors would occur. However I ran rake -T and it cought the error and gave me the line number. Sure enough typo in my rask
[21:32:01] DoctorMonocular: has joined #RubyOnRails
[21:32:05] sandstrom: has joined #RubyOnRails
[21:34:19] ace05: has joined #RubyOnRails
[21:38:52] WIN_: has joined #RubyOnRails
[21:39:54] hangelo: has joined #RubyOnRails
[21:40:39] Pazician: has joined #RubyOnRails
[21:43:10] railsForDaiz: has joined #RubyOnRails
[21:43:39] arBmind: has joined #RubyOnRails
[21:43:44] Radar: aldodelgado: neat
[21:43:53] robbyoconnor: has joined #RubyOnRails
[21:44:31] WIN_: has left #RubyOnRails: ()
[21:48:15] kknight: has joined #RubyOnRails
[21:51:47] lyoshajapan: has joined #RubyOnRails
[21:52:37] trinaldi: has joined #RubyOnRails
[21:55:01] jenrzzz: has joined #RubyOnRails
[22:00:50] mdel: has joined #RubyOnRails
[22:00:57] pawnbox: has joined #RubyOnRails
[22:00:58] ivanskie_work: has joined #RubyOnRails
[22:01:33] quazimodo: has joined #RubyOnRails
[22:02:48] maletor_: has joined #RubyOnRails
[22:03:28] robbyoconnor: has joined #RubyOnRails
[22:03:35] ivanskie_work_: has joined #RubyOnRails
[22:04:39] n1lo: has joined #RubyOnRails
[22:06:23] soule: has joined #RubyOnRails
[22:06:44] Kulo: has joined #RubyOnRails
[22:07:25] siaW: has joined #RubyOnRails
[22:08:32] soule: I am trying to populate my database with info in a separate ruby script; is there any place this script should go? I am trying to instantiate an object but i get a "NameError"
[22:08:42] openstruct: has joined #RubyOnRails
[22:10:09] kdough: has joined #RubyOnRails
[22:11:44] Radar: soule: !rule0
[22:11:44] helpa: soule: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[22:14:00] baweaver: has joined #RubyOnRails
[22:14:10] soule: Here's a gist: https://gist.github.com/soule/a66f4599e8460393ff42
[22:15:03] soule: I'm getting "uninitialized constant Team (NameError)"
[22:15:20] Radar: soule: move it into a Rake task that inherits from environment
[22:15:27] Radar: task foo: :environment do ...
[22:16:11] VeryBewitching: Today was a date math day.
[22:16:24] Radar: VeryBewitching: and you used by_star and then everything was OK?
[22:17:03] VeryBewitching: Radar: This client required PHP to be used, I tried destroy_this_language but I got a MethodNotExists exception :(
[22:18:29] rattatmatt: has joined #RubyOnRails
[22:19:54] VeryBewitching: Though I have built the app in Rails. Laravel % complete is 76 and Rails % complete is 100.
[22:20:07] codepete: has joined #RubyOnRails
[22:20:10] VeryBewitching: I wanted to demonstrate to the client how badly they chose their framework.
[22:20:17] VeryBewitching: He kind of cried when I showed him that.
[22:21:13] pvertenten_: has joined #RubyOnRails
[22:23:08] rattatmatt: so I've got a public api endpoint for other sites to put plugins up to connect and post data to my rails api. is there any way to verify that the page with the plugin that is sending the request is SSL? I've already configured my rails app to force ssl, but I want to force sites using the plugin to have SSL on their page before the request will work
[22:23:56] openstruct: has joined #RubyOnRails
[22:24:16] ivanskie_work_: has joined #RubyOnRails
[22:24:20] Ergo: has joined #RubyOnRails
[22:24:25] weaksauce: VeryBewitching so you built it twice?
[22:24:47] VeryBewitching: weaksauce: Yes.
[22:24:58] VeryBewitching: weaksauce: I wanted to see what the time differential was going to be.
[22:26:07] Radar: VeryBewitching: lol :)
[22:26:23] weaksauce: was it that you have more experience in rails or was laravel that much slower to write?
[22:26:32] Radar: rattatmatt: Other than asking nicely, no I don't think there is a way.
[22:26:44] Radar: rattatmatt: You could alternatively get them to embed an iframe from your site which uses HTTPS only.
[22:27:01] VeryBewitching: weaksauce: I have more experience with Java and PHP than any other language, oddly. Laravel is really a pain in the ass.
[22:27:33] weaksauce: yeah. rails is a really nice framework once you get past the "wtfisrailsdoingforme" part
[22:27:36] VeryBewitching: weaksauce: It's a framework that never made a clear choice on how it wants to do things, so it left it up to the developer.
[22:27:49] siaW: has joined #RubyOnRails
[22:28:06] rattatmatt: Radar: what about looking at the headers? doesn't one of them state whether it's http or https, or can that be easily spoofed?
[22:28:24] Radar: rattatmatt: Site A doesn't have any way to know how Site B was requested.
[22:28:32] DoctorMonocular: has joined #RubyOnRails
[22:28:36] soule: Radar, thanks, I made it as a rake task!
[22:29:30] Radar: soule: great :)
[22:30:29] VeryBewitching: weaksauce: Should be noted that my client has PHP developers that chose WordPress as an application framework for a recent application, and proceeded to absolutely slaughter the spec.
[22:30:39] mag42c: has left #RubyOnRails: ()
[22:30:41] VeryBewitching: He's happy that I can think and type at the same time, in contrast.
[22:30:49] pawnbox: has joined #RubyOnRails
[22:30:54] rattatmatt: Radar: nuts... iframe is the only way? I'm pretty sure javascript isn't able to determine that either, unless there's something I just don't know
[22:31:30] weaksauce: VeryBewitching lol. yeah that is a good attribute in a programmer
[22:31:39] Radar: rattatmatt: I think so.
[22:32:30] VeryBewitching: I haven't been in here as much in the past couple of months due to this project, I miss all you folks.
[22:32:56] rattatmatt: Radar: alright, thanks man
[22:33:17] uglybandersnatch: has joined #RubyOnRails
[22:33:49] trosborn: has joined #RubyOnRails
[22:33:54] VeryBewitching: But... it's time for a stiff drink I think.
[22:34:09] VeryBewitching: See ya'll tomorrow hopefully!
[22:34:58] jenrzzz_: has joined #RubyOnRails
[22:35:13] chipotle: has joined #RubyOnRails
[22:36:36] flappynerd: has left #RubyOnRails: ("Leaving")
[22:39:52] jenrzzz: has joined #RubyOnRails
[22:42:58] hahuang65: has joined #RubyOnRails
[22:44:08] quazimodo: has joined #RubyOnRails
[22:47:08] griffindy: has joined #RubyOnRails
[22:48:08] Rodya_: has joined #RubyOnRails
[22:51:27] shanemcd: has joined #RubyOnRails
[22:51:55] baweaver: has joined #RubyOnRails
[22:52:31] lemur: has joined #RubyOnRails
[22:53:13] Devalo: has joined #RubyOnRails
[22:54:04] hahuang61: has joined #RubyOnRails
[22:54:52] robbyoconnor: has joined #RubyOnRails
[22:55:09] SeanLazer: has joined #RubyOnRails
[22:57:52] mdw: has joined #RubyOnRails
[23:00:04] JonasOSDever: has joined #RubyOnRails
[23:00:27] codepete: has joined #RubyOnRails
[23:01:21] moeabdol2: has joined #RubyOnRails
[23:01:35] pawnbox: has joined #RubyOnRails
[23:02:16] trosborn: has joined #RubyOnRails
[23:03:30] djbkd: has joined #RubyOnRails
[23:09:31] superlou: has joined #RubyOnRails
[23:10:22] mwlang: has joined #RubyOnRails
[23:10:34] mrbubbles: has joined #RubyOnRails
[23:10:36] ensyde_: has joined #RubyOnRails
[23:13:55] lyoshajapan: has joined #RubyOnRails
[23:18:45] baweaver: has joined #RubyOnRails
[23:22:03] jstransky: has joined #RubyOnRails
[23:23:19] cabinB: Question re: dynamic forms. I have a form that has fields dynamically generated by js (when certain conditions are selected). For one series of fields, there's no limit of how many can be generated. What's a common practice in rails to handle data created in this way? And what's a common practice when the data needs to be edited? is there a gem that simplifies this process?
[23:25:07] railsFor_: has joined #RubyOnRails
[23:26:39] n008f4g_: has joined #RubyOnRails
[23:27:42] Darmani: has joined #RubyOnRails
[23:31:54] pawnbox: has joined #RubyOnRails
[23:33:27] djbkd: has joined #RubyOnRails
[23:34:10] djbkd: has joined #RubyOnRails
[23:44:46] uglybandersnatch: has joined #RubyOnRails
[23:48:24] trosborn: has joined #RubyOnRails
[23:48:37] brunto: has joined #RubyOnRails
[23:48:38] brunto: has joined #RubyOnRails
[23:50:47] rafaelfr_: has joined #RubyOnRails
[23:54:21] shanemcd: has joined #RubyOnRails
[23:56:59] one_zero: has joined #RubyOnRails
[23:58:45] DragonPunch: has joined #RubyOnRails