« Back to channel list

#RubyOnRails - 11 July 2016

« Back 1 day Forward 1 day »
[00:00:13] vanvemden: has joined #RubyOnRails
[00:00:35] macsteps: has joined #RubyOnRails
[00:09:48] ur5us: has joined #RubyOnRails
[00:10:47] moeabdol: has joined #RubyOnRails
[00:11:35] Ayey_: has joined #RubyOnRails
[00:15:37] Jet4Fire: has joined #RubyOnRails
[00:21:39] vanvemden: has joined #RubyOnRails
[00:23:15] kevr: has joined #RubyOnRails
[00:24:53] kevr: I'm passing a path, create_address_path, to a partial via <%= render "some/partial", data: create_address_path %>, and its actually working in an identical situation elsewhere, but for some reason in this area it's passing &#39; instead of a single quote
[00:24:57] kevr: which creates issues
[00:27:01] kevr: actually, i guess using raw(data) when referring to it in the partial works out, but i'm wondering why i need to use raw here and not in the other situation
[00:32:42] jeromelanteri: kevr, what is the full file name of your partial file ? (or maybe his extention)
[00:33:12] dru: has joined #RubyOnRails
[00:33:30] jeromelanteri: kevr, this problem could occur if the extention name is wrong...
[00:34:49] EXCHGR: has joined #RubyOnRails
[00:35:50] roamingdog: has joined #RubyOnRails
[00:38:20] asdf34t34adfg: has joined #RubyOnRails
[00:39:01] Oliphaunte: has joined #RubyOnRails
[00:41:06] pawnbox: has joined #RubyOnRails
[00:42:14] Guest51731: has joined #RubyOnRails
[00:42:44] jhwhite: has joined #RubyOnRails
[00:43:13] xall: has joined #RubyOnRails
[00:43:21] kevr: all the extensions are .html.erb, the full name of the partial is addresses/_search.html.erb
[00:44:00] kevr: I can use erb in the _search partial, i'm including it in two different locations at the moment, one of which works fine, the other fails
[00:44:10] jhwhite: Very new to writing an API with Rails. If I have a tasks_controller.rb and want to have an api call with the URL /tasks/total-todos, would I add a method for that in the tasks_controller.rb?
[00:44:41] pontiki: has joined #RubyOnRails
[00:45:24] jeromelanteri: kevr, could you paste with gist github (or similar) code of these two deifferent locations and the partial file ?
[00:46:09] kevr: Sure, but give me a minute, I think I might know why the issue is occuring, so I'm going to investigate for a minute
[00:47:16] jeromelanteri: jhwhite, yes you can do that. if you want a route to execute code, you have to put this method in public mode, then add a route in route.rb file (by add a collection inside a resource of your task), or if you don't need a action caller, put this method in provate part of the controller class.
[00:47:31] jeromelanteri: kevr, you are welcome
[00:48:09] jeromelanteri: jhwhite, not "provate", but "private"
[00:49:41] jeromelanteri: jhwhite, so if you want an url, you will have to add this action linked with a route directioon inside the route.rb file... and need to know if you want a get or post method, or together.
[00:49:49] kevr: jeromelanteri: I always give my thanks, but I don't give thanks until the conversation is coming to a close, so please don't assume that i'm not grateful, it's just that the conversation didn't come to an end yet.
[00:50:41] jeromelanteri: kevr, again... you are welcome. don't worry.
[00:52:18] Guest51731: has joined #RubyOnRails
[00:55:20] rogue_koder: has joined #RubyOnRails
[00:56:57] pawnbox: has joined #RubyOnRails
[01:05:02] blackmesa: has joined #RubyOnRails
[01:08:08] armyriad: has joined #RubyOnRails
[01:10:06] jhwhite: jermoelanteri: I have a gist here: https://gist.github.com/jhwhite/3e812bb708c6c6a8a0e965a08548ef50 In the tasks_controller there is a method total_todos. Can you tell me if my route and that method look right? I'm getting an error when I make a call to that url.
[01:11:05] enough_pancakes: has joined #RubyOnRails
[01:12:23] Ayey_: has joined #RubyOnRails
[01:13:58] yfeldblum: has joined #RubyOnRails
[01:14:06] asianMike: has joined #RubyOnRails
[01:14:30] flashpoint9: has joined #RubyOnRails
[01:20:34] jhwhite: jeromelanteri: Spelled your name wrong for the above message.
[01:21:57] zacts: has joined #RubyOnRails
[01:24:49] whathappens: has joined #RubyOnRails
[01:25:16] jeromelanteri: jhwhite, not so far to be good... first, in your controller, you can do use a "respond_to do |format| for use convention call back... but what you need for your code works is to inslude your route inside a resource, and inside a collection. Then check your tasks routes by command: rake routes | grep task
[01:25:38] jeromelanteri: let me paste you an exemple of route with a give action member from controller...
[01:26:31] pontiki: that bare route should work as well, but i'm wondering if you meant to swap the order of the words between the route and the action?
[01:26:58] pontiki: if you have that bare route *below* your resources, though, it won't work
[01:28:19] pontiki: jhwhite: !gist-usage
[01:28:19] helpa: jhwhite: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[01:28:43] SteenJobs: has joined #RubyOnRails
[01:30:03] jeromelanteri: jhwhite, https://gist.github.com/jerome-diver/a94cdddb3e6a2fa40f9df9384e7c4304
[01:30:23] Ebok: has joined #RubyOnRails
[01:34:07] jeromelanteri: pontiki, i try to split form helpers in multiples files to be rendered partail... i'm trying to have a simple "show" view able to be edited without render an entire "_form" partial", but instead, put fields input in target position, then collect form paramas for submit. I arrived to put fields form (contain corretc data from current view), but at submit time, params is empty, variable "form" is not shared.
[01:34:29] jeromelanteri: do you understand what i'm trying to do and do you know a solution for my problem ?
[01:34:48] groatyoats: has joined #RubyOnRails
[01:35:23] harfangk: has joined #RubyOnRails
[01:41:49] ecnalyr: has joined #RubyOnRails
[01:41:52] moeabdol: has joined #RubyOnRails
[01:43:05] dcunit3d: has joined #RubyOnRails
[01:43:28] Guest51731: has joined #RubyOnRails
[01:43:37] pontiki: do you mean partials or helpers? those are two different things
[01:47:32] asianMike: has joined #RubyOnRails
[01:50:54] jeromelanteri: pontiki, i mean that i render "partials" dynamicaly in some part of an initial show view (through javascript mecanism call at edit time click event), then show input form helpers in each place of data shown. Like this example should show the idea: https://gist.github.com/jerome-diver/091e3acf3aba53d2eb847c7caf00c566
[01:51:57] jhwhite: has joined #RubyOnRails
[01:51:59] jeromelanteri: pontiki, but my problem is that, at submit time, params data from submit is empty instead of show current input datas.
[01:53:04] jeromelanteri: i try to share content of params by a kind of globla variable @form (then @form = form). This was initiate first in my controller in edit method by @form = nil.
[01:53:20] jeromelanteri: but failed, this not works this way... i have no idea how to make this works.
[01:53:23] SteenJobs: has joined #RubyOnRails
[01:53:59] pontiki: neither do i. i've never seen anything like that
[01:55:46] jeromelanteri: pontiki, yes, it is original, also maybe not a good design patern. But how to just populate dynamicaly without change al page the input fields in place of data ?
[01:56:09] pontiki: colour me clueless
[01:58:20] jeromelanteri: yeah. it s strange... it should be very usefull for user at edit time to just have input field in place of datas to edit.
[01:58:45] jeromelanteri: (usefull, clear and nice)
[01:59:23] jeromelanteri: but in the code with rails framework, it seems to be a pain to just do that.
[01:59:28] pontiki: i guess my suggestion would be this: make it work as one complete form first, then break it up
[01:59:44] pontiki: i also never bother with the rails js stuff
[02:00:21] jeromelanteri: pontiki, i done it allready. simple form works fine... i split it right now (and if works, i have to do it same for other objects... and also more complicate with nested elements through cocoon).
[02:01:35] ekinmur: has joined #RubyOnRails
[02:01:56] jahrichie: has joined #RubyOnRails
[02:02:25] jeromelanteri: pontiki, use it in combination with bootstrap, jquery-ui, blueimp carousel, etc... i'm frustred to be locked by this form attempt result and not find a logic way to do simple things like that with rails. I think it sould not be possible that rails can not do that, but i not find any information on that precisely.
[02:03:15] jeromelanteri: anyway, thank you for try to help me. hope an other one should try it allready and tell me how to fix that.
[02:03:25] Guest51731: has joined #RubyOnRails
[02:03:40] jeromelanteri: (not "should try"... my english is bad... it may be "tried")
[02:03:51] Oliphaunte: has joined #RubyOnRails
[02:05:13] jahrichie: has joined #RubyOnRails
[02:05:30] SteenJobs: has joined #RubyOnRails
[02:07:09] blackmesa: has joined #RubyOnRails
[02:08:45] Leonardodutra: has joined #RubyOnRails
[02:10:19] Leonardodutra: I'm trying to save an ip in rails, but it´s only possible in a decimal data, i know how to convert but i dont know where can i put it?
[02:10:35] Leonardodutra: 2.3.0 :004 > IPAddr.new(a, Socket::AF_INET).to_s
[02:10:35] Leonardodutra: => "10.69.120.2"
[02:10:35] Leonardodutra: 2.3.0 :005 > IPAddr.new("192.168.0.1").to_i
[02:10:35] Leonardodutra: 2.3.0 :006 > IPAddr.new(a, Socket::AF_INET).to_s
[02:11:02] Leonardodutra: i need to make this conversion before save and show
[02:11:12] jeromelanteri: Leonardodutra, were this data has to be hold ? database ?
[02:11:47] jeromelanteri: (ask it because this database as a type for ip address)
[02:12:07] jeromelanteri: i think sqlite doesn't have special type data for that (not sure)
[02:12:21] jeromelanteri: did you know that ?
[02:12:22] pontiki: not unless you create a table to hold it
[02:12:24] Leonardodutra: yeap!, i need to convert to decimal
[02:12:31] Leonardodutra: and resque then
[02:12:48] pontiki: sqlite only has like 2 real types
[02:12:52] jeromelanteri: it is a choice... you could also let it in string, but do a validate test at include time.
[02:12:55] Leonardodutra: string and int
[02:13:04] Ayey_: has joined #RubyOnRails
[02:13:11] jeromelanteri: from ruby regex
[02:13:23] Leonardodutra: i need to convert
[02:13:26] pontiki: just use that IPAddr module
[02:13:35] pontiki: to valideate it i mean
[02:13:58] Leonardodutra: i am very newbie
[02:14:09] Leonardodutra: my last were php
[02:14:41] pontiki: no worries!
[02:15:00] pontiki: you already found that module, most poeple don't seem to know it
[02:15:32] jeromelanteri: yes, if there is special rails tools (or ruby, anyway) for do easier job than create regex, it will be better from far. just use it and adapt your content form has need for use that tool.
[02:15:59] flashpoint9: has joined #RubyOnRails
[02:16:13] Leonardodutra: jeromelanteri how can i user an lib from ruby
[02:16:21] jeromelanteri: if data output is complicate, don't split it, just convert to string and push it to the database field.
[02:16:38] pontiki: yes, save the ip as a string
[02:16:47] jeromelanteri: there is an online API for ruby (and a nice huide for rails)
[02:17:11] Leonardodutra: i did in view index as i will show.
[02:17:23] Leonardodutra: IPAddr.new("equipment.ip").to_i
[02:17:37] jeromelanteri: to_s, do it easy.
[02:17:38] Leonardodutra: <%= IPAddr.new("equipment.ip").to_i %>
[02:17:49] Leonardodutra: but it´s horrible to me
[02:18:08] pontiki: that's not going to work...
[02:18:30] Leonardodutra: it works, but i think this is not the better way to do.
[02:18:37] pontiki: are you doing it without the quotes?
[02:18:51] jeromelanteri: http://ruby-doc.org/stdlib-2.3.1/libdoc/ipaddr/rdoc/IPAddr.html
[02:18:54] tbuehlmann: has joined #RubyOnRails
[02:19:16] pontiki: "equipment.ip" is not an IP address
[02:19:17] Leonardodutra: it´s a decimal ip addr
[02:19:17] pontiki: no it's a string
[02:19:20] Leonardodutra: the answer is a real ip 192.168.0.1
[02:19:29] pontiki: it doesn't have an answer. it's a string
[02:19:37] Leonardodutra: this is converting in the view
[02:19:38] lxsameer: has joined #RubyOnRails
[02:19:38] pontiki: it's like "hello.world"
[02:20:17] Leonardodutra: jeromelanteri i had read it, but i don´t know how to aplly
[02:20:32] Leonardodutra: puts this code to make the magic
[02:20:46] Leonardodutra: using a ruby lib in rails
[02:20:51] Leonardodutra: i don´t know how
[02:21:02] Leonardodutra: this is my first
[02:21:12] jeromelanteri: as pontioki tell you (and as show the API), you have to input a real ip address "format".
[02:21:26] jeromelanteri: so you need to convert your domain name to ip address first.
[02:21:34] pontiki: step back, then, and work all the way through a good tutorial, such as http://railstutorial.com first
[02:21:58] pontiki: then you will know how to include libraries
[02:22:05] pontiki: because hartl covers that
[02:22:29] Leonardodutra: I don´t remember if in this tutorial have a chapter "using rails lib"
[02:23:01] pontiki: follow the rails tutorial
[02:23:16] Leonardodutra: but if don´t have i will come back
[02:25:15] Leonardodutra: https://www.railstutorial.org/book
[02:25:30] jhwhite: has left #RubyOnRails: ()
[02:25:50] Leonardodutra: i have to many features to write and i am stopped in this problem
[02:26:08] Guest: has joined #RubyOnRails
[02:28:04] quazimodo: has joined #RubyOnRails
[02:28:31] benlieb: has joined #RubyOnRails
[02:30:28] pontiki: IPAddr is already part of rails, for that matter
[02:33:02] pawnbox: has joined #RubyOnRails
[02:34:17] jstransky: has joined #RubyOnRails
[02:34:39] Leonardodutra: pontiki i was think as php code, building all in view
[02:34:53] Leonardodutra: repeating code
[02:35:17] arunpyasi: has joined #RubyOnRails
[02:35:18] pontiki: that's not even good in php
[02:39:55] xall: has joined #RubyOnRails
[02:41:53] Leonardodutra: pontiki it works
[02:42:00] Leonardodutra: @low = IPAddr.new("62.0.0.0").to_i
[02:42:10] Leonardodutra: only use @low in view
[02:42:17] Leonardodutra: thanks for your help
[02:42:23] Leonardodutra: jeromelanteri you too
[02:43:06] moeabdol: has joined #RubyOnRails
[02:43:09] armyriad: has joined #RubyOnRails
[02:48:57] dezull: has joined #RubyOnRails
[02:50:23] jeromelanteri: Leonardodutra, good news. you are welcome.
[02:53:25] sypheren: has joined #RubyOnRails
[02:54:35] Leonardodutra: thank you guys
[02:54:43] Leonardodutra: i have to practice rails and english
[02:55:01] Leonardodutra: last december i had stay in new york city
[02:55:13] Leonardodutra: serius problens with my english life
[02:55:27] jeromelanteri: Leonardodutra, me to... i consider myself as a newbie to.
[02:55:37] jeromelanteri: (in english and with rails)
[02:55:47] Leonardodutra: jeromelanteri cool
[02:56:01] Leonardodutra: we have to start from some point
[02:56:21] jahbrewski: has joined #RubyOnRails
[02:56:52] jeromelanteri: yes, for me start point is long way check points also... i just start to understand how CoC rails need for simple things... it is terribly agnostic also.
[02:57:37] jeromelanteri: the problem is that when you need something more precise, you also need to know much much more...
[02:57:47] jeromelanteri: (not only on Rais)
[02:57:57] sevenseacat: has joined #RubyOnRails
[03:03:42] pawnbox: has joined #RubyOnRails
[03:03:44] Leonardodutra: jeromelanteri, in php i am ussualy use external commands from system, in rails is everything new to me.
[03:03:50] chouhoulis: has joined #RubyOnRails
[03:04:17] VeryBewitching: has joined #RubyOnRails
[03:04:51] chouhoulis: has joined #RubyOnRails
[03:07:08] Leonardodutra: jeromelanteri in my controller i have @equipment = Equipment.all, and in the view a have equipment.each. Can i change something in this array before explode in view?
[03:08:10] blackmesa: has joined #RubyOnRails
[03:08:39] benlieb: has joined #RubyOnRails
[03:11:16] SteenJobs: has joined #RubyOnRails
[03:13:04] macsteps: has joined #RubyOnRails
[03:13:51] jeromelanteri: Leonardodutra, normally, you need to use @equiment.each (or .find_each) method
[03:14:06] Ayey_: has joined #RubyOnRails
[03:14:19] jeromelanteri: Leonardodutra, you can sure change array form from controller (before call view in respective methed action caller part of the controller)
[03:14:44] jeromelanteri: Leonardodutra, you can use private method in controller for do recursive or complicate things on that...
[03:14:55] jeromelanteri: and also, you can use json builder to...
[03:15:32] jeromelanteri: Leonardodutra, there is also methods for model to know about (look at the guide online)
[03:16:05] jeromelanteri: you can also have the choice to use helpers for views... or do things directly in the model class...
[03:16:37] jeromelanteri: there is many different way to achieve a form. But this form has to be usable by rails CoC at the end...
[03:18:07] kevr: has joined #RubyOnRails
[03:19:55] treaki__: has joined #RubyOnRails
[03:23:15] Ebok: has joined #RubyOnRails
[03:26:52] Leonardodutra: jeromelanteri thanks
[03:28:41] arthurthefourth: has joined #RubyOnRails
[03:29:40] xlegoman: has joined #RubyOnRails
[03:29:55] jj: has joined #RubyOnRails
[03:35:46] fivefeet5: has joined #RubyOnRails
[03:42:09] pawnbox: has joined #RubyOnRails
[03:42:10] dionysus69: has joined #RubyOnRails
[03:44:08] sebstrax: has joined #RubyOnRails
[03:44:37] Synthbread: has joined #RubyOnRails
[03:45:13] zacts: has joined #RubyOnRails
[03:53:47] Oliphaunte: has joined #RubyOnRails
[03:56:56] spyder55: has joined #RubyOnRails
[04:05:13] ketherah: has joined #RubyOnRails
[04:06:58] SteenJobs: has joined #RubyOnRails
[04:07:50] Fuzai: has joined #RubyOnRails
[04:10:12] blackmesa: has joined #RubyOnRails
[04:10:41] FCser: has joined #RubyOnRails
[04:14:53] Ayey_: has joined #RubyOnRails
[04:16:00] roamingdog: has joined #RubyOnRails
[04:16:48] lxsameer: has joined #RubyOnRails
[04:19:38] zacts: has joined #RubyOnRails
[04:27:07] speaking1ode: has joined #RubyOnRails
[04:36:00] Palsson: has joined #RubyOnRails
[04:39:59] rvanlieshout: has joined #RubyOnRails
[04:49:04] Oliphaunte: has joined #RubyOnRails
[04:54:07] alfiemax: has joined #RubyOnRails
[04:54:30] Palsson: has joined #RubyOnRails
[04:56:29] raunicolae: has joined #RubyOnRails
[04:56:58] raunicolae: has left #RubyOnRails: ()
[05:03:09] atomx: has joined #RubyOnRails
[05:04:02] atomx: hi, I'm not sure if this is a RoR-only thing but I noticed that even when using scaffolding there are a lot of strings that are surrounded by double quotes even when they do not contain any variables
[05:04:09] roamingdog: has joined #RubyOnRails
[05:04:24] atomx: is this specified in any convention? I'd like to read that
[05:05:08] speaking1ode: has joined #RubyOnRails
[05:05:32] rvanlieshout: atom_: there are different opinions in what to use
[05:05:40] roamingd_: has joined #RubyOnRails
[05:05:57] rvanlieshout: change it to whatever you prefer yourself (or what your project / company prescribes)
[05:06:34] tycoon177: has joined #RubyOnRails
[05:09:30] xall: has joined #RubyOnRails
[05:09:39] SteenJobs: has joined #RubyOnRails
[05:09:49] atomx: got it, thanks ;-)
[05:10:58] blackmesa: has joined #RubyOnRails
[05:13:08] tycoon177: I have an issue with devise when trying to sign in with google for the first time. (well kind of) In my user#from_omniauth method, i make a call to first_or_create after looking for the appropriate data, but if it has to create the user, it is not signing me in.
[05:13:25] tycoon177: it creates the user the first time through, but does not sign in
[05:13:35] tycoon177: if I try to sign in again, it works as expected
[05:15:48] Ayey_: has joined #RubyOnRails
[05:18:15] flashpoint9: has joined #RubyOnRails
[05:18:22] ecnalyr: has joined #RubyOnRails
[05:23:15] rvanlieshout: tycoon177: could it be your method creates the user, but doesn't return it?
[05:25:22] tycoon177: rvanlieshout: I thought that may be it, but i checked, and it is returning it. I just did a "puts user" after the call on first and it did not work
[05:25:31] tycoon177: it gave me the user
[05:28:46] rvanlieshout: could you gist some code and output of what you've tried?
[05:30:44] tycoon177: yeah, i may be able to do that..but i may have to come back tomorrow..i didn't realize it was so late and i have work in the morning
[05:33:24] jahbrewski: has joined #RubyOnRails
[05:39:23] kevr: has joined #RubyOnRails
[05:41:49] rickmasta: has joined #RubyOnRails
[05:43:21] alfiemax: has joined #RubyOnRails
[05:45:35] rubyonrails276: has joined #RubyOnRails
[05:46:18] rubyonrails276: how can open docx file in broweser to read ? using ruby on rails ?
[05:48:11] pawnbox: has joined #RubyOnRails
[05:50:27] dminuoso: has joined #RubyOnRails
[05:52:10] rvanlieshout: rubyonrails276: ruby-toolsobx.com; find a gem that can help you with that
[05:52:24] tego101: has joined #RubyOnRails
[05:56:48] t-ask: has joined #RubyOnRails
[06:00:06] Macaveli: has joined #RubyOnRails
[06:00:13] xlegoman: has joined #RubyOnRails
[06:02:08] Guest: has joined #RubyOnRails
[06:08:02] pawnbox_: has joined #RubyOnRails
[06:09:09] QoQOoO: has joined #RubyOnRails
[06:11:01] edwinvdgraaf: has joined #RubyOnRails
[06:11:46] blackmesa: has joined #RubyOnRails
[06:16:37] dminca: has joined #RubyOnRails
[06:16:54] Ayey_: has joined #RubyOnRails
[06:20:02] daumie: has joined #RubyOnRails
[06:20:43] naftilos76: has joined #RubyOnRails
[06:21:02] pawnbox: has joined #RubyOnRails
[06:24:01] dionysus69: has joined #RubyOnRails
[06:24:31] Pupeno: has joined #RubyOnRails
[06:24:31] Pupeno: has joined #RubyOnRails
[06:24:54] herbst: has joined #RubyOnRails
[06:26:33] dminuoso: has joined #RubyOnRails
[06:27:40] DrYockel: has joined #RubyOnRails
[06:28:36] ngw: has joined #RubyOnRails
[06:29:40] conta: has joined #RubyOnRails
[06:33:52] errakeshpd: has joined #RubyOnRails
[06:37:12] jstransky: has joined #RubyOnRails
[06:37:30] Oliphaunte: has joined #RubyOnRails
[06:42:54] errakeshpd: one of my rails application "angular views are located in my public/ directory, when railsapp is running on the production mode using nginx+puma receiving error like "ActionController::RoutingError (No route matches [GET] "/app/css/main.css"):"
[06:42:55] njero: has joined #RubyOnRails
[06:43:23] neanderslob: has joined #RubyOnRails
[06:43:36] yardenbar: has joined #RubyOnRails
[06:44:02] arBmind: has joined #RubyOnRails
[06:44:07] rvanlieshout: errakeshpd: that's because it's not using the asset pipeline
[06:44:23] rvanlieshout: if you want to be able to use /app/css/main.css, you'll have to place them in public/app/css/main.css
[06:44:33] rvanlieshout: but that kinda goes against the whole idea
[06:44:40] njero: hi... If i want to add some dynamic methods based on json field attributes to a model, which class method would i be overriding?
[06:45:13] njero: alfiemax, hi
[06:45:37] LeoDee: has joined #RubyOnRails
[06:45:39] alfiemax: dynamic methods like?
[06:46:27] errakeshpd: <rvanlieshout> I have the directory in public/app/css/
[06:46:41] rvanlieshout: then it's not a job of your rails app to serve it
[06:46:51] rvanlieshout: is there a main.css in there and is the webserver able to accessit?
[06:47:08] njero: alfiemax, like i have a jsonb field, i need to make some of the keys to map into methods..
[06:47:45] njero: instead of coding into multiple methods, i would like to generate methods from predefined keys itself
[06:48:01] alfiemax: does all of it do the same thig?
[06:48:50] rvanlieshout: why are you using jsonb if they and not just a few attributes then?
[06:49:00] alfiemax: an example would be great to get a perspective view of the problem.. one or two fields and what methods you want to have using them
[06:49:06] the_drow: has joined #RubyOnRails
[06:49:31] mark_66: has joined #RubyOnRails
[06:50:22] njero: i want to more attributes dynamically through some form itself.
[06:50:31] errakeshpd: yes, there is main.css file, but nginx is not serving those.
[06:50:44] travisxcode: has joined #RubyOnRails
[06:50:54] AzaToth: has joined #RubyOnRails
[06:51:05] rvanlieshout: errakeshpd: then that's your problem :) why would nginx even serve it?
[06:51:09] njero: I mean i thought it'd be better to have single jsonb field instead of having so many empty fields
[06:51:14] DoubleMalt: has joined #RubyOnRails
[06:51:34] njero: like i have Place Model where most of fields won't be available for every place
[06:51:37] rvanlieshout: n_e_o: not really
[06:52:30] njero: rvanlieshout, so you're suggesting it's better to go with simple fields itself
[06:52:54] rvanlieshout: unless you have a good reason not to do so. Preventing some empty fields isn't one of those
[06:54:03] moeabdol: has joined #RubyOnRails
[06:54:41] njero: rvanlieshout, noted.. will tweak ma approach. thanks. I chose this bcz i saw a similar pattern in implementing simple cms system through sti
[06:55:01] rvanlieshout: i've yet to see the first STI user to actually benefit from it
[06:55:10] rvanlieshout: and to be using STI in a place where it actually made sense
[06:55:19] errakeshpd: but when app is running on development env its working, but in production environment.
[06:55:27] errakeshpd: its not working
[06:55:35] rvanlieshout: errakeshpd: in dev rails will server assets; it won't in production
[06:55:58] rvanlieshout: there your assets are precompiled and served by nginx / apache. i think it's best to not use views served from public
[06:56:04] rvanlieshout: n_e_o: why would you think STI is a good approach?
[06:58:34] Pupeno: has joined #RubyOnRails
[06:58:34] Pupeno: has joined #RubyOnRails
[06:59:13] artto: has joined #RubyOnRails
[06:59:46] dezull: has joined #RubyOnRails
[07:00:06] njero: rvanlieshout, not clear, but it kind of made sense for me in that CMS, like you create a model with persistence to db and inherit others, search and list multiple types at single query
[07:03:49] spyder55: has joined #RubyOnRails
[07:04:33] linnal: has joined #RubyOnRails
[07:05:47] dminuoso: has joined #RubyOnRails
[07:08:37] GoranPavlovic: has joined #RubyOnRails
[07:09:08] errakeshpd: <rvanlieshout> ok, But Its become an issue now. you mean like "I have to move all angular files to rails/app/ directory" ?
[07:12:32] blackmesa: has joined #RubyOnRails
[07:13:38] darutoko: has joined #RubyOnRails
[07:14:06] artto: has joined #RubyOnRails
[07:15:41] pawnbox: has joined #RubyOnRails
[07:17:08] spyder55: has joined #RubyOnRails
[07:17:50] rvanlieshout: errakeshpd: that, and use the rails view to correctly include precompiled assets
[07:17:53] Ayey_: has joined #RubyOnRails
[07:21:02] Pupeno: has joined #RubyOnRails
[07:21:47] aganov: has joined #RubyOnRails
[07:23:23] antgel: has joined #RubyOnRails
[07:23:26] finnnnnnnnnnn: has joined #RubyOnRails
[07:24:39] tvw: has joined #RubyOnRails
[07:25:16] QoQOoO: has joined #RubyOnRails
[07:25:16] Meow-J: has joined #RubyOnRails
[07:26:24] srinidhi: has joined #RubyOnRails
[07:26:42] artto: has joined #RubyOnRails
[07:30:26] spyder55: has joined #RubyOnRails
[07:31:07] blackmesa: has joined #RubyOnRails
[07:31:37] Oliphaunte: has joined #RubyOnRails
[07:33:05] linnal: has joined #RubyOnRails
[07:34:06] Kedare: has joined #RubyOnRails
[07:34:39] jahbrews1i: has joined #RubyOnRails
[07:35:54] Fuzai: has joined #RubyOnRails
[07:40:36] QoQOoO: has joined #RubyOnRails
[07:40:39] ngw: has joined #RubyOnRails
[07:42:36] dezull_: has joined #RubyOnRails
[07:47:03] armyriad: has joined #RubyOnRails
[07:48:04] brianpWins: has joined #RubyOnRails
[07:48:19] daumie: has joined #RubyOnRails
[07:53:34] spyder55: has joined #RubyOnRails
[07:53:51] artto: has joined #RubyOnRails
[07:54:20] AimlessRAven: has joined #RubyOnRails
[07:54:33] crdpink2: has joined #RubyOnRails
[07:54:46] AimlessRAven: how to add rails %p class who be variable for example %p."#{@comment.id}"
[07:55:45] QoQOoO: has joined #RubyOnRails
[07:56:34] mechanicles: has joined #RubyOnRails
[07:56:57] solars: has joined #RubyOnRails
[07:57:00] dminuoso: AimlessRaven: So, how about you at least pretend that you try to formulate proper English sentences.
[07:57:31] Pumukel: has joined #RubyOnRails
[08:00:49] QoQOoO: has joined #RubyOnRails
[08:02:39] dionysus69: has joined #RubyOnRails
[08:04:28] AimlessRAven: dminuoso: i have @comment.id var, i wannto add on %p class to be %p-@comment.id
[08:04:51] Palsson: has joined #RubyOnRails
[08:05:08] rvanlieshout: AimlessRaven: http://haml.info/docs/yardoc/file.REFERENCE.html
[08:05:12] rvanlieshout: it's just in there
[08:06:15] AimlessRAven: rvanlieshout: tnx
[08:06:31] rvanlieshout: will the day come you start with reading documentation before you ask? :)
[08:08:37] DaniG2k: has joined #RubyOnRails
[08:08:57] medstudent: has joined #RubyOnRails
[08:09:24] medstudent: Good morning all. Is it possible to ask questions in this channel?
[08:09:39] the_drow: has joined #RubyOnRails
[08:10:33] medstudent: i'm having some trouble nesting resources
[08:11:00] medstudent: (new to rails)
[08:11:14] rvanlieshout: what's your problem?
[08:11:28] medstudent: can i send you a PM? dont wanna spam the channel :p
[08:11:46] roshanavand: has joined #RubyOnRails
[08:11:53] rvanlieshout: could, but there might be other people willing to help too. if you want to send code fragments, log output or whatnot, use gist.github.com
[08:12:10] arathald: could also be valuable to other new people to see the discussion
[08:12:49] medstudent: let me put some c ode on gist
[08:13:25] spyder55: has joined #RubyOnRails
[08:14:23] dminuoso: rvanlieshout: The day when you stop spoiling him, and just tell him to RTFM is the day when you give him the chance.
[08:14:42] dminuoso: As long as people spoonfeed him, his way of avoiding reading and looking for docs works.
[08:15:25] rikkipitt: has joined #RubyOnRails
[08:16:12] medstudent: first thing i did was read the documents
[08:16:24] rvanlieshout: medstudent: that wasn't about you
[08:17:31] travisxcode: Is it against the rules of this channel to ask a question related to getting a job with Rails? I'm working my way through Chris Pine's 'Learn to Program' before moving onto learning Rails, and I am curious as to how people landed their first job as a RoR developer (approximate length of study, what kind of applications they built, etc.)
[08:18:10] rvanlieshout: travisxcode: i don't have any problems with people just asking a question in a normal way.. :)
[08:18:13] Sashimi: has joined #RubyOnRails
[08:18:17] dminuoso: travisxcode: !rtft
[08:18:17] helpa: travisxcode: This channel has a topic that contains helpful links. One of these links may help you. If you cannot see the topic, type /topic and press enter.
[08:18:34] Ayey_: has joined #RubyOnRails
[08:19:19] travisxcode: I just wanted to make sure. I'm relatively new to IRC and don't want to offend anybody with off-topic questions.
[08:19:43] dminuoso: travisxcode: Fair enough, your question seems to be quite legit.
[08:19:52] mfilipe: has joined #RubyOnRails
[08:19:59] dminuoso: This channel not only deals with specific rails programming questions, so the question fits here nicely.
[08:20:03] atomx: has joined #RubyOnRails
[08:20:29] travisxcode: What are some of the important concepts that one should learn in order to land a junior position?
[08:20:45] medstudent: Okay. Here's the code: https://gist.github.com/anonymous/1bca3bdcb4e2a7ba063b05027f8ca6e4
[08:20:59] medstudent: I was trying to nest "questions" under "surveys"
[08:21:20] Pupeno: has joined #RubyOnRails
[08:21:28] medstudent: but when creating a new question, i get the following error: undefined method `questions_path'
[08:21:36] dminuoso: travisxcode: What I care about most, is people knowing how to use git, write commit messages, etc. That to me is more important than rails specific knowledge.
[08:21:58] jsrn: has joined #RubyOnRails
[08:22:11] travisxcode: dminuoso, You are in charge of the hiring process at some company?
[08:22:17] dminuoso: travisxcode: No.
[08:22:50] dminuoso: travisxcode: The point Im trying to make is that Rails specific knowledge can easily be accumulated. For a junior position it's more important that you are able to learn and adapt.
[08:24:03] travisxcode: dminuoso, So, assuming that I have some prior web development experience (basic HTML/CSS/PHP), you think that it would be relatively possible to get a junior position without much study?
[08:24:23] AimlessRAven: $('#comment_<%= @comment.id%>').html "<%= escape_javascript(render partial: 'form', locals: {comment: @comment }) %>"
[08:24:35] AimlessRAven: how to add remote: true here, to not open my link just rend to comemnt view
[08:24:51] Pupeno: has joined #RubyOnRails
[08:25:13] dminuoso: travisxcode: It depends really. But having actual Ruby knowledge is far more important than Rails knowledge.
[08:25:49] travisxcode: dminuoso, Thank you. I'm actually working through a Ruby book as we speak.
[08:25:56] dminuoso: travisxcode: That is a great approach.
[08:26:30] rvanlieshout: medstudent: the form isn't aware of your nested stuff
[08:26:41] travisxcode: I'm about to try to build a little stopwatch console application that starts and stops on the Enter key, and updates every second.
[08:26:51] dminuoso: travisxcode: Further than that, if you want to show off your skills and knowledge - have a github profile that shows your contributions.
[08:26:53] rvanlieshout: so if you want to use the nested resource :questions, you'll have to tell the form that
[08:27:14] rvanlieshout: form_for([@survey, @question])-ish
[08:27:18] dminuoso: travisxcode: From the people I know, github profiles is what buys you good job interviews.
[08:27:19] travisxcode: It isn't a requirement of the book or anything, but I think it would help me practice what I've learned throughout the first three chapters.
[08:28:05] medstudent: That's what i thought, so i tried giving it as a parameter to the question.
[08:28:24] medstudent: @question = Question.new(:survey_id => params[:survey_id])
[08:28:32] rvanlieshout: medstudent: that's not the same
[08:28:48] travisxcode: I've been writing super simple programs, such as one that takes input from the user (first, middle, and last name), then uses the .length method to add and output the results.
[08:28:51] rvanlieshout: and @question = @survey.quetions.build
[08:29:06] travisxcode: Should I not even put super simple projects such as that on my GitHub account?
[08:29:12] medstudent: yeah i tried that as well ^^
[08:29:16] travisxcode: Do you think it would make me look incompetent?
[08:29:35] rvanlieshout: medstudent: so your @question-instance is ok, now use the @survey in the form_for and you're set
[08:32:16] medstudent: Just for my own understanding. @survey.questions.build is the same as Question.new(:survey_id => params[:survey_id]) right ?
[08:32:36] rvanlieshout: it doesn't use params
[08:32:41] rvanlieshout: it uses @survey.id
[08:34:43] eGGshke: has joined #RubyOnRails
[08:36:06] medstudent: can i use the same thing in my 'create'
[08:36:15] Pazician: has joined #RubyOnRails
[08:36:15] Pazician: has joined #RubyOnRails
[08:36:17] medstudent: so before it was @question = Question.new(question_params)
[08:36:33] medstudent: now it should be @question = @survey.questions.build(question_params) ?
[08:36:42] rvanlieshout: @survey.questions.create(question_params)
[08:37:33] medstudent: Woooot it works :D
[08:37:41] medstudent: Thanks! / Bedankt :)
[08:38:02] M4dH4TT3r: has joined #RubyOnRails
[08:38:37] rvanlieshout: graag gedaan :)
[08:40:54] Jasaka: has joined #RubyOnRails
[08:46:45] latemus: has joined #RubyOnRails
[08:48:14] medstudent: i think im gonna switch to a real irc client now
[08:48:17] medstudent: this was really helpful
[08:48:50] rocketsurgeon: has joined #RubyOnRails
[08:49:09] medstudent: hi rocketsurgeon
[08:49:52] rvanlieshout: join + quit doesn't really count as merge
[08:50:59] artto: has joined #RubyOnRails
[08:52:24] Ayey_: has joined #RubyOnRails
[08:54:31] ecnalyr: has joined #RubyOnRails
[09:03:20] benlieb: has joined #RubyOnRails
[09:08:42] workmad3: has joined #RubyOnRails
[09:13:17] Guest76251: has joined #RubyOnRails
[09:14:06] tennis: has joined #RubyOnRails
[09:14:56] mx055: has joined #RubyOnRails
[09:19:36] flashpoint9: has joined #RubyOnRails
[09:19:47] Oliphaunte: has joined #RubyOnRails
[09:20:20] rikkipitt: has joined #RubyOnRails
[09:21:25] lexileo: has joined #RubyOnRails
[09:24:56] silverdust: I have a `before_action :authenticate_admin!` with devise and I have a PUT action that serves as an API. How may I get the API users to authenticate? If I had to give a header key for authorization how should I go about that?
[09:27:27] silverdust: right now API users will just get a 302 response as it tries to redirect them to the login page for authentication
[09:27:56] dminuoso: silverdust: You will need a custom Warden strategy
[09:28:14] dminuoso: silverdust: Do you have a specified mechanism that you would like to use for API authentication?
[09:28:54] the_drow: has joined #RubyOnRails
[09:30:43] silverdust: dminuoso: I'll like to provide a key for Header authorization
[09:30:59] dminuoso: silverdust: https://gist.github.com/anonymous/3dabcbeed2cdf524473d08054f5f9d17
[09:31:07] latemus: has left #RubyOnRails: ()
[09:31:08] dminuoso: This is an extract from my param key authorization using JWT.
[09:32:00] dminuoso: (That strategy then needs to be unshifted to your warden strageies in devises configuration)
[09:32:11] dminuoso: Should be trivial to adapt this to your needs.
[09:33:31] edwinvdgraaf: has joined #RubyOnRails
[09:34:30] Coldblackice: has joined #RubyOnRails
[09:34:34] silverdust: I've never used Warden but I'll look into this to see how I can apply it
[09:35:21] dminuoso: silverdust: You have been using Warden the moment you plugged Devise in. ;-)
[09:36:41] silverdust: ha I see so I don't have to install a separate gem for it since it's a devise dependency
[09:36:57] Circuit8: has joined #RubyOnRails
[09:37:24] dminuoso: Indeed. Devise is just a construct built ontop of Warden. :)
[09:38:01] dminuoso: silverdust: Warden is the authentication framework, and you are trying to add an entirely new strategy that simply does not use Devise.
[09:39:15] jeromelanteri: https://gist.github.com/jerome-diver/091e3acf3aba53d2eb847c7caf00c566
[09:39:22] bruce_lee: has joined #RubyOnRails
[09:40:19] daffy_duck_3: has joined #RubyOnRails
[09:40:19] jeromelanteri: trying to have input fields for edition in exactly same place of targeted data position from show view but form_for mecanism split and failed at submit time by empty params error.
[09:40:46] jeromelanteri: how it should be possible to do this idea with rails (if it is possible with rails) ?
[09:42:18] jeromelanteri: "?" char is short for understand the question.
[09:43:08] silverdust: This makes more sense. Warden is just like PassportJS
[09:44:28] rvanlieshout: it's short for wut?
[09:44:42] rvanlieshout: that would be short for i don't understand your question. Could you explain?
[09:45:08] jeromelanteri: rvanlieshout, yes, did you read the file first please ?
[09:45:24] rvanlieshout: ah. didn't see that one
[09:45:38] rvanlieshout: why a - @form = form?
[09:45:57] jeromelanteri: rvanlieshout, i think if you look at this content paste gist github files, you may understand better what i'm trying to do
[09:46:19] rvanlieshout: @-variables are never locals
[09:46:26] rvanlieshout: a partial shouldn't contain anything with an @
[09:46:32] jeromelanteri: rvanlieshout, because i what to share the "form" variable for have a full parmas at submit time
[09:46:40] rvanlieshout: and the js doesn't know about your form builder
[09:46:56] jeromelanteri: rvanlieshout, yes
[09:47:07] rvanlieshout: it's wrong usage of instance variables + a js that doesn't know the form builder
[09:47:09] jeromelanteri: so, what is the way to achieve the idea with rails ?
[09:47:18] rvanlieshout: what exactly?
[09:47:42] jeromelanteri: ok... imagine you have a "show" view contains datas. ok ?
[09:48:00] jeromelanteri: now imagine there is a "edit" button for call "edit" action
[09:48:43] jeromelanteri: then when you click it, instead of call a full new "_form" partial file, it just change data on show view with input fields.
[09:48:54] jeromelanteri: is that explication make more sens ?
[09:48:55] rvanlieshout: but the show didn't contain a form
[09:49:10] rvanlieshout: nor should it
[09:49:30] jeromelanteri: ok... but do you understand the idea i try to do ?
[09:49:49] jeromelanteri: the question now is: how to do that with rails ?
[09:49:51] rvanlieshout: well. just that you want to render a form when somebody clicks edit
[09:49:59] rvanlieshout: plus some over complication
[09:50:12] rvanlieshout: it should be on the same place as where you would normally have the show
[09:50:21] jeromelanteri: i'm not trying to add subjective vision of doing things... i just try to do something.
[09:50:22] rvanlieshout: but then just render the full html in your edit where it's on the same place
[09:50:25] rvanlieshout: add turbolinks and done?
[09:51:08] jeromelanteri: rvanlieshout, you missunderstand the question. I know to do that allready, i try to do something different for have a best inetrface.
[09:51:36] rvanlieshout: add remote: true to that edit link, and follow up on ajax:success-event in js
[09:51:48] rvanlieshout: where you replace the show-data with the form rendered in the response
[09:51:51] jeromelanteri: at which moment you not undretsand the idea to try to have input field in place of datas inside the initial show view ?
[09:52:42] rvanlieshout: i do, but that's nothing more then $('#customer-details-thing').replaceWith(string_from_response_that_contains_form)
[09:52:51] rvanlieshout: and also not really different from when using turbolinks
[09:53:02] rvanlieshout: the whole body is changed, but if you render the same nobody notices
[09:53:25] jeromelanteri: rvanlieshout, so it's maybe me i not undersatnd your idea for achieve this... where is the form container ?
[09:53:33] rvanlieshout: rendered by the edit action
[09:53:40] silverdust: dminuoso: wouldn't it just be easier if I added an exception for the action of my api from authenticate! and check the headers to see if a token is set manually?
[09:54:01] arBmind: has joined #RubyOnRails
[09:54:07] silverdust: It looks a little intimidating and I can't find a hand-holding guide
[09:54:07] sevenseacat: has joined #RubyOnRails
[09:54:17] silverdust: Hi sevenseacat
[09:54:24] sevenseacat: good afternoon
[09:54:28] jeromelanteri: rvanlieshout, could you show me an example ?
[09:54:47] jeromelanteri: rvnor explain me more detailed the idea for do that ?
[09:54:57] silverdust: Hope you're having a good day
[09:55:01] rvanlieshout: jeromelanteri: well. go back to a state where you just have your edit be an edit
[09:56:06] rvanlieshout: then, 1) add remote: true to that link and 2) an .on('ajax:success', function(xhr, data, status) { console.log(data); })
[09:56:45] rvanlieshout: the edit-link
[09:56:54] jeromelanteri: yes and then...
[09:57:26] sevenseacat: have you done that?
[09:57:33] rvanlieshout: of you have this, 3) check that you get a form with html there, 4) change controller so that on request.xhr? it doesn't render within the layout and only returns the form html 5) use the data to place somwwhere in your body
[09:57:35] jeromelanteri: from the idinital edit button, not submit one... right ?
[09:57:58] pawnbox: has joined #RubyOnRails
[09:58:00] rvanlieshout: the thing on the show page
[09:58:10] mx055: Hello, I study a course, on openclassrooms at present, and I meet a problem on an activity. I have to realize a mini blog with rails, and I obtain an error Action Controller: exception caught. Uninitialized constant Accueil Controller::Content. I have to modify pages controller, and there I stagnate a little, I do not really find the solution. Anybody can help me ?
[10:00:14] jeromelanteri: rvanlieshout, i'm trying to understand...
[10:03:15] benlieb: has joined #RubyOnRails
[10:04:50] rvanlieshout: that's important, so take your time for it
[10:10:46] jahbrews1i: has joined #RubyOnRails
[10:12:35] alebatt: has joined #RubyOnRails
[10:14:18] Oliphaunte: has joined #RubyOnRails
[10:15:19] roamingdog: has joined #RubyOnRails
[10:16:35] blackhuey: has joined #RubyOnRails
[10:18:19] snowy: has joined #RubyOnRails
[10:18:51] dminuoso: silverdust: It is just badly documented, it is extremely simple.
[10:19:16] dminuoso: silverdust: What authentication mechanism do you require?
[10:19:39] dminuoso: mx055: !rule3
[10:19:39] helpa: mx055: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[10:19:51] alebatt: Anybody use Rails use docker ?
[10:20:16] dminuoso: mx055: !rule3.2
[10:20:16] helpa: mx055: A "Full Trace" as opposed to the default "Application Trace" is preferred.
[10:20:55] Detch: has joined #RubyOnRails
[10:21:43] artto: has joined #RubyOnRails
[10:24:09] Ropeney: has joined #RubyOnRails
[10:25:39] srinidhi: has joined #RubyOnRails
[10:29:50] Abhijit: has joined #RubyOnRails
[10:30:43] allcentury: has joined #RubyOnRails
[10:30:58] Guest34179: in linux when we set RAILS_ENV=dev its set on that whole os for parmament (kind of) right? does it make difference if i write rails_env=test && rake command or rake command && rails_env=dev does this writing after / before changes the env only for that command or for whole os?
[10:31:39] benlieb: has joined #RubyOnRails
[10:33:20] DaniG2k: have you peeps upgraded any apps to Rails 5? When I try updating my Gemfile to use 5.0.0 and then run bundle update, I am seeing a bunch of nasty red errors telling me that some gem depends on some gem that depends on some other gem
[10:33:31] DaniG2k: which doesn't explain why I can't update to 5.0.0 @_@
[10:33:38] DaniG2k: but it's preventing me from updating the gems
[10:34:27] sevenseacat: DaniG2k: !debug
[10:34:27] helpa: DaniG2k: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[10:35:45] alfiemax: is there a block syntax for text_field ?
[10:35:48] DaniG2k: sevenseacat: https://gist.github.com/DaniG2k/1c389da4fe97e2bf191e73ba4097fb25
[10:36:16] sevenseacat: DaniG2k: https://gist.github.com/DaniG2k/1c389da4fe97e2bf191e73ba4097fb25#file-bundle_update-txt-L35-L41
[10:36:24] sevenseacat: and everything below it
[10:36:36] sevenseacat: they show you exactly why it cant be upgraded
[10:38:01] DaniG2k: ah right so acts-as-taggable-on doesn't support Rails 5 :/
[10:38:26] sevenseacat: it might, but the version you're using is restricted
[10:38:36] sevenseacat: you may need to also upgrade that too
[10:39:07] DaniG2k: all I have in my Gemfile is gem 'acts-as-taggable-on'
[10:39:14] DaniG2k: I'm not locking it to a specific version that I'm aware
[10:39:36] sevenseacat: when you installed it, it installed a specific version - thats listed in your Gemfile.lock
[10:39:40] sevenseacat: it is locked to that version
[10:39:41] silverdust: dminuoso: Can I just skip authentication and focus on authorization by headers?
[10:39:58] silverdust: Even using Warden directly
[10:40:48] silverdust: My goal is give out API to accept PUT/PATCH operation and provide a single header authorization key
[10:41:56] silverdust: I'd skip authentication for that API completely if it wasn't something that when used maliciously can cause a great harm
[10:42:56] solars: has joined #RubyOnRails
[10:43:28] pawnbox: has joined #RubyOnRails
[10:47:58] abhvl: in linux when we set RAILS_ENV=dev its set on that whole os for parmament (kind of) right? does it make difference if i write rails_env=test && rake command or rake command && rails_env=dev does this writing after / before changes the env only for that command or for whole os?
[10:48:49] rikkipitt: has joined #RubyOnRails
[10:54:30] arup_r: has joined #RubyOnRails
[10:54:46] abhvl: has joined #RubyOnRails
[10:56:04] rvanlieshout: abhvl: it depends on where you set it
[10:56:14] rvanlieshout: if you use RAILS_ENV=test foobar it's only for that command
[10:56:18] arup_r: I am using Angular in 1 Rails project. So far so good. I have announcement feature cookiebased. Now new announcement flag is visible when you do page refresh. I am thinking to implement a pub/sub pattern. Any idea or anybody here did pub/sub in Rails and Angular?
[10:56:37] rodfersou: has joined #RubyOnRails
[10:57:49] arup_r: like an Announcement will be created and I will broadcast that info to browser using Angular + Rails. I have never don't it, so I have zero experience in it. Google is not giving any pointer me too till now :)
[10:58:03] arup_r: s/don't/done
[11:00:19] jeromelanteri: rvanlieshout, do you have a link with example on that idea for populate data with input field with ajax request this way ? because, i don't see/understand how to include and then catch input data to put in the params. (or maybe some key words for search example on google... i'm not english i can not find best key word search for find example on that) ?
[11:01:02] rvanlieshout: jeromelanteri: follow those steps i gave you and you'll see along
[11:01:19] rvanlieshout: you shouldn't be doing this all at once
[11:01:24] umdstu: has joined #RubyOnRails
[11:01:51] jeromelanteri: ok, i'm going to experiment it now.
[11:02:18] rvanlieshout: and do ask anything you want to know while performing those steps
[11:02:24] rvanlieshout: just seeing it in action will help
[11:04:37] jeromelanteri: yes. so definitly i have to remove also the format render to js file (edit.coffee) for catch ajax event on artcilce.coffee instead
[11:04:45] deecross: has joined #RubyOnRails
[11:05:32] edwinvdgraaf: has joined #RubyOnRails
[11:07:29] tvw: has joined #RubyOnRails
[11:08:42] flashpoint9: has joined #RubyOnRails
[11:09:18] Pazician: has joined #RubyOnRails
[11:09:19] Pazician: has joined #RubyOnRails
[11:10:56] Coldblackice: has joined #RubyOnRails
[11:12:15] snowy: has joined #RubyOnRails
[11:13:06] mx055: ok, It works in little meadows as a pastebin Gist ?
[11:13:29] artto: has joined #RubyOnRails
[11:14:21] spyder55: has joined #RubyOnRails
[11:14:56] spyder55: has joined #RubyOnRails
[11:17:11] roamingdog: has joined #RubyOnRails
[11:17:48] roamingdog: has joined #RubyOnRails
[11:24:38] Ebok: has joined #RubyOnRails
[11:25:04] Fernando-Basso: has joined #RubyOnRails
[11:25:56] dionysus69: has joined #RubyOnRails
[11:25:59] naftilos76: has joined #RubyOnRails
[11:29:01] jeromelanteri: <rvanlieshout> then, 1) add remote: true to that link and 2) an .on('ajax:success', function(xhr, data, status) { console.log(data); })
[11:30:13] jeromelanteri: ok, i done it... but then, i do add id: "editor" on link to edit, for catch $("#editor").on 'ajax:success', (xhr, data, status) -> console.log data
[11:30:40] jeromelanteri: but nothing is out. on firebug consoole, then i see the html _form file that is not render on the view...
[11:30:59] rvanlieshout: console.log a $('#editor') just before that $('#editor').on in the js file
[11:32:02] jeromelanteri: yes, i include this code in the article.coffee script on asset/javascript directory
[11:32:07] GorillaApe: has joined #RubyOnRails
[11:32:15] jeromelanteri: but have never catch from ajax:success here
[11:32:28] jeromelanteri: so there is 200 code (success)
[11:32:37] rvanlieshout: that's why i want to see that $('#editor') exists when you try to attach that event
[11:32:49] Guest76251: has joined #RubyOnRails
[11:33:34] jeromelanteri: i look it inside the html firebug reader on "show" page view. yes, linker to edit is well done id="editor"
[11:34:01] baash05: has joined #RubyOnRails
[11:34:03] rvanlieshout: add that console.log($('#editor')) on the line just before where you add that event listener
[11:34:15] jeromelanteri: ho ok sorry...
[11:34:45] rvanlieshout: cause it's based on assumptions
[11:35:19] baash05: Hey all.. any one know how to change the queues of items in rescue?
[11:36:36] roelof: has joined #RubyOnRails
[11:37:10] roelof: How do I make it work that I can update a record.
[11:37:32] marr: has joined #RubyOnRails
[11:37:39] roelof: Im making a record with this : @account = FactoryGirl.create(:valid_account)
[11:38:06] roelof: and want to change the name with this : process :update, method: :patch, params: {params: {id: @account["id"],name: "Test Account" }, format: :json }
[11:38:14] silverdust: dminuoso: you there?
[11:38:34] GorillaApe: Hello. What does it need to create a Universal ID an ID provider service?
[11:38:38] roelof: but if I look at the error message : No route matches {:action=>"update", :controller=>"account", :format=>:json, :params=>{:id=>1, :name=>"Test Account"}}
[11:38:58] baash05: GorillaApe: Take a look a guid's.
[11:39:01] roelof: I cannot use the name part which has to change. How do I make this work ?
[11:39:17] jeromelanteri: rvanlieshout, it show me in the console firebug the object [a#editor /articles/9/edit] (9 is the current id of the article show)
[11:39:32] ldnunes: has joined #RubyOnRails
[11:39:53] baash05: http://stackoverflow.com/questions/18228324/i-need-to-generate-uuid-for-my-rails-application-what-are-the-optionsgems-i-h
[11:40:03] baash05: That's for you GorillaApe
[11:40:04] jeromelanteri: the ajaxSuccess line has function(fn) (nothing inside)
[11:40:07] rvanlieshout: jeromelanteri: and that's the link you're pressing?
[11:40:13] rvanlieshout: jeromelanteri: no console.log?
[11:40:37] rvanlieshout: 13:40 < jeromelanteri> the ajaxSuccess line has function(fn) (nothing inside)
[11:40:44] rvanlieshout: you mean you don't have a console.log in your function?
[11:40:54] jeromelanteri: but have result of this _form html file who is not rendered... (the get occur and result is success 200 OK)
[11:41:31] rvanlieshout: oh so it works? the form data is logged to your console?
[11:42:05] jeromelanteri: rvanlieshout, https://gist.github.com/jerome-diver/4b4729c974a73c477c594b0c4493d81b
[11:42:41] GorillaApe: sorry I didnt mean that. I mean an authentication/authorization provider
[11:42:53] GorillaApe: maybe oauth/openid etc..
[11:43:21] GorillaApe: I feeel like I cant do that alone for a large scale application (million users)
[11:43:23] rvanlieshout: jeromelanteri: $(document).on 'ajax:success', '#editor', (xhr, data, status) ->
[11:43:27] rvanlieshout: to make it only for #editor
[11:43:32] rvanlieshout: but is that console.log triggered?
[11:45:29] jeromelanteri: console.log who said "OK..." and ask for show data ?
[11:45:40] Papierkorb: rvanlieshout: I think you meant => instead of ->
[11:46:04] Papierkorb: rvanlieshout: oh sorry then
[11:46:32] jeromelanteri: Papierkorb, i tried for be sure... but not...
[11:46:35] roelof: sevenseacat: my problem clear or not ?
[11:46:53] sevenseacat: roelof: !debug
[11:46:53] helpa: roelof: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[11:47:02] rvanlieshout: jeromelanteri: you don't have any output on your js console?
[11:47:17] linnal: has joined #RubyOnRails
[11:48:41] jeromelanteri: i have two output: the console.log $("editor") who show the object[ a#editor /articles/9/edit ], and the return from GET http://localhost:3000/articles/9/edit 200 OK (content of this is the _form file that i not print)
[11:48:59] rvanlieshout: ok, so that step works
[11:49:11] rvanlieshout: you'll have to use that data to place it in the document
[11:49:21] rvanlieshout: where do you want that data in the html?
[11:49:30] jeromelanteri: but not this one from catch ajax:success event nor on document targeted or not on id, or from $("#editor").on 'ajax:success'...
[11:50:02] rvanlieshout: the $(document).on is even better
[11:50:10] rvanlieshout: if you add '#editor' as second argument
[11:50:22] jeromelanteri: rvanlieshout, i would like each form input related to each data on show view in precise place of the related data (all are referenced on show view with id or class)
[11:50:22] rvanlieshout: and it's caused because #editor doesn't exist when you try to add the event listener
[11:51:00] roamingdog: has joined #RubyOnRails
[11:51:33] jeromelanteri: rvanlieshout, ok, so i have to put it inside the $(document).on refresh event catch ...
[11:51:36] Coldblackice: has joined #RubyOnRails
[11:51:40] rvanlieshout: like you have now
[11:51:56] artto: has joined #RubyOnRails
[11:53:11] roelof: sevenseacat: this better or is there missing info : https://gist.github.com/rwobben/92f65dcd023ec1ad37a37a3315ca94c9
[11:53:35] sevenseacat: roelof: why do you have params: { params: {} } ?
[11:54:05] roamingd_: has joined #RubyOnRails
[11:54:24] baash05: Hey all.. i have a pile of jobs in a rescue cue, and I want to change them to another cue.
[11:54:28] baash05: Is that possible?
[11:54:33] flashpoint9: has joined #RubyOnRails
[11:55:09] roelof: sevenseacat: params {} ??? where it schould be {params: {id: @account["id"],name: "Test Account" }, format: :json }
[11:55:45] quazimodo: has joined #RubyOnRails
[11:56:04] roelof: I wonder where you found params : {} . params schould not be empty ?
[11:56:17] sevenseacat: roelof: no, why do you have nested params inside params
[11:56:58] roelof: aha, there is a problem. It schould not be nested , I will take a look why this happens
[11:57:05] sevenseacat: because you wrote it in your test
[11:57:10] sevenseacat: thats why it happens
[11:57:15] Fernando-Basso: Where is 'y' documented as the 'y' used in rails console, 'y Post.all' ?
[11:57:29] Fernando-Basso: rails console --help doesn't show it, for instance.
[11:57:37] jeromelanteri: rvanlieshout, i have to first arrive to catch by coffee/jquery function the event listner on ajax:success... actualy, i'm not able to catch it. I will insist to find why and fix this step first and will go back.
[11:58:34] sevenseacat: Fernando-Basso: in the gem that defines it, in this case probably psych
[11:58:40] sevenseacat: it's a yaml formatter
[11:58:42] rvanlieshout: you were able to catch it using $(document).on 'ajax:success', '#editor', (xhr, data, status) ->
[11:58:56] Fernando-Basso: So, rails console is provided by a gem?
[11:59:17] sevenseacat: but I was talking about the y method
[11:59:27] sevenseacat: which has nothing to do with the rails console
[11:59:34] Fernando-Basso: I know (think I know) rails console is irb with rails stuff loaded.
[11:59:49] silverdust: it could also be pry with pry-rails gem
[11:59:50] jeromelanteri: rvanlieshout, no... i try this and place it on many different places, then now try with function jquery.ajaxSucess...
[12:00:09] rvanlieshout: jeromelanteri: a $(document)-call should be placed top level of your js
[12:00:31] Fernando-Basso: sevenseacat, Okay. Thanks.
[12:01:10] allcentury: has joined #RubyOnRails
[12:01:15] Jet4Fire: has joined #RubyOnRails
[12:02:21] Fernando-Basso: Got it. y is a method provided by a gem. And since rails console gives me the rails env, I can use `y`.
[12:02:50] roelof: sevenseacat: updated the gist to the new situation : https://gist.github.com/rwobben/92f65dcd023ec1ad37a37a3315ca94c9
[12:03:11] bradflaugher: has joined #RubyOnRails
[12:03:32] jeromelanteri: rvanlieshout, no... but i'm thinking about something...for catch an "ajax:event" maybe i need to first add a format to do |f| f.json end in the edit controller... because console show the GET is asking for a js file
[12:03:56] jeromelanteri: if it would ask for a json instead... maybe ajax should works this way ?
[12:04:36] rvanlieshout: jeromelanteri: ajax:success is only triggered if the response has code 200. is there a xhr triggered with a 200 response?
[12:05:06] rvanlieshout: and if you use a $(document).on 'ajax:success', ->
[12:05:12] rvanlieshout: and console.log this
[12:05:12] jeromelanteri: GET http://localhost:3000/articles/9/edit
[12:05:20] sevenseacat: roelof: so what have you done to fix it?
[12:05:30] jeromelanteri: i see this from firebug console
[12:05:56] jeromelanteri: but steel not be able to handle the event by the listner
[12:06:17] roelof: I deleted the nested params line to a single params line ,nothing more sevenseacat
[12:06:25] jeromelanteri: same with ajaxSuccess function, in the top of the coffee file or not
[12:06:28] sevenseacat: roelof: now try and fix the new problem.
[12:07:52] sergio_101: has joined #RubyOnRails
[12:08:40] rikkipitt: has joined #RubyOnRails
[12:08:56] roelof: sevenseacat: im thinking how to solve it. Appereantly I have to add account so something like this params : { :account {id: @account["id"], name:"Test Account}, format :json } I think
[12:09:17] sevenseacat: roelof: look at the format that your web browser submits params in, and copy that.
[12:10:16] roelof: Can I use the webbrowser on a api ? So I have to goto /accounts/update to see what you mean ?
[12:11:09] jeromelanteri: rvanlieshout, but... i also think i maybe understand the idea... you tell me to catch this event ajax request success and do put each container from the html rendered to the show view from this coffee code inside this function. that's the idea ?
[12:11:12] sevenseacat: roelof: failing that, you have an account_params method that tells you exactly what format it needs to be in
[12:11:18] sevenseacat: because thats what it's permitting
[12:11:39] jeromelanteri: with also the submit container for handle the submission
[12:12:02] jeromelanteri: *so i just need to be able now to catch this success event
[12:12:05] GorillaApe: Hello. What does it take to have a centralized user database and everything stores/software autohroization/services/parterns to use the same unified database? Oauth ? Openid?
[12:12:28] spyder55: has joined #RubyOnRails
[12:12:43] roamingdog: has joined #RubyOnRails
[12:12:56] Guest76251: has joined #RubyOnRails
[12:13:00] roelof: sevenseacat: the accounts_params looks like this : params.require(:account).permit(:name, :category)
[12:13:10] sevenseacat: now you know what to do.
[12:13:58] Velizar: has joined #RubyOnRails
[12:17:25] roelof: sevenseacat: appereantly I do not know: I have now this : params: { :account => {id: @account["id"], name:"Test Account"}, format :json }
[12:17:36] deecross: has joined #RubyOnRails
[12:17:52] roelof: and I see this error message : syntax error, unexpected tSYMBEG, expecting keyword_do or '{' or '(' (SyntaxError)
[12:17:57] sevenseacat: i hope not, because thats a syntax... yeah.
[12:17:59] rvanlieshout: jeromelanteri: that's the idea
[12:19:38] Oliphaunte: has joined #RubyOnRails
[12:20:23] dminuoso: silverdust: You can do whatever you want really. But then you must not enforce device authentication. ;-)
[12:20:55] bensarz: has joined #RubyOnRails
[12:21:20] antgel: has joined #RubyOnRails
[12:21:49] silverdust: dminuoso: as in `before_action authenticate_user!, except: [:myAPImethod]`
[12:22:04] dminuoso: silverdust: Indeed.
[12:23:08] bbrowning: has joined #RubyOnRails
[12:25:05] silverdust: great. So what I just did is real simple. Here http://pastie.org/10904010
[12:26:00] pawnbox: has joined #RubyOnRails
[12:26:17] silverdust: dminuoso: not bad I guess. It's actually `if request.headers['API-KEY'] == 'whatever'`
[12:26:34] rvanlieshout: silverdust: is all of that method wrapped in that if-block?
[12:26:45] roelof: has joined #RubyOnRails
[12:27:01] silverdust: And I'm hard-coding the API-KEY
[12:27:16] dminuoso: silverdust: Well, at least toss your api key into your secrets.yml :)
[12:27:21] roelof: I think I has to do with the :account -> part but have no idea how to solve this. Anyone who can give me a hint ?
[12:27:22] silverdust: All the method just does is something like Foo.update(attrs)
[12:27:26] machinewar: has joined #RubyOnRails
[12:27:38] rvanlieshout: first line: return unless request.headers['API-KEY'] == 'whatever'
[12:27:42] rvanlieshout: then continue to do stuff :)
[12:27:53] errakeshpd: has joined #RubyOnRails
[12:27:59] machinewar: how can Rack middleware be used to modify request before your Rack app is called? I understand using Rack::Builder to modify response, but can't find docs on modifying requet
[12:29:10] dminuoso: machinewar: Just insert a middleware into the stack where you want it.
[12:29:34] machinewar: Oh so Rack::Builder.new do use A; use B; run App; use C end
[12:29:41] silverdust: okay I'll do that
[12:31:04] ecnalyr: has joined #RubyOnRails
[12:31:53] silverdust: rvanlieshout: So this http://pastie.org/10904018
[12:32:37] snowy: has joined #RubyOnRails
[12:32:53] dminuoso: machinewar: Im unsure what problems you have. You have a Rack::Request object - just modify it any way you like it.
[12:32:58] rvanlieshout: yes, if you only want stuff to be performed unless .
[12:33:35] roelof: Can somehow help me to figure out where and how to solve the syntax error here : process :update, method: :patch, params: { :account => {id: @account["id"], name:"Test Account"}, format :json }
[12:33:57] machinewar: format needs :
[12:33:59] pawnbox: has joined #RubyOnRails
[12:34:03] machinewar: its a key not a function
[12:34:10] silverdust: okay that's neater. I don't think ruby enough to have done that. So that's just short for `return false unless condition`
[12:34:28] machinewar: roelof: format: :json
[12:34:30] dminuoso: silverdust: The technique either way is called "returning early"
[12:34:43] dminuoso: silverdust: Even if you had done "if foo; return false; end" :)
[12:35:07] stardiviner: has joined #RubyOnRails
[12:35:21] silverdust: okay thanks dminuoso , rvanlieshout
[12:35:22] daumie: has joined #RubyOnRails
[12:36:06] abhvl: can i simulate params like testparams={id=1,name="test"} in rail 3
[12:36:27] roelof: chips and now I see this old message again : No route matches {:account=>{:id=>1, :name=>"Test Account"}, :action=>"update", :controller=>"account", :format=>:json
[12:36:34] helpa: abhvl: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[12:37:49] abhvl: how can i pass argmunt to my model method from my unit test who will simulate real params?
[12:38:16] dminuoso: abhvl: Are you asking how to pass arguments?
[12:39:02] dminuoso: roelof: I wonder whether you may have to place all the options into an explicit hash.
[12:39:25] abhvl: dminuoso: x = myfun(one) will pass one as argument to x.
[12:39:41] abhvl: dminuoso: sisnce i am testing, i jus twant to simulate real params
[12:39:57] dminuoso: abhvl: What part of your application are you testing? Please gist the code you already have.
[12:40:07] roelof: dminuoso: I have no idea anymore, The only thing I try is to update a account which is made by Factorygirl
[12:40:34] roelof: I try to change the name from "Example Account" to "Test Account"
[12:40:43] dminuoso: roelof: Which context is your code being run? test/spec?
[12:41:38] roelof: I try to run a rspec controller spec on my api
[12:42:10] dminuoso: roelof: Can you check which method is actually being called when you invoke process?
[12:42:11] abhvl: dminuoso: why that matters?
[12:42:35] jmignault: has joined #RubyOnRails
[12:42:36] roelof: dminuoso: how do I check that on a api ?
[12:42:39] dminuoso: abhvl: !rule3
[12:42:40] helpa: abhvl: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[12:42:45] baash05: Anyone using Google Push GCM?
[12:42:49] dminuoso: roelof: I mean inside the spec.
[12:43:20] roelof: dminuoso: i also mean that
[12:43:39] baash05: https://github.com/spacialdb/gcm
[12:43:58] roelof: or do you mean the patch method could be wrong, dminuoso ?
[12:44:21] defsdoor: has joined #RubyOnRails
[12:44:28] dminuoso: roelof: Well, you are invoking a method called "process" - and I want to know what exactly you are invoking.
[12:44:40] Guest76251: has joined #RubyOnRails
[12:45:02] dminuoso: roelof: from what I can see, process is to be used like this:
[12:45:03] dminuoso: process :options, path, parameters, headers_or_env
[12:45:18] orolo: has joined #RubyOnRails
[12:45:34] dminuoso: Which would also explain your exact error, becuase the kwargs are put into a hash and considered the second argument.
[12:45:45] flashpoint9: has joined #RubyOnRails
[12:45:46] machinewar: dminuoso: I mean is there a way to intercept the environment after my Rack app's call method has been executed to modify response on way back to the web server, I can only seem to modify thing before my Rack App's call method is called
[12:45:49] roelof: oke, I use it like this : process :index, method: :get, params: {format: :json } and then it worked
[12:46:56] baash05: I was wondering if anyone is using Push notifications because it strikes me as very slow.. one push at a time.
[12:47:56] roelof: dminuoso: and I have used it like this : process :show, method: :get, params: {id: @account["id"], format: :json } for a show action which worked well
[12:48:08] dminuoso: has joined #RubyOnRails
[12:48:18] roelof: dminuoso: and I have used it like this : process :show, method: :get, params: {id: @account["id"], format: :json } for a show action which worked well
[12:48:55] rikkipitt: has joined #RubyOnRails
[12:49:11] roelof: so there schould be 2 seperate parameters in the hash. The record and the part format: :json
[12:49:30] roelof: and I think there is something wrong
[12:50:12] sk0r: has joined #RubyOnRails
[12:50:53] roelof: If I look at the route : PATCH /account/:id(.:format) account#update , it only need a id
[12:51:06] roelof: but somehow I have to say the new data
[12:51:11] mx055: has joined #RubyOnRails
[12:51:53] TvL2386: has joined #RubyOnRails
[12:54:20] sevenseacat: roelof: have you ever built an update action before?
[12:55:15] roelof: sevenseacat: not for a api. For a full blown site I always made a form. Push the update button and it worked
[12:55:23] Coldblackice: has joined #RubyOnRails
[12:55:38] sevenseacat: roelof: great, so go look at one of those and see what kind of structure the params get submitted in
[12:55:56] roelof: oke, I will
[12:56:15] roelof: sevenseacat: thanks for the help so far
[12:56:37] roelof: dminuoso: thanks so far
[12:57:51] sevenseacat: this is all the kind of stuff covered in tutorials btw.
[12:58:26] burgestrand: has joined #RubyOnRails
[12:58:30] roelof: sevenseacat: then I cannot find the good tutorials :(
[13:01:07] cd-rum: has joined #RubyOnRails
[13:01:33] mx055: Here is the code of my controller gist:d20c2a260e25eebd11eae5a5fa056f2b
[13:02:22] dkam: has joined #RubyOnRails
[13:03:05] mx055: https://gist.github.com/anonymous/d20c2a260e25eebd11eae5a5fa056f2b#file-gistfile1-txt
[13:03:31] ramortegui: has joined #RubyOnRails
[13:03:35] ekinmur: has joined #RubyOnRails
[13:04:14] silverdust: I find this weird `Product.find_by('stock_id', params[:stock_id])`
[13:04:26] andywww: has joined #RubyOnRails
[13:04:28] silverdust: PG::DatatypeMismatch: ERROR: argument of WHERE must be type boolean, not type integer LINE 1:
[13:04:28] dkam: Hey guys. I'm upgrading to Rails 5 and the modules defined under lib aren't being loaded, which is guess is caused by autoload being disabled after boot? What's the right way to get that code loaded in production?
[13:04:37] Palsson: has joined #RubyOnRails
[13:05:05] silverdust: Then I tried Product.where() it was fine then Product.where().take gave the error again
[13:05:08] arBmind: has joined #RubyOnRails
[13:05:37] andywww: has joined #RubyOnRails
[13:06:12] mello: i would like to not show activity for current_user if the activity is for the current_user and only show activity for other users, tried this way, it it wont show the activity but it still displays the a tag on the menu. https://gist.github.com/MelloHey/2d836f2044eb03bcd7ffb4dada28cd52
[13:06:24] tycoon177: rvanlieshout: just a heads up, i fixed my issue with devise last night. I had a current_user method in my application controller that was messing with it!
[13:06:25] silverdust: when I .to_sql I have `SELECT "products".* FROM "products" WHERE (stock_id) LIMIT 1)`
[13:06:37] silverdust: which means it's not passing my value to the SQL query
[13:06:53] abhvl: how can i clone :through associations?
[13:07:21] dkam: silverdust: shouldn't that be `Product.find_by(stock_id: params[:stock_id])`
[13:07:34] burgestrand: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[13:08:11] silverdust: ah dammit. My bad. Thanks dkam
[13:08:37] dezull: has joined #RubyOnRails
[13:08:49] dkam: silverdust: no worries
[13:09:18] andywww: has joined #RubyOnRails
[13:10:09] solars: has joined #RubyOnRails
[13:10:33] dminuoso: Okay, so I made the mistake of running a migration, and then git resetting for other reasons. Amongst the things I somehow ended up manually cleaning up the database, and everything is back to where it was. Is updating my SCHEMA_MIGRATIONS to the correct version all I need to do now?
[13:10:45] dminuoso: Or is there some other bookkeeping by rails for migrations that I need to consider?
[13:11:04] andywww: has joined #RubyOnRails
[13:13:31] jeromelanteri: rvanlieshout, i find a clue... when i try with ajax:complete event listner, the event is catch... not witth ajax:success
[13:14:03] jeromelanteri: with rails-4.2.6
[13:14:42] Velizar: RubyMine gives a warning for using more than two instance variables in a view. But then how am I supposed to make a view which needs to display more than 2 things which come from a model?
[13:17:51] FernandoBasso: has joined #RubyOnRails
[13:19:30] harfangk: has joined #RubyOnRails
[13:19:57] rvanlieshout: jeromelanteri: then the response isn't a success-response
[13:19:59] Velizar: for example, I have a view which prints: 1) date of the route, 2) the list of customers visited, 3) an array of DriverLocation-s into a map to see the path the driver took, 4) the full matrix of AddressDistance-s from every address to every other, used in JS to calculate the estimated time of visit for each customer when you rearrange 2.
[13:20:36] jeromelanteri: rvanlieshout, maybe on the mecansim, event ajax:success is allready mounted by rails... and make it forbidden to fire it two times, then stay the complete event to. But yes, it is sure that the answer (response) is SUCCESS because code is 200 OK
[13:21:05] rvanlieshout: nope, that's not the case
[13:21:15] rvanlieshout: you can have multiple ajax:sucess-listeners
[13:21:25] ecnalyr: has joined #RubyOnRails
[13:21:37] jeromelanteri: rvanlieshout, not the case for what i thinking, but the case that response is 200 OK, it is what i read on firebug console
[13:21:42] SteenJobs: has joined #RubyOnRails
[13:21:51] Velizar: oh, also 5) information about the Route such as who is the driver and whether it's completed yet or not; note that the 5 things I said are of 5 different classes
[13:22:00] daumie: has joined #RubyOnRails
[13:22:12] jeromelanteri: rvanlieshout, it is weird that i can not catch this success event...
[13:22:18] chouhoulis: has joined #RubyOnRails
[13:22:29] jahrichie: has joined #RubyOnRails
[13:22:34] jeromelanteri: im' going to search on this way why this occur.
[13:22:53] chouhoulis: has joined #RubyOnRails
[13:24:07] jahrichie1: has joined #RubyOnRails
[13:26:06] pawnbox: has joined #RubyOnRails
[13:28:15] mello: anyone has an idea on how to solve it?
[13:28:37] netzfisch: has joined #RubyOnRails
[13:31:26] aegis3121: has joined #RubyOnRails
[13:31:51] jeromelanteri: mello, in line 7, maybe need to add "partial:" for render the linked partial view in the dropdown-menu element class
[13:32:22] jeromelanteri: between render and the name of the view (then add _ in front of the name of the view file to render as partial)
[13:32:48] jeromelanteri: or layout maybe
[13:33:16] blackmesa: has joined #RubyOnRails
[13:34:30] mello: jeromelanteri: the thing is i dont want the the a tag to be shown for the user making the activity only for users that have not made an activity
[13:35:42] ekinmur: has joined #RubyOnRails
[13:36:18] jeromelanteri: mello, i not understand your sentence... you do not want to see activities of user who are in activity ? you want to see the activities for user who were not in activity ? there is no sens...
[13:36:59] jeromelanteri: or maybe you doesn't want to see activity for current user, but past activities of old logged users...
[13:37:25] arup_r: has joined #RubyOnRails
[13:37:32] jeromelanteri: (i'm trying to understand you)
[13:37:36] dkam: I think he wants to see only activities of the others.
[13:37:47] mello: jeromelanteri: ok let me try and explain again, so when a user post something thats an activity, but i dont want the user posting to see his own activity, only to see activitys for others users. does that make sense for you?
[13:37:52] jeromelanteri: the others who are logged in
[13:38:17] jeromelanteri: mello, yes, i got it
[13:38:23] mello: so if i post soemthing you shoudl see it as an activity but not me and if u post somehting i should see it but not you
[13:38:42] jeromelanteri: mello, i think you have activities logged in a database... correct ?
[13:39:09] mello: and it almost works except that the a tag get displyed, but it dosent hsow any activity i want it to not show the a tag aswell
[13:39:17] jeromelanteri: mello, i think you also want to delete activities has been already shown...)
[13:39:53] jeromelanteri: mello, if you go by log activities on a database, a tool you maybe would like to try is the gem "ransack"
[13:40:05] mello: jeromelanteri: the activity ideletion is on the user, user has the option to delete activitys that are shown
[13:40:36] jeromelanteri: mello, ok, i clearly understand now (i think)
[13:41:00] mello: jeromelanteri: dont know why i would need that? this is just a view problem where i want to hide the <a> tag if the activity is for the current_user
[13:41:52] jeromelanteri: mello, i think you maybe want to try to construct a global variable that answer this request datas of activities (or a json builder) stay in your controller inside the action member for catch these conditions
[13:42:21] jeromelanteri: mello, you need to hide it in the request query
[13:42:38] jeromelanteri: (but it should have also other idea to do that also)
[13:43:18] jeromelanteri: mello, but again, did you log activities in a database ?
[13:43:24] jeromelanteri: (or in a model)
[13:44:36] jeromelanteri: my idea is to log activities on the run for all... then use a search tool for query the request. search tool should have to be adapted with container datas: database with ransack, model text datas with elasticsearch for example...
[13:45:04] jeromelanteri: mello, is there any sens in this idea for you ?
[13:45:45] jeromelanteri: you can also add a washer for wash old activities or more than last 100 actions, etc...
[13:48:44] adlerdias: has joined #RubyOnRails
[13:49:30] mello: jeromelanteri: im a bit confused to be honest
[13:49:41] Cozzie: has joined #RubyOnRails
[13:49:44] jeromelanteri: so for example, create a table named "logs" with association user_id (logs belongs_to :users, users has_many :logs), with columns date:timestamp, url: string, action:string, data_params:string
[13:50:00] mello: i was hoping on a simple solution for just hideng a html element
[13:50:03] jeromelanteri: because you allready have a users table... correct ?
[13:50:34] eljimmy: has joined #RubyOnRails
[13:50:50] jeromelanteri: mello, ho ok... sure, this is not a simple solution... but it is for a big frequentation and strong search activities ability on your applications
[13:52:07] allcentury: has joined #RubyOnRails
[13:52:22] jeromelanteri: so for hidding element, you have to do a nice query request in the controller side i think, then on your code, only condition for check if have something inside @activities should stay...
[13:52:30] Cozzie: Hi, validates_format_of does not seem to exist on the http://guides.rubyonrails.org/ but seem to exist and is documented http://apidock.com/rails/ActiveModel/Validations/HelperMethods/validates_format_of. Any reason why?
[13:52:45] jocuman: has joined #RubyOnRails
[13:53:23] mello: jeromelanteri: ok, will look on that
[13:53:25] jeromelanteri: mello, for do that if your associations are a bit clinky, you can def a private memeber fnction in the controller for use it without need to add a route.
[13:53:57] jeromelanteri: (no error if the ember function stay private and no have route on it)
[13:56:26] blackmesa: has joined #RubyOnRails
[13:57:12] apeiros: cache = {}; proc { |*args| … cache[…] …}
[13:57:12] mello: jeromelanteri: thanx for your help and time
[13:57:20] apeiros: cmd-key accident
[13:57:31] jeromelanteri: mello, you are elcome
[14:00:08] arunpyasi: has joined #RubyOnRails
[14:07:43] arifba: has joined #RubyOnRails
[14:08:03] arifba: When rendering partials, is there a way to only render first x lines from it?
[14:10:53] dminuoso: arif__: That sounds like a code smell. Why not break up into several partials, and include the other if your condition is met?
[14:12:22] jahbrews1i: has joined #RubyOnRails
[14:12:28] arifba: yep that's what i'll have to do, but i was just wondering if it was possible
[14:13:20] dminuoso: arif__: No. But you could also simply use if/else statements if applicapable.
[14:14:20] arifba: Got it, thanks! Also, how did you tag me?
[14:15:10] Oliphaunte: has joined #RubyOnRails
[14:21:02] benlieb: has joined #RubyOnRails
[14:22:28] agent_white: has joined #RubyOnRails
[14:26:31] diegoviola: has joined #RubyOnRails
[14:29:21] agent_white: has joined #RubyOnRails
[14:33:39] tbuehlmann: has joined #RubyOnRails
[14:33:40] ecnalyr: has joined #RubyOnRails
[14:35:32] jahbrewski: has joined #RubyOnRails
[14:40:33] Malgorath: has joined #RubyOnRails
[14:40:48] mwlang: has joined #RubyOnRails
[14:41:31] mwlang: Does it make sense to do both a join and include? For example: Party.joins(:docket).includes(:docket).where(….) ?
[14:42:06] dkam: has joined #RubyOnRails
[14:42:35] Coldblackice: has joined #RubyOnRails
[14:42:48] mark_661: has joined #RubyOnRails
[14:42:49] mwlang: my developer that wrote this says the join is needed because an order clause references a field in the docket table and the include is still needed to avoid N+1 queries.
[14:43:07] daumie: has joined #RubyOnRails
[14:43:22] mwlang: but I was under the impression, that we just pick one or the other, not both.
[14:45:20] roamingdog: has joined #RubyOnRails
[14:45:53] dminuoso: has joined #RubyOnRails
[14:46:09] SteenJobs: has joined #RubyOnRails
[14:47:49] terrabl: has joined #RubyOnRails
[14:48:43] fmcgeough: has joined #RubyOnRails
[14:49:31] oystersauce8: has joined #RubyOnRails
[14:49:44] terrabl: so im trying to link_to something in my probject but when I set it up like this '<%= link_to 'Review', '/loadtests/#{@tests["uuid"]}/review', :class => "btn btn-primary", :id => "loadtest_button" %>' the @tests["uuid"] doesnt get translated to a literal for some reason
[14:50:28] defsdoor: terrabl, single quotes
[14:50:42] andywww: has joined #RubyOnRails
[14:50:43] terrabl: thanks, dumb mistakes
[14:52:41] suchness: has joined #RubyOnRails
[14:53:00] suchness: Anyone know a way to have "a".self return self, or "a"?
[14:53:05] suchness: seems like that should work
[14:55:59] mark_66: has joined #RubyOnRails
[14:56:34] pvertenten: has joined #RubyOnRails
[14:56:47] pvertenten: has left #RubyOnRails: ()
[14:59:56] polishdub: has joined #RubyOnRails
[15:00:21] spyder55: has joined #RubyOnRails
[15:01:35] srinidhi: has joined #RubyOnRails
[15:03:20] bonswouar: has joined #RubyOnRails
[15:03:34] aegis3121: has joined #RubyOnRails
[15:07:10] tjohnson: has joined #RubyOnRails
[15:07:22] apeiros: suchness: hm? there's .itself
[15:07:39] suchness: apeiros: Oh look at that
[15:07:45] apeiros: only recent rubies, though
[15:07:47] bga57: has joined #RubyOnRails
[15:07:56] apeiros: not sure, either 2.2+ or 2.3+
[15:08:08] suchness: apeiros: Ive got it running 2.3
[15:08:13] suchness: That will work fine, thanks!
[15:09:01] one_zero: has joined #RubyOnRails
[15:09:01] asianMike: has joined #RubyOnRails
[15:09:27] workmad3: apeiros: 2.2+
[15:10:35] workmad3: (and it's not hard to add to other rubies either... `class Object; def itself; self; end; end`)
[15:11:43] tbuehlmann: has joined #RubyOnRails
[15:12:05] apeiros: insurmountable
[15:12:41] apeiros: `class Object; def itself; self; end; end unless Object.method_defined?(:itself)`
[15:13:46] Coldblackice: has joined #RubyOnRails
[15:15:24] shinnya: has joined #RubyOnRails
[15:16:28] blackmesa: has joined #RubyOnRails
[15:17:08] daumie: has joined #RubyOnRails
[15:19:27] habitullence: has joined #RubyOnRails
[15:21:27] kies: has joined #RubyOnRails
[15:24:33] groatyoats: has joined #RubyOnRails
[15:25:20] marahin: After editing config/new_framework_defaults.rb - and restarting the server - am I free to delete this file?
[15:25:27] marahin: Or, what am I supposed to do?
[15:26:33] tycoon177: has left #RubyOnRails: ()
[15:30:43] zacts: has joined #RubyOnRails
[15:31:13] SteenJobs: has joined #RubyOnRails
[15:32:12] prithaj: has joined #RubyOnRails
[15:32:23] dopie: has joined #RubyOnRails
[15:33:45] alfiemax: has joined #RubyOnRails
[15:36:19] _djbkd: has joined #RubyOnRails
[15:37:44] User458764: has joined #RubyOnRails
[15:38:27] dgynn: has joined #RubyOnRails
[15:38:32] jhass: if all the file does now is set values to what are defaults now, you can delete it
[15:39:00] zacts: has joined #RubyOnRails
[15:40:25] arup_r: has joined #RubyOnRails
[15:40:26] blackmesa: has joined #RubyOnRails
[15:40:53] rocketsurgeon: has joined #RubyOnRails
[15:41:11] arup_r: I am using https://github.com/drapergem/draper . Now the thing is it is not decorating all objects, as per my console result https://gist.github.com/aruprakshit/584cd5cf598a1ebc82735c7a4216347e . Any idea why?
[15:41:44] rafaelfranca: has joined #RubyOnRails
[15:41:56] arup_r: last object title `"test announcements - 2"` didn't titleized as per the output
[15:42:00] artto: has joined #RubyOnRails
[15:43:18] mwlang: what’s the use case for “itself”?
[15:44:48] tbuehlmann: have you tried to google "ruby itself"?
[15:44:57] Pazician: has joined #RubyOnRails
[15:44:57] Pazician: has joined #RubyOnRails
[15:46:22] rafaelfr_: has joined #RubyOnRails
[15:46:35] achamian: has joined #RubyOnRails
[15:47:04] Anchoaman: has joined #RubyOnRails
[15:47:12] bbrowning: has joined #RubyOnRails
[15:47:38] arup_r: mwlang: that is addintion in 2.2 I hope so
[15:48:13] Coldblackice: has joined #RubyOnRails
[15:48:20] arup_r: and it is a identity function http://stackoverflow.com/questions/19558351/does-ruby-have-an-identity-function-i-e-x-fn-x-for-all-x
[15:50:08] arup_r: anybody can see what is my mistake in the gist pasted above
[15:51:12] dkam: has joined #RubyOnRails
[15:52:45] mwlang: found this discussion on the topic: https://bugs.ruby-lang.org/issues/6373
[15:53:56] mwlang: it’s interesting, but not something I frequently encounter in my own coding…I tend to lean on #tap for these sorts of scenarios where I need the object back in final results.
[15:54:45] arup_r: mwlang: if you are in #ruby, I asked a good question there, and you can follow that if you want. :)
[15:55:10] arup_r: seems to me #itself is a non block version of #itself.. but I am not sure though.
[15:55:33] conta: has joined #RubyOnRails
[15:56:15] [Butch]: has joined #RubyOnRails
[15:56:44] arup_r: non block version of #tap **
[15:57:40] adavia: has joined #RubyOnRails
[15:58:00] kevr: has joined #RubyOnRails
[15:58:23] honeyroasted: has joined #RubyOnRails
[16:05:32] Peteykun: has joined #RubyOnRails
[16:05:38] fructose: has joined #RubyOnRails
[16:06:23] Ayey_: has joined #RubyOnRails
[16:06:45] davidklsn: has joined #RubyOnRails
[16:07:43] _djbkd: has joined #RubyOnRails
[16:08:29] djbkd_: has joined #RubyOnRails
[16:08:44] groatyoats: has joined #RubyOnRails
[16:09:16] jahbrews1i: has joined #RubyOnRails
[16:11:00] rafaelfranca: has joined #RubyOnRails
[16:13:30] fructose: I'm trying to learn rails and have basic model/view/controllers going, but I don't understand the program flow (e.g. how does def new end up rendering new.html.erb, what's going on with the symbol I'm passing to form_for, etc.). Is there a recommended guide for understanding these kinds of things?
[16:14:06] tbuehlmann: sure, try this: http://guides.rubyonrails.org/getting_started.html
[16:14:18] snowy: has joined #RubyOnRails
[16:14:54] fructose: tbuehlmann: I've seen that and I don't think it is explains the program flow
[16:14:56] whathappens: has joined #RubyOnRails
[16:21:11] macsteps: has joined #RubyOnRails
[16:21:14] pawnbox: has joined #RubyOnRails
[16:24:25] bradflaugher: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[16:24:56] ayonkhan: has joined #RubyOnRails
[16:28:10] l4v2: has joined #RubyOnRails
[16:29:55] Coldblackice: has joined #RubyOnRails
[16:30:17] adavia: Whats the benefit in turbolinks 5 of having pages cached?
[16:32:23] roamingdog: has joined #RubyOnRails
[16:32:40] diegoviola: has joined #RubyOnRails
[16:32:52] jhass: fructose: if you learn rails without learning ruby first, it's best to just accept the magic
[16:33:04] jhass: there are explanations, most of them require understanding ruby
[16:36:23] roamingdog: has joined #RubyOnRails
[16:40:00] DoctorMonocular: has joined #RubyOnRails
[16:43:03] fermonkus: has joined #RubyOnRails
[16:43:48] manfrin: has joined #RubyOnRails
[16:44:28] Macaveli: has joined #RubyOnRails
[16:44:32] nettoweb: has joined #RubyOnRails
[16:44:46] dipswitchtest: has joined #RubyOnRails
[16:44:48] flashpoint9: has joined #RubyOnRails
[16:45:15] DoctorMonocular: I have some raw html that it shitty and I want to take that ra html file, transform it into non shitty html (like changing the p tag with the header class to an h1 tag, for example)-- what's the cleanest way to do transformations like that? It's on the tip of my brain, I've seen stuff like this before, but I can't recall how it worked
[16:46:11] fructose: jhass: Well, I'm aiming to learn both. And I'm not opposed to suspending belief, but when I'm trying to learn the distinction between calling form_for with a symbol and with a model object, I start to wonder how the ERB file is being invoked
[16:46:49] cschneid_: has joined #RubyOnRails
[16:47:19] jhass: "how" is just too broad to be answered here
[16:47:22] defsdoor: has joined #RubyOnRails
[16:47:50] jhass: form_for is just a method that takes parameters and does different things depending on those parameters
[16:48:05] jhass: or depending on the type of them I should say
[16:49:18] akira616: has joined #RubyOnRails
[16:49:27] jhass: fructose: https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/form_helper.rb#L432-L441
[16:49:54] zacts: has joined #RubyOnRails
[16:49:57] DoctorMonocular: I found the thing I was thinking of -- Parslet
[16:49:58] DoctorMonocular: http://kschiess.github.io/parslet/transform.html
[16:51:31] roshanavand: has joined #RubyOnRails
[16:51:35] StevenXL: has joined #RubyOnRails
[16:51:56] daumie: has joined #RubyOnRails
[16:52:10] StevenXL: Hello everyone. I have a quick question. I need to run some JavaScript (CoffeeScript), but only if a certain query parameter was passed into my controller. How can I pass data to the JavaScript?
[16:52:23] matthewd: DoctorMonocular: If your input is HTML, you're probably going to have a much better time working with nokogiri or something than writing a parser from scratch
[16:53:16] DoctorMonocular: actually though, as I'm playing with it, I just realized I can generate the document as markdown instead of html
[16:53:32] DoctorMonocular: which of course I can then render to html with kramdown or whatever
[16:53:56] jhass: stevenxl: the gon gem provides a common method
[16:54:05] conta: has joined #RubyOnRails
[16:56:16] banisterfiend: has joined #RubyOnRails
[16:58:20] StevenXL: jhass: this is a special case in my app
[16:58:43] StevenXL: I'd like to avoid an entire gem if possible, but i'll look at what they do and see if i can hand-rolll it.
[16:59:01] noodle: has joined #RubyOnRails
[16:59:28] barhum2013: has joined #RubyOnRails
[17:00:24] StevenXL: jhass: That gem explains exactly how to do it!
[17:00:25] StevenXL: https://github.com/gazay/gon
[17:03:19] jhass: stevenxl: pay attention to XSS vulnerabilities in case you include user data in your hand-rolled solution
[17:03:46] StevenXL: Good call!!!
[17:04:38] Hobogrammer: has joined #RubyOnRails
[17:07:07] Ayey_: has joined #RubyOnRails
[17:07:29] davidklsn: has joined #RubyOnRails
[17:09:24] xall: has joined #RubyOnRails
[17:09:37] Axsuul: has joined #RubyOnRails
[17:09:52] Dimik: has joined #RubyOnRails
[17:11:46] SteenJobs: has joined #RubyOnRails
[17:14:55] macsteps: has joined #RubyOnRails
[17:18:13] clandry94: has joined #RubyOnRails
[17:18:13] spyder55: has joined #RubyOnRails
[17:18:49] hastur: has joined #RubyOnRails
[17:18:52] hastur: hey, i have a rails view with a for loop that runs over some models. why does the array of models get returned in HTML after the loop? how can i prevent that?
[17:19:13] roamingdog: hastur: ;nil
[17:19:25] roamingdog: depending on what you're doing
[17:19:38] jhass: hastur: <%= foo.each -> <% foo.each
[17:19:39] hastur: ;nil where, in the end tag? in the for tag?
[17:20:00] jhass: don't use for, it's not idiomatic
[17:20:01] hastur: it's each, not for
[17:20:05] hastur: im not using for but
[17:20:10] elomatreb: Are you using ERb or another templating engine?
[17:20:10] jhass: then as I said
[17:20:15] jhass: call it inside <% not <%=
[17:20:20] hastur: i still think of it as for because i havent been thru the clockwork orange machine
[17:20:43] elomatreb: Then what jhass said is the best solution
[17:20:49] roshanavand: has joined #RubyOnRails
[17:21:01] roamingdog: hastur: mine was for console, nvm
[17:21:51] roamingdog: has joined #RubyOnRails
[17:22:16] wldcordeiro: has joined #RubyOnRails
[17:22:24] deecross: has joined #RubyOnRails
[17:22:32] cnk: has joined #RubyOnRails
[17:23:42] Terens: has joined #RubyOnRails
[17:26:18] hastur: follow-up: can i somehow escape newlines? as is, they're not playing nice with the code
[17:26:21] davidklsn: has joined #RubyOnRails
[17:26:23] roamingdog: has joined #RubyOnRails
[17:26:46] hastur: apart from like manually regexing them
[17:26:55] hastur: which i guess is an option
[17:28:34] ekinmur: has joined #RubyOnRails
[17:29:10] aegis3121: has joined #RubyOnRails
[17:34:03] Coldblackice: has joined #RubyOnRails
[17:34:16] uranther: has joined #RubyOnRails
[17:34:41] daumie: has joined #RubyOnRails
[17:35:16] uranther: I'm running Rails 4.2 and somehow it is caching my YAML config. I have changed the file but when I run bin/rails server, it still thinks it's the old value! What do?
[17:35:38] daumie: has joined #RubyOnRails
[17:37:42] flashpoint9: has joined #RubyOnRails
[17:39:17] jhass: uranther: check whether you have spring, spork or similar
[17:39:21] jhass: bin/spring stop
[17:39:28] jhass: grep "spork" Gemfile
[17:39:56] uranther: jhass: I see spring in my Gemfile but not in bin/
[17:41:00] workmad3: uranther: try just 'spring stop'
[17:41:01] macsteps: has joined #RubyOnRails
[17:41:19] uranther: "Spring is not running"
[17:41:21] jhass: or bundle exec spring stop if ^ doesn't help
[17:41:45] uranther: same result ;_;
[17:42:36] uranther: No spork in my Gemfile either
[17:42:39] Oliphaunte: has joined #RubyOnRails
[17:43:31] jhass: well, a killall ruby or pkill ruby can't hurt either I guess
[17:44:16] bbrowning: has joined #RubyOnRails
[17:44:52] uranther: this is insanity
[17:45:44] Darkman738: has joined #RubyOnRails
[17:46:45] Darkman738: hi all, is there a way to shorten the logging on the parameters in debug? I'm submitting some lengthy strings and it's causing me to scroll for days
[17:47:20] pawnbox: has joined #RubyOnRails
[17:47:27] elomatreb: darkman738: That's something I'd rather fix by telling my logviewer to not break lines
[17:47:40] DoctorMonocular: has joined #RubyOnRails
[17:49:04] pawnbox_: has joined #RubyOnRails
[17:49:19] yardenbar: has joined #RubyOnRails
[17:49:29] deecross: has joined #RubyOnRails
[17:50:10] uranther: jhass: OK it looks like it was storing the value in my browser session -_- It's just some poor design
[17:50:20] solars: has joined #RubyOnRails
[17:50:58] wldcordeiro: has joined #RubyOnRails
[17:52:04] xall: has joined #RubyOnRails
[17:52:52] alfiemax: i've got a problem, not exactly a rails specific one, but wondering if someone here could probably give me some ideas
[17:53:23] alfiemax: i'm trying to render a html page which lists some reviews as pdf (using wicked_pdf)
[17:54:00] alfiemax: but since all reviews would not be of same length, height of the div of each reviews varies
[17:54:23] ayonkhan_: has joined #RubyOnRails
[17:54:24] alfiemax: and sometimes the page break for the pdf makes it cut off in between a review
[17:54:34] alfiemax: which makes is look.. well not so good
[17:55:01] dkam: has joined #RubyOnRails
[17:55:15] alfiemax: any ideas what i could do here?
[17:55:51] Darkman738: elomatreb: the terminal? Also, these are strings of cert metadata not text. no line breaks
[17:58:39] dionysus69: has joined #RubyOnRails
[17:59:28] netzfisch: has joined #RubyOnRails
[18:01:45] barhum2013: has joined #RubyOnRails
[18:02:12] seaworthy: has joined #RubyOnRails
[18:02:12] seaworthy: has joined #RubyOnRails
[18:03:14] Coldblackice: has joined #RubyOnRails
[18:07:41] VeryBewitching: has joined #RubyOnRails
[18:08:01] Ayey_: has joined #RubyOnRails
[18:08:37] l4v2: how do I work with the production db
[18:08:43] VeryBewitching: If I have a JSONB column with AR, how can I ensure that it's returned with all of it's keys symbolized?
[18:09:10] elomatreb: darkman738: What are you using to look at your logs? If it's less, there's the "-S" option. Long lines will be cut off
[18:09:24] l4v2: never mind I got it
[18:09:33] Darkman738: elomatreb: the terminal
[18:09:50] Darkman738: I'm reading them directly from the output
[18:10:08] elomatreb: Ah, now I get it. Sorry, I don't think I can help you then
[18:13:35] art-solopov: has joined #RubyOnRails
[18:13:46] djbkd: has joined #RubyOnRails
[18:14:42] Spami: has joined #RubyOnRails
[18:18:34] yardenbar: has joined #RubyOnRails
[18:18:46] jenrzzz: has joined #RubyOnRails
[18:19:52] clandry94: Hi, I'm having some confusion with activerecord joins. I'm trying to do something similar to this: Project.join('components.name', 'projects.name').joins(:components)
[18:20:01] clandry94: however, the output only has one column named name
[18:20:12] clandry94: is there an issue doing a join when both columns have the same name?
[18:21:05] clandry94: doing the equivalent method through an SQL fragment produces the same result
[18:21:51] tvw: has joined #RubyOnRails
[18:21:59] tfitts: clandry94: wouldn't both columns name field have to be the same?
[18:22:51] tfitts: what are you joining on?
[18:23:40] clandry94: Component has a foreign key of project_id and there is a relation in activerecord of belongs to and has many between projects and components
[18:24:04] clandry94: My end result is that I want to have the project and components name in the same outputted table
[18:25:15] yfeldblum: has joined #RubyOnRails
[18:25:22] rogue_koder: has joined #RubyOnRails
[18:25:29] clandry94: oh wait, that join should be a 'select' in my query
[18:25:32] clandry94: Project.select('components.name', 'projects.name').joins(:components)
[18:26:37] Dennis1: has joined #RubyOnRails
[18:28:13] Dennis1: I am trying to implement this: At the bottom of the email I want to set a 30-day cookie so when clicked we can know the join_source of the client, does anyone know how can I do this?
[18:28:30] tfitts: what database are you using? Did you try Project.joins(:components).pluck("concat(components.name,projects.name)")
[18:28:43] jiblet: jhass, any place youd recommend where I could read about XSS and how to protect against it
[18:28:50] clandry94: @tfitts I just found pluck as well, going to try that now. This is on MySQL
[18:29:35] jhass: jiblet: it's pretty simple, don't ever let unescaped user provided data be inserted into your text/html response
[18:30:04] jhass: nor inserted into the existing page via JS
[18:30:13] triangles: has joined #RubyOnRails
[18:31:01] cnk: dennis_: You can't set a cookie on an email client - webmail, perhaps, but not for anyone who uses a real email client
[18:31:23] nogic: has joined #RubyOnRails
[18:31:23] cnk: I think you need a token in the link you send them
[18:31:52] clandry94: @tfitts that concat worked somewhat, I think I can go from there. Thanks for the help!
[18:32:15] tfitts: you can also join using ruby join but sql is faster
[18:32:26] hastur: hi again. so i'm making db queries with GET reqs in jQ. I only want the info from the db entry, not any of the rendered HTML. should i make a special view that returns only the entry info? or is there a better way to make db queries through js?
[18:32:54] Dennis1: @cnk got It, how the token part should work?
[18:33:34] cnk: In the link target, use the token to look up the join_source
[18:33:58] tfitts: hastur: you could send the request to /route.json and just return the result in json, otherwise yeah, you do no layout and a view that has nothing but what you want to send
[18:34:05] cnk: so example.com/new_member?token=jinkyoucanusetolookupsource
[18:34:30] hastur: i'll check out route.json - thanks
[18:35:09] alfiemax: anyone here able to help me with wicked_pdf ?
[18:35:21] tfitts: alfiemax: I used it, what help do you need?
[18:35:31] flashpoint9: has joined #RubyOnRails
[18:35:52] Dennis1: thanks cnk
[18:35:57] tfitts: hastur: not specifically route.json, just append .json to the route and your request format will be json and then you can respond to the request with json
[18:36:06] barhum2013: has joined #RubyOnRails
[18:36:17] hastur: i just got that right before you typed it, heh
[18:36:42] hastur: do i need to set that route up in the views or the controller?
[18:37:04] hahuang61: has joined #RubyOnRails
[18:37:05] tfitts: they should already exist for the same route your hitting.
[18:37:17] hastur: ModelsController raises "missing a template for this request format and variant"
[18:37:26] hastur: or sorry iuts ActionController
[18:37:38] davidklsn: has joined #RubyOnRails
[18:37:46] tfitts: so it's being routed properly, you just need to respond to it
[18:38:19] roshanavand: has joined #RubyOnRails
[18:38:28] hastur: oh! so it is getting the JSON but the renderer doesn't speak JSON
[18:39:53] Dennis1: @cnk do you know were can I found an example of this?
[18:40:31] futilegames: has joined #RubyOnRails
[18:41:00] cnk: No. Just make one up. Make a model for what you want ot track. Is 'source' per email sent or per client or ??
[18:41:20] cnk: whatever that is, make a table to track it and make a token column in that
[18:41:22] asheinfeld: has joined #RubyOnRails
[18:42:00] cnk: that token is what can be sent in the link - and in your link's target, you can look up the row in your sources table and record whatever it is you need to to credit the source
[18:42:39] tfitts: I realize rails 5 is pretty fresh but does anyone know of a tutorial for doing ember.js and rails 5 api mode?
[18:43:02] djbkd_: has joined #RubyOnRails
[18:43:07] jheathco: has joined #RubyOnRails
[18:45:43] l4v2: has joined #RubyOnRails
[18:46:29] pawnbox: has joined #RubyOnRails
[18:47:06] Dennis1: has left #RubyOnRails: ()
[18:47:18] groatyoats: has joined #RubyOnRails
[18:47:53] matthewd: tfitts: API mode just turns off some features that aren't needed. Using it should be no different to a regular Rails 4.2 app, for example.
[18:48:45] tfitts: ok. I'll just find an older tutorial then. Thanks.
[18:49:00] upsell5: has joined #RubyOnRails
[18:49:00] jstransky: has joined #RubyOnRails
[18:49:31] barhum2013: has joined #RubyOnRails
[18:49:53] daumie: has joined #RubyOnRails
[18:52:08] Coldblackice: has joined #RubyOnRails
[18:54:46] FCser: has joined #RubyOnRails
[18:55:47] dkam: has joined #RubyOnRails
[18:56:20] hastur: offhand, anyone know if jquery.parseJSON is faster than JSON.parse ?
[18:57:09] hastur: ah it's on so
[18:58:26] Dennis1: has joined #RubyOnRails
[19:00:40] Papierkorb: hastur: it delegates to JSON.parse().
[19:00:57] Papierkorb: hastur: If you don't need to support completely arcane browsers, just use JSON directly
[19:01:11] hastur: rofl. thankfully not!
[19:02:37] cpruitt: has joined #RubyOnRails
[19:03:09] theblang: has joined #RubyOnRails
[19:05:49] l4v2: has left #RubyOnRails: ()
[19:06:19] l4v2: has joined #RubyOnRails
[19:08:54] Ayey_: has joined #RubyOnRails
[19:09:43] Moeh: has joined #RubyOnRails
[19:14:16] Contigi: has joined #RubyOnRails
[19:14:50] l4v2: should the secrets.yml not be pushed up to a save repo?
[19:15:06] qejk: has joined #RubyOnRails
[19:15:36] Axsuul: has joined #RubyOnRails
[19:16:39] baweaver: would you publish your passwords in plain text?
[19:17:27] Coldblackice: has joined #RubyOnRails
[19:17:53] travisxcode: has joined #RubyOnRails
[19:18:24] davidklsn: has joined #RubyOnRails
[19:19:50] tjbiddle: has joined #RubyOnRails
[19:19:50] djbkd: has joined #RubyOnRails
[19:20:11] tjbiddle: Hi everyone!
[19:20:34] macsteps: has joined #RubyOnRails
[19:21:01] jenrzzz: has joined #RubyOnRails
[19:21:04] tjbiddle: Can someone offer insight on the “best” way to get custom 404/500 pages? A lot of solutions are just 1) Create a custom “exceptions app” or 2) Throw in some weird *not_found or something into the routes. Both seem hacky. Can I not just catch an exception and render a page?
[19:23:11] cnk: You can, but where does that 'page' live? It can live in your main app - or in a custom exceptions app
[19:23:48] cnk: and how do you check that it looks the way you want to? that's what #2 solves - see your exception page to debug
[19:24:04] tjbiddle: Living in my main app makes more sense
[19:24:23] tjbiddle: I would be happy to have a views/errors/404.html.erb and just render that
[19:25:09] cnk: OK. That works just fine for 404s For 500s, the problem is if something is borked and you can't use the render machinery......
[19:25:16] nettoweb: has joined #RubyOnRails
[19:26:29] tvon: has joined #RubyOnRails
[19:30:56] tvon: has joined #RubyOnRails
[19:34:18] solars: has joined #RubyOnRails
[19:37:16] DoctorMonocular: has joined #RubyOnRails
[19:38:53] Ayey_: has joined #RubyOnRails
[19:39:21] jstransky: has joined #RubyOnRails
[19:43:32] meoblast001: has joined #RubyOnRails
[19:44:35] tubbo: tjbiddle: you can, use the `rescue_from` macro in controllers.
[19:44:55] tjbiddle: tubbo: I was ActionController::RoutingError doesn’t get caught there apparently
[19:45:10] tjbiddle: So I’m doing a mix of an exception app - to catch ones that are from there; plus rescue_from's
[19:45:13] tubbo: tjbiddle: yeah, so if you're trying to catch "any 404s" and render your own 404 page that might be harder
[19:45:36] tjbiddle: Yeah, exception app + catch all route apparently does make sense
[19:45:38] djbkd: has joined #RubyOnRails
[19:45:41] tjbiddle: *shrug* guess it just looks hacky at first
[19:45:50] tubbo: right, that's what i was gonna say...making a catchall route. you could also modify public/404.html
[19:46:17] tubbo: if you want to basically say "i want to catch all routes here OR render 404", then you do need a catchall route.
[19:47:23] Macaveli: has joined #RubyOnRails
[19:48:22] whathappens: has joined #RubyOnRails
[19:48:31] yfeldblum: has joined #RubyOnRails
[19:49:35] groatyoats: has joined #RubyOnRails
[19:50:42] Coldblackice: has joined #RubyOnRails
[19:51:05] bga57: has joined #RubyOnRails
[19:51:11] flashpoint9: has joined #RubyOnRails
[19:54:05] netzfisch: has joined #RubyOnRails
[19:54:24] DoctorMonocular: has joined #RubyOnRails
[19:56:33] dkam: has joined #RubyOnRails
[20:03:46] Ponyo: has joined #RubyOnRails
[20:04:08] context: has left #RubyOnRails: ()
[20:05:16] whathappens: has joined #RubyOnRails
[20:06:22] macsteps: has joined #RubyOnRails
[20:06:25] hahuang61: has joined #RubyOnRails
[20:06:48] jenrzzz: has joined #RubyOnRails
[20:07:04] ^Denis: has joined #RubyOnRails
[20:09:42] srinidhi: has joined #RubyOnRails
[20:16:14] fox_mulder_cp: offtop = what icon u use to IP address?
[20:16:19] sneakers: has joined #RubyOnRails
[20:19:01] arBmind: has joined #RubyOnRails
[20:22:53] apotry: has joined #RubyOnRails
[20:24:47] ekinmur: has joined #RubyOnRails
[20:27:44] Darmani: has joined #RubyOnRails
[20:30:39] davidklsn: has joined #RubyOnRails
[20:32:59] Guest76251: has joined #RubyOnRails
[20:33:30] aegis3121: has joined #RubyOnRails
[20:33:35] srinidhi1: has joined #RubyOnRails
[20:34:10] oystersauce8: has joined #RubyOnRails
[20:34:36] sumobob: has joined #RubyOnRails
[20:35:30] davidklsn: has joined #RubyOnRails
[20:37:16] pur3eval: has joined #RubyOnRails
[20:37:32] futilegames: has left #RubyOnRails: ()
[20:40:58] futilegames: has joined #RubyOnRails
[20:41:13] futilegames: has left #RubyOnRails: ()
[20:41:45] roshanavand: has joined #RubyOnRails
[20:41:47] davidklsn: has joined #RubyOnRails
[20:43:25] Axsuul: has joined #RubyOnRails
[20:46:10] FCser: has joined #RubyOnRails
[20:47:34] alaing: has joined #RubyOnRails
[20:48:30] alaing: hi I'm using rails 5 and for some reason the applications root is just displaying a white screen, the logs dont seem to indicate that and error has occur
[20:48:32] tfitts: anyone tried https://github.com/thoughtbot/ember-cli-rails with rails 5 api mode? I followed the directions and I can hit the route without getting an error but the page comes up totally blank (source completely blank too). I'm wondering if I have to do something to enable it to output that page in api mode
[20:50:10] dminuoso: has joined #RubyOnRails
[20:50:13] pollardj: has joined #RubyOnRails
[20:51:28] SteenJobs: has joined #RubyOnRails
[20:57:40] blackmesa: has joined #RubyOnRails
[20:58:05] tubbo: tfitts: it wasn't working with rails 5 last i tried
[20:58:08] tubbo: but that was one of the RCs
[20:58:12] tubbo: alaing: on AWS?
[20:58:31] alaing: no locally
[20:58:58] alaing: tubbo i'm using slim-rails
[20:59:13] tubbo: no idea then
[20:59:26] tubbo: alaing: do you actually get a request logged in log/development.log though?
[20:59:48] alaing: just white screen, ive inspected html and nothing in the body
[21:00:05] alaing: one sec i'll clear out the logs and try again
[21:00:09] tubbo: tfitts: your ember app is probably not getting built correctly. try running `ember server`, and see if your app boots on its own. if not, you might need to submit an issue to thoughtbot.
[21:00:12] Polysics: has joined #RubyOnRails
[21:00:57] tubbo: alaing: haha that's not what i asked :) the way one would figure out where the request got eaten would be to check logs, and see if it shows up...for example, i'm using Pow and it's possible Pow could take the request and never pass it along to my Rails app server for whatever reason
[21:01:06] Polysics: hello! I might totally be doing this the wrong way, but the base API controller no longer has a view_context method, which we used for serializing
[21:01:06] tubbo: also if you're proxying Puma to Nginx or something
[21:01:12] Polysics: how do I get that back? :)
[21:01:22] alaing: yes i can see entry in the log
[21:01:51] edwinvdgraaf: has joined #RubyOnRails
[21:02:04] alaing: it says it rendered the views and returned 200
[21:02:14] bga57: has joined #RubyOnRails
[21:02:22] tubbo: polysics: according to https://github.com/rails/rails/blob/52ce6ece8c8f74064bb64e0a0b1ddd83092718e1/actionview/lib/action_view/rendering.rb, that method is coming from ActionView::Rendering
[21:02:39] tubbo: so if you include that into ApplicationController, you should be able to get view_context back.
[21:02:42] Polysics: including that method results in the API trying to render views
[21:02:47] tubbo: alaing: well that is quite interesting :)
[21:02:51] Polysics: that module, sorry
[21:02:56] tubbo: alaing: you just using localhost:3000 to get at your rails app?
[21:03:13] whathappens: has joined #RubyOnRails
[21:03:15] tubbo: polysics: well, view_context would imply that you want to render views.
[21:03:20] tubbo: polysics: why else would you need that?
[21:03:34] alaing: i wonder if its malformed slim template
[21:03:39] Polysics: helpers using to serialize JSON
[21:03:41] tubbo: alaing: try restarting your browser/computer haha
[21:03:47] Polysics: disclaimer: all of this is not my code :D
[21:04:05] alaing: lol typical it helpdesk advice
[21:04:37] tubbo: alaing: i mean if you've ruled out all the other things, other than a malformed template whose errors are getting eaten...i'm out of suggestions
[21:04:56] tubbo: polysics: what do those helpers need with the view context?
[21:05:10] tubbo: i mean, you don't need actionview to render json. just call any_object.to_json
[21:05:19] tubbo: polysics: !code would help
[21:05:19] helpa: polysics: 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.
[21:05:54] Polysics: tubbo: to be honest, I really think this should be solved by not inheriting from ActionController::API for now :D
[21:06:10] Polysics: until I can make whoever decided they needed a view to render JSON To fix that
[21:06:14] Polysics: thanks anyways
[21:06:24] alaing: tubbo: i'm not familar with slim so going to attempt haml template and see if that works
[21:06:44] tfitts: tubbo: the ember app boots on its own
[21:07:50] tubbo: polysics: yeah i mean if you don't want to actually solve the problem at hand, that's definitely what you want to do.
[21:08:04] tubbo: polysics: AC::Base and AC::API are really a lot more similar than you'd think
[21:08:25] tubbo: i would argue that it's easier to start with regular old AC::Base and then move to AC::API if you _really_ don't need any of the rendering features
[21:08:36] Polysics: I just found out our API base controller is actually including most of AC::Base
[21:08:45] Polysics: might as well make it simpler
[21:08:50] Polysics: and just use that
[21:09:07] tubbo: that sounds good
[21:09:16] alaing: tubbo: ok works with haml template
[21:09:44] pawnbox: has joined #RubyOnRails
[21:09:58] alaing: must be slim template issue
[21:13:40] bbrowning: has joined #RubyOnRails
[21:14:14] workmad3: has joined #RubyOnRails
[21:15:30] jahbrews1i: has joined #RubyOnRails
[21:18:48] daumie: has joined #RubyOnRails
[21:19:58] machinewar: has joined #RubyOnRails
[21:20:12] machinewar: how can I use ActiveRecords #joins to do a left join with a parameter for filtering
[21:20:31] machinewar: Model.joins("LEFT JOIN table on table.attr = ?", param)
[21:20:43] machinewar: I want to do something like that but doesnt look like it takes 2 arguments
[21:21:18] tubbo: machinewar: so the param in this case is gonna be a 'table.attr' combo, right?
[21:21:27] tubbo: you want to let the user choose what the model JOINs on?
[21:21:40] machinewar: I have a value I want to interpolate
[21:22:10] dkam: has joined #RubyOnRails
[21:22:12] tvon: has joined #RubyOnRails
[21:22:14] machinewar: tubbo: its more of a ("LEFT JOIN table on attr in ?")
[21:22:15] tubbo: not sure that's the place to do it
[21:22:28] machinewar: where that paramter is an array of ids
[21:22:36] tubbo: the ON clause there tells LEFT JOIN how to join the table, not on which records to select
[21:23:28] machinewar: tubbo: I understand that
[21:23:31] tubbo: so you'd wanna do Model.joins(:joined_table).where(joined_table: { attribute_from_joined_table: your_array_of_ids })
[21:24:03] tubbo: which should generate a LEFT JOIN using the conventional _id param from Model's table, then generate a WHERE IN query for attribute_from_joined_table
[21:24:08] tubbo: if an array is passed in that is
[21:24:27] machinewar: tubbo: I want to filter in the join and not after the fact
[21:24:40] machinewar: the where works, but its super inefficient for what I'm doing
[21:25:48] daumie: has joined #RubyOnRails
[21:25:48] DoctorMonocular: has joined #RubyOnRails
[21:30:19] weaksauce: has joined #RubyOnRails
[21:31:12] snowy: has joined #RubyOnRails
[21:31:32] daumie: has joined #RubyOnRails
[21:31:39] matthewd: machinewar: If your DBMS can't work out that it should push the condition down, and so the performance difference is enough to matter, then you'll have to manually quote the value in the join expression
[21:32:32] machinewar: matthewd: thanks
[21:34:12] matthewd: There is an issue somewhere wanting a way to apply where-style conditions inside joins, but I don't think anyone's come up with a workable API yet, let alone an implementation
[21:35:19] cd-rum: has joined #RubyOnRails
[21:35:44] snowy: has joined #RubyOnRails
[21:36:43] machinewar: matthewd: oh interesting, cool to know
[21:37:59] fermonkus: has joined #RubyOnRails
[21:39:14] workmad3: matthewd: I assume the idea of passing an ActiveRecord::Relation to `.join` has been discussed at length already?
[21:40:57] matthewd: workmad3: You still need the association name as well. Also, potential limitations in ability to reference the 'outer' relation.
[21:41:17] kevr: has joined #RubyOnRails
[21:41:28] davidklsn: has joined #RubyOnRails
[21:42:05] workmad3: matthewd: yeah, I figured there'd be issues that my brain couldn't see at 11pm :)
[21:42:30] workmad3: (it seemed way too obvious to have been missed otherwise... I just couldn't finish the thoughts around problems)
[21:44:58] cd-rum: has joined #RubyOnRails
[21:49:49] crystal77: has joined #RubyOnRails
[21:52:18] dminuoso: has joined #RubyOnRails
[21:55:14] daumie254: has joined #RubyOnRails
[21:56:24] Ebok: has joined #RubyOnRails
[21:59:42] blackmesa: has joined #RubyOnRails
[22:00:06] xlegoman: has joined #RubyOnRails
[22:10:22] jenrzzz: has joined #RubyOnRails
[22:12:00] blackmesa: has joined #RubyOnRails
[22:17:32] flashpoint9: has joined #RubyOnRails
[22:21:39] alex88: has joined #RubyOnRails
[22:22:00] alex88: hi there, someone knows why datetime doesn't implement change(usec: 0)?
[22:22:18] barhum2013: has joined #RubyOnRails
[22:28:33] oystersauce8: has joined #RubyOnRails
[22:29:16] flashpoint9: has joined #RubyOnRails
[22:29:58] zacts: has joined #RubyOnRails
[22:30:29] superlou: has joined #RubyOnRails
[22:33:26] barhum2013: has joined #RubyOnRails
[22:33:57] roamingdog: has joined #RubyOnRails
[22:35:54] groatyoats: has joined #RubyOnRails
[22:38:46] shinnya: has joined #RubyOnRails
[22:40:12] tfitts: tubbo: they have a rails 5 branch that works, and you need to change your ApplicationController to inherit from ActionController::Base instead of ActionController::API , just in case you are trying it out. thanks for the tips
[22:42:33] banisterfiend: has joined #RubyOnRails
[22:44:32] AndrewIsHere: has joined #RubyOnRails
[22:45:24] jglover: has joined #RubyOnRails
[22:46:07] daffy_duck: has joined #RubyOnRails
[22:46:32] jglover: is there any reason one might use statuses codes rather than symbols? For example status: 200 rather than status :ok.
[22:46:46] Darkman738: hi all, perhaps someone could assist. I'm trying to format my logging and running into a bit of of an issue. I'd like to include the class and method name in the log line, but I can't seem to find a way to do that without including it during the log invocation
[22:47:43] Darkman738: I'm currently setting up a custom format in my application.rb file, not sure if there is a better way, but it's the only one I've got to work yet
[22:53:03] dminuoso: has joined #RubyOnRails
[22:53:44] Radar: GOOD MORNING
[22:54:44] workmad3: good night :)
[22:54:51] jkwood: Ahoy, Radar!
[22:55:00] travisxcode: has joined #RubyOnRails
[22:55:19] macsteps: has joined #RubyOnRails
[22:56:37] moeabdol: has joined #RubyOnRails
[22:57:21] Darmani: Hey guys, I'm trying to create a link that removes a shirt from a cart but I'm not sure if I setup the action correctly.
[22:57:22] tedwards: has joined #RubyOnRails
[22:57:25] Darmani: https://gist.github.com/mfifth/958a3ce6bd2ae94012bf9831faa8a177#file-orders_controller-rb-L30
[22:57:35] Darmani: Could someone take a look? ^.^
[22:57:41] artto: has joined #RubyOnRails
[23:01:25] Oliphaunte: has joined #RubyOnRails
[23:02:35] Axsuul: has joined #RubyOnRails
[23:02:44] Darmani: I actually figured it out.
[23:02:49] Darmani: ACTION is happy
[23:03:59] dalbusch1t: has joined #RubyOnRails
[23:04:06] hahuang61: has joined #RubyOnRails
[23:06:02] User458764: has joined #RubyOnRails
[23:07:34] jhass: Darmani: it works, but now try to add it again ;)
[23:07:49] hahuang65: has joined #RubyOnRails
[23:10:08] dkam: has joined #RubyOnRails
[23:11:19] upsell5: has joined #RubyOnRails
[23:11:32] Talltree: has left #RubyOnRails: ()
[23:11:33] AndroidLoverInSF: has joined #RubyOnRails
[23:11:35] aaayyy: has joined #RubyOnRails
[23:11:44] aaayyy: has left #RubyOnRails: ()
[23:13:12] Darkman738: alternatively, if there is something other than the default logger that will acomplish this, I'm happy to use it but I haven't been able to get any of the one's I've tried working
[23:14:07] inkyoto: has joined #RubyOnRails
[23:14:28] Talltree: has joined #RubyOnRails
[23:14:38] inkyoto: Hey there. Is adding a <script> tag to a page to set up JS bindings still the best way to do binding when using Turbolinks?
[23:15:01] DoctorMonocular: has joined #RubyOnRails
[23:17:12] quazimodo: has joined #RubyOnRails
[23:19:19] Darmani: jhass: https://gist.github.com/mfifth/958a3ce6bd2ae94012bf9831faa8a177#file-show-html-erb-L40
[23:19:25] Darmani: I forgot to define what kind of path it was >.<
[23:20:03] flashpoint9: has joined #RubyOnRails
[23:21:40] dkam: has joined #RubyOnRails
[23:23:09] Darmani: Radar: Hullo?
[23:23:13] Radar: Darmani: Hi.
[23:23:18] SteenJobs: has joined #RubyOnRails
[23:23:20] Darmani: I have a question about the project.
[23:23:46] Darmani: So when a customer clicks "checkout" I just delete the order he placed and redirect him to the root path with a flash notice.
[23:23:56] Darmani: Radar: Is that okay?
[23:24:39] ZiggyTheHamster: has joined #RubyOnRails
[23:29:52] Radar: Darmani: Does the customer pay for the order first?
[23:30:03] Radar: Delete the order from the DB or the session?
[23:30:31] Darmani: Radar: Delete the current order. A customer can only have one order at a time.
[23:30:43] Radar: Darmani: But then how do you have history of the orders that the user has placed?
[23:30:54] Darmani: Radar: oh god really lol
[23:31:22] Darmani: Radar: lmao okay back to the drawing board then
[23:31:34] roamingdog: has joined #RubyOnRails
[23:32:23] ekinmur: has joined #RubyOnRails
[23:33:03] Darmani: Radar: Should I create another model for a customer history?
[23:33:07] Darmani: I'm assuming yes...
[23:33:29] Radar: Darmani: You can just remove the order_id key from sessioon
[23:33:33] Radar: session.delete(:order_id)
[23:33:36] Radar: Then you'll still have a history.
[23:33:55] Darmani: Radar: um....
[23:34:03] Darmani: alright...
[23:37:59] travisxcode: has joined #RubyOnRails
[23:38:21] quazimodo: has joined #RubyOnRails
[23:39:37] Oliphaunte: has joined #RubyOnRails
[23:40:55] roamingd_: has joined #RubyOnRails
[23:45:04] bbrowning: has joined #RubyOnRails
[23:45:27] Darmani: Radar: Um kinda sorta like this?
[23:45:28] Darmani: class OrdersController < ApplicationController before_action :set_user, :verify_user before_action :set_order, only: [:show, :remove_shirt, :archive] def show @variants = @order.variants @total = 0 @variants.each do |variant| @total += variant.quantity * variant.price end end def add_shirt @variant = Variant.find(params[:name][:variant_id]) @order = Order.find_or_create_by!(user_i
[23:45:37] Darmani: https://gist.github.com/mfifth/958a3ce6bd2ae94012bf9831faa8a177#file-orders_controller-rb-L31
[23:45:41] Darmani: meant to do that >.<
[23:48:18] Darkman738: so no suggestions on formatting logs including class and method names?
[23:49:44] Radar: Darmani: !rule11
[23:49:44] helpa: Darmani: Do not repeat your question every 5 minutes expecting somebody to answer it. If you do not get a reply after the first time perhaps posting your question on StackOverflow (http://stackoverflow.com) would help you. Linking to the question in the channel after you've posted it is OK.
[23:49:47] Radar: Whoops, wrong dar.
[23:49:51] Radar: darkman738: ^
[23:50:31] Darkman738: wasn't 5 minutes, but sure I suppose you can treat people that way
[23:50:54] Darkman738: and I have been looking on stackoverflow and most anywhere else Google will take me with little in the way of movement
[23:54:04] dminuoso: has joined #RubyOnRails
[23:58:36] Darmani: Radar: When you have time can you explain what deleting the order_id does? Am I supposed to call @user.orders_without_id or something to get the history?
[23:59:12] Radar: @user.orders should be fine