« Back to channel list

#RubyOnRails - 14 July 2016

« Back 1 day Forward 1 day »
[00:00:04] dalbuschat: has joined #RubyOnRails
[00:01:47] mikeiniowa: has joined #RubyOnRails
[00:02:13] hahuang61: has joined #RubyOnRails
[00:02:37] Dimik--: has joined #RubyOnRails
[00:02:53] dragon9783: has joined #RubyOnRails
[00:06:54] Oliphaunte: has joined #RubyOnRails
[00:09:54] Niandalu: has joined #RubyOnRails
[00:18:31] roamingdog: has joined #RubyOnRails
[00:20:58] DoctorMonocular: has joined #RubyOnRails
[00:29:01] nettoweb: has joined #RubyOnRails
[00:35:08] nettoweb: has joined #RubyOnRails
[00:35:12] blackmesa: has joined #RubyOnRails
[00:35:56] glasz_: has joined #RubyOnRails
[00:37:36] rafaelflores: has joined #RubyOnRails
[00:42:01] jstransky: has joined #RubyOnRails
[00:45:15] manfrin: has joined #RubyOnRails
[00:45:18] jstransky: has left #RubyOnRails: ()
[00:48:41] roamingdog: has joined #RubyOnRails
[00:50:49] Darmani: Hey guys, is this the right way to update an item from an order?
[00:50:50] Darmani: https://gist.github.com/mfifth/958a3ce6bd2ae94012bf9831faa8a177#file-orders_controller-rb-L28
[00:51:37] jheathco: has joined #RubyOnRails
[00:53:05] rafaelflores: has joined #RubyOnRails
[00:56:50] Maletor: has joined #RubyOnRails
[00:57:12] zacts: has joined #RubyOnRails
[01:02:13] weaksauce: has joined #RubyOnRails
[01:03:04] hahuang61: has joined #RubyOnRails
[01:04:18] crystal77: has joined #RubyOnRails
[01:07:21] pvertenten: has joined #RubyOnRails
[01:11:34] macsteps: has joined #RubyOnRails
[01:15:32] sevenseacat: has joined #RubyOnRails
[01:18:41] rafaelflores: has joined #RubyOnRails
[01:20:04] rubyonrails716: has joined #RubyOnRails
[01:22:20] gremly: has joined #RubyOnRails
[01:23:00] rubyonrails716: Is anyone online right now?
[01:23:43] Darmani: rubyonrails716: Ask your question man. That's the only way you'll get someone's attention.
[01:25:03] rubyonrails716: So, I'm just starting out with rails right now and I'm confused about a thing: how do I render the result of controller A's action in the view of controller B's action?
[01:25:23] Ropeney: has joined #RubyOnRails
[01:25:47] rubyonrails716: Or, is that something that the MVC model doesn't really do?
[01:25:55] Radar: I have an engine called "commerce", and I used to be able to access it in helpers using "ecommerce_app", but in Rails 5 it appears that helpers no longer have access to it. What should I use instead?
[01:27:04] matthewd: Radar: I don't recall anything that intentionally changed that
[01:27:24] sevenseacat: does `rake routes` give you a hint about the naming?
[01:27:30] Radar: matthewd: Ok, thanks. I'll keep looking.
[01:27:31] Darmani: rubyonrails716: You need to be more specific.
[01:27:48] Radar: sevenseacat: rake routes shows it as commerce_app still
[01:28:20] sevenseacat: wait, commerce_app or ecommerce_app ?
[01:30:54] rubyonrails716: Controller A just serves up static pages. Each action is mapped to a different partial view. In one of those views, I'd like to have a button in a sidebar. I have a table in a database setup with 'starttime' and 'endtime' columns. I'd like the aforementioned view to display a button that says either "Start timer" or "End timer" depending on whether or not the current user has a timer currently active.
[01:33:00] Darmani: yeah that's something I don't think I can help you with friend. Maybe one of the others can or you can ask the Rails Slack chat. Someone there might know.
[01:33:22] rubyonrails716: Thanks anyway. :)
[01:36:53] blackmesa: has joined #RubyOnRails
[01:39:48] eserror: has joined #RubyOnRails
[01:41:20] dkam: has joined #RubyOnRails
[01:43:52] blathem: has joined #RubyOnRails
[01:48:05] Radar: commerce, no e
[01:48:17] Spami: has joined #RubyOnRails
[01:49:46] sevenseacat: has joined #RubyOnRails
[01:53:18] tossup__: has joined #RubyOnRails
[01:54:55] Darmani: Radar: Hey quick question.
[01:54:59] jenrzzz: has joined #RubyOnRails
[01:55:53] Darmani: I was looking through the Agile Rails Dev book and they want you to create a "line-item" model to hold all of the items. I just created extra routes to add items to my order... Does that still work?
[01:57:00] roamingdog: Darmani: order has many line_items, each line_item belongs_to a product and holds a quantity, if that helps
[01:57:39] Maletor: has joined #RubyOnRails
[01:57:42] Darmani: roamingdog: yeah I understand how it works... I just don't know if I should scrap what I have and start over or if my way is actually viable and I'm not doing it right haha....
[01:57:49] rafaelflores: has joined #RubyOnRails
[01:58:23] roamingdog: Darmani: i think you've reached a learning moment and should scrap. it's good if you see the need for line_items
[01:58:52] Darmani: roamingdog: nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[01:59:00] Darmani: ACTION cries
[01:59:09] roamingdog: now now, this is a learning experience
[01:59:23] Darmani: roamingdog: But I worked so hard Q.Q
[01:59:46] roamingdog: Darmani: and it's not for nothing, you've gained knowledge, move on
[02:00:08] roamingdog: you don't have to scrap _everything_, just the way you add items to an order
[02:00:43] Darmani: roamingdog: ehh yeah I guess that's true...
[02:01:00] Darmani: thanks man.
[02:01:08] roamingdog: Darmani: and there'll be more... you'll realize it's better to have a Cart model to hold things while the user shops, then when they want to purchase, you actually create an Order and fill it etc
[02:01:51] Darmani: roamingdog: yeah I guess..
[02:06:24] tossup: has joined #RubyOnRails
[02:07:04] roamingdog: https://gist.github.com/chrislerum/90459b4225b4ad1c07268438321a6732 how can I dry these routes up under a namespace or module or something?
[02:07:41] Darmani: roamingdog: http://pastie.org/10906645
[02:07:43] Darmani: Does that look okay?
[02:07:55] moeabdol: has joined #RubyOnRails
[02:08:29] roamingdog: Darmani: except references variants probably
[02:09:04] Darmani: roamingdog: What's wrong with that? o.o
[02:09:17] roamingdog: you've got shirts, don't you mean variants?
[02:09:36] Darmani: roamingdog: I actually rewrote it to make it easier to read for you.
[02:09:43] Darmani: I forgot your familiar with my project >.<
[02:09:57] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[02:10:07] roamingdog: ok, then you'll want to have quantity in there too
[02:10:24] Axsuul: has joined #RubyOnRails
[02:10:36] Axilla: has joined #RubyOnRails
[02:10:51] subsonik: has joined #RubyOnRails
[02:10:51] Darmani: roamingdog: quantity? A quantity that's separate from the quantity I already have for variants?
[02:11:37] roamingdog: Darmani: an order will have several line_items, each holding a variant and a quantity, yes. i don't see why variant would have a quantity
[02:12:30] Darmani: roamingdog: That makes sense..
[02:12:49] Darmani: Sorry didn't mean to hog up the chat, I pushed your question to the top >.<
[02:12:54] Darmani: thanks though (:
[02:14:27] rafaelflores: has joined #RubyOnRails
[02:16:01] roamingdog: oh no worries
[02:16:04] subsonik: has joined #RubyOnRails
[02:16:12] macsteps: has joined #RubyOnRails
[02:17:56] macsteps: has joined #RubyOnRails
[02:24:03] roamingdog: has joined #RubyOnRails
[02:30:12] akira616: has joined #RubyOnRails
[02:30:24] Mia: has joined #RubyOnRails
[02:30:24] Mia: has joined #RubyOnRails
[02:33:19] ElFerna: has joined #RubyOnRails
[02:37:40] blackmesa: has joined #RubyOnRails
[02:40:04] rubyonrailed: has joined #RubyOnRails
[02:42:01] rafaelflores: has joined #RubyOnRails
[02:42:30] twilling: has joined #RubyOnRails
[02:45:38] Oliphaunte: has joined #RubyOnRails
[02:50:00] rafaelflores: has joined #RubyOnRails
[02:53:46] nettoweb: has joined #RubyOnRails
[02:55:56] rafaelflores: has joined #RubyOnRails
[02:56:37] xall: has joined #RubyOnRails
[02:57:46] Rodya_: has joined #RubyOnRails
[02:58:04] rafaelflores: has joined #RubyOnRails
[02:58:24] maletor1: has joined #RubyOnRails
[03:00:17] Rodya_: has joined #RubyOnRails
[03:03:38] Leepoff: has joined #RubyOnRails
[03:03:38] twilling: has joined #RubyOnRails
[03:04:02] hahuang61: has joined #RubyOnRails
[03:04:20] Oliphaunte: has joined #RubyOnRails
[03:07:14] jishankai: has joined #RubyOnRails
[03:11:59] macsteps: has joined #RubyOnRails
[03:13:10] roamingdog: has joined #RubyOnRails
[03:13:11] nettoweb: has joined #RubyOnRails
[03:15:21] utal: has joined #RubyOnRails
[03:16:16] DoctorMonocular: has joined #RubyOnRails
[03:17:43] pvertenten: has joined #RubyOnRails
[03:17:49] rafaelflores: has joined #RubyOnRails
[03:20:01] MEATCHICKEN: has joined #RubyOnRails
[03:20:07] MEATCHICKEN: What's the best way to do automatic deployment?
[03:20:10] MEATCHICKEN: After I push to master
[03:21:35] fryguy: setup a continuous integration server
[03:21:56] fryguy: jenkins is cool but big, travis might do what you want
[03:22:38] moeabdol1: has joined #RubyOnRails
[03:22:38] sevenseacat: has joined #RubyOnRails
[03:25:08] MEATCHICKEN: what about easy-deployment? I guess capistrano?
[03:28:40] treaki_: has joined #RubyOnRails
[03:38:26] blackmesa: has joined #RubyOnRails
[03:38:39] arooni-mobile: has joined #RubyOnRails
[03:38:42] arooni-mobile__: has joined #RubyOnRails
[03:41:24] moeabdol2: has joined #RubyOnRails
[03:45:12] moeabdol3: has joined #RubyOnRails
[03:50:14] Dimik--: why's warden showing me a hashtag instead of logged in user ?
[03:51:14] Radar: Dimik--: what code are you using?
[03:51:31] gusrub: has joined #RubyOnRails
[03:51:36] Radar: ACTION mutters something about "kids and their hashtags"
[03:51:37] Dimik--: <%= "welcome #{env['warden'].user}!" %>
[03:52:41] Radar: because that is returning a user instance, rather than an email address.
[03:53:17] Dimik--: it seems to be in hex for some odd reason
[03:53:24] Radar: That's the object iD.
[03:54:26] Dimik--: so how do i make it display not in hex
[03:54:36] Radar: env['warden'].user.email
[03:54:45] Radar: env['warden
[03:54:51] Radar: [13:52:40] <Radar> because that is returning a user instance, rather than an email address.
[03:55:46] xall: this error seems contradictory to `rake routes` https://i.imgur.com/o6kTixN.png
[03:56:30] Dimik--: i don't have the email but username worked
[03:56:40] Dimik--: env['warden'].user.username
[03:56:41] Radar: xall: get :followers, params: { id: @user.id }
[03:56:57] Radar: xall: Specifying the path makes the controller spec think that the path is the action you want to request.
[03:57:10] Dimik--: one day i'll buy Radar a cup of coffee
[03:57:50] Radar: Dimik--: one day
[03:58:59] rafaelfranca: has joined #RubyOnRails
[03:59:14] maletor1: has joined #RubyOnRails
[04:02:53] xall: Radar: thanks. that worked, except i had to do :followers, id: @user.id
[04:02:58] xall: is params: rails 5?
[04:04:14] Radar: xall: yes
[04:05:04] hahuang61: has joined #RubyOnRails
[04:06:24] macsteps: has joined #RubyOnRails
[04:09:14] gusrub: has joined #RubyOnRails
[04:14:31] rafaelflores: has joined #RubyOnRails
[04:16:14] rafaelfl_: has joined #RubyOnRails
[04:17:18] moeabdol3: has joined #RubyOnRails
[04:23:01] djbkd: has joined #RubyOnRails
[04:29:18] blackhuey: has joined #RubyOnRails
[04:30:52] moeabdol3: has joined #RubyOnRails
[04:38:58] cd-rum: has joined #RubyOnRails
[04:39:26] roamingdog: has joined #RubyOnRails
[04:40:33] blackmesa: has joined #RubyOnRails
[04:40:50] tvw: has joined #RubyOnRails
[04:48:53] zacts: has joined #RubyOnRails
[04:52:38] conta: has joined #RubyOnRails
[04:54:22] jishankai: has joined #RubyOnRails
[04:58:28] alfiemax: has joined #RubyOnRails
[04:58:55] DoctorMonocular: has joined #RubyOnRails
[05:00:01] maletor1: has joined #RubyOnRails
[05:01:05] pawnbox: has joined #RubyOnRails
[05:02:06] d5sx43: has joined #RubyOnRails
[05:02:34] hahuang61: has joined #RubyOnRails
[05:14:45] harfangk: has joined #RubyOnRails
[05:17:08] LambdaSource: has joined #RubyOnRails
[05:20:39] rafaelflores: has joined #RubyOnRails
[05:22:51] pwnd_nsfw: has joined #RubyOnRails
[05:23:41] Velizar: has joined #RubyOnRails
[05:29:13] kali3: has joined #RubyOnRails
[05:29:30] monoprotic: has joined #RubyOnRails
[05:29:44] travisxcode: has joined #RubyOnRails
[05:30:54] jenrzzz: has joined #RubyOnRails
[05:34:40] subsonik: has joined #RubyOnRails
[05:37:21] pawnbox: has joined #RubyOnRails
[05:40:14] Axsuul: has joined #RubyOnRails
[05:41:31] blackmesa: has joined #RubyOnRails
[05:42:52] pawnbox: has joined #RubyOnRails
[05:43:37] xall: has joined #RubyOnRails
[05:44:04] RequireDragon: has joined #RubyOnRails
[05:45:21] RequireDragon: has joined #RubyOnRails
[05:50:43] moeabdol: has joined #RubyOnRails
[05:51:07] subsonik: has joined #RubyOnRails
[05:54:39] utal: has joined #RubyOnRails
[05:58:39] Cohedrin: has joined #RubyOnRails
[06:00:26] xlegoman: has joined #RubyOnRails
[06:00:46] maletor1: has joined #RubyOnRails
[06:02:39] zacts: has joined #RubyOnRails
[06:03:22] Dimik--: has joined #RubyOnRails
[06:04:10] atomx: has joined #RubyOnRails
[06:05:25] Macaveli: has joined #RubyOnRails
[06:05:29] rubyonrails258: has joined #RubyOnRails
[06:07:11] Dimik--: how can i generate a new session.id when the user visits a page each time ?
[06:07:34] Dimik--: i bet i'm not making any sense as usual ;)
[06:08:08] Radar: Dimik--: !xy
[06:08:08] helpa: Dimik--: 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
[06:09:03] wldcordeiro: has joined #RubyOnRails
[06:12:09] Dimik--: when multiple users request data i wanted to be able to identify that action based on a history of session.id stored in the database
[06:12:51] Dimik--: something like id|email|session.id|time
[06:13:22] Agashard: has joined #RubyOnRails
[06:13:27] Dimik--: so later on i could pull it by email time and session.id, not to mix it with other users
[06:13:43] Dimik--: i'm confusing myself, talk about others...
[06:13:59] Radar: why not pull it out just by the user id?
[06:14:05] Radar: why do you need a session.id too?
[06:14:36] kevr: has joined #RubyOnRails
[06:15:14] Dimik--: because then i'd need to recognize that particular action by some id so i could tie it to data table
[06:15:19] Rodya_: has joined #RubyOnRails
[06:15:50] Dimik--: |data|user|session.id, the data is different every time user requests it
[06:16:49] Dimik--: so i want to be able to identify that particular chunk of data by id
[06:17:00] Radar: Still not making sense.
[06:17:38] Dimik--: i guess i could use exact time instead of unique session.id
[06:18:16] crdpink: has joined #RubyOnRails
[06:18:38] solars: has joined #RubyOnRails
[06:18:59] dionysus69: has joined #RubyOnRails
[06:19:10] Dimik--: a user requests data, data is being generated and stored in a table, data is generated differently each time, so i need the username/email and some sort of id per data
[06:19:39] Dimik--: so when user reviews his data history it's being pulled from database based on some session.id
[06:20:37] Dimik--: maybe some randomly generated number per data request
[06:20:46] baash05: has joined #RubyOnRails
[06:21:20] baash05: Hey all.. When running rspec is there a way to output the name of the test that's being run..
[06:22:09] dminca: has joined #RubyOnRails
[06:22:19] baash05: I have 4k tests and there's one that's freezing.. I want to know what it is, and figure if I can see the name of the test while it's running, I'll see what one is stopped.
[06:22:58] Radar: Dimik--: You could just store the timestamp?
[06:23:10] Radar: Dimik--: I really am struggling to understand why you want to use a session.id to uniquely identify this.
[06:23:29] mixnblend: has joined #RubyOnRails
[06:24:07] Dimik--: yeah it was just an idea, i guess not a brilliant one..
[06:24:23] harfangk: has joined #RubyOnRails
[06:24:29] Dimik--: i will store it based on timestamp
[06:26:26] utal: has joined #RubyOnRails
[06:27:00] roamingdog: has joined #RubyOnRails
[06:27:34] aganov: has joined #RubyOnRails
[06:30:36] utal: has joined #RubyOnRails
[06:32:41] jstransky: has joined #RubyOnRails
[06:36:41] rafaelflores: has joined #RubyOnRails
[06:37:28] conta: has joined #RubyOnRails
[06:41:17] Pazician: has joined #RubyOnRails
[06:42:18] blackmesa: has joined #RubyOnRails
[06:42:28] sujith: has joined #RubyOnRails
[06:43:02] dminca: has joined #RubyOnRails
[06:44:45] atomx: has joined #RubyOnRails
[06:45:38] atomx: Hi, I don't really get the concept of putting :as in the routes file, is there any link that might explain it? I basically don't see what necessity does that solve
[06:46:18] dminca: has joined #RubyOnRails
[06:47:15] mark_661: has joined #RubyOnRails
[06:48:13] dminca: has joined #RubyOnRails
[06:48:55] helpa: http://guides.rubyonrails.org/routing.html - Rails Routing From the Outside In - Rails Guide - by Mike Gunderloy
[06:49:10] Radar: atom_: It tells the routes what path helper you want that route to provide
[06:49:34] artto: has joined #RubyOnRails
[06:51:17] AzaToth: has joined #RubyOnRails
[06:52:33] dminca: has joined #RubyOnRails
[06:53:06] atomx: aaaah, so in case you have a complicated url you can "alias" the path
[06:53:09] atomx: got it, thanks!
[06:53:17] dminca: has joined #RubyOnRails
[06:54:37] Leepoff: has joined #RubyOnRails
[06:55:05] GorillaApe: has joined #RubyOnRails
[06:56:58] utal: has joined #RubyOnRails
[06:57:08] apotry: has joined #RubyOnRails
[07:01:14] the_drow: has joined #RubyOnRails
[07:01:31] maletor1: has joined #RubyOnRails
[07:01:36] utal: has joined #RubyOnRails
[07:02:04] yottanami: has joined #RubyOnRails
[07:02:17] subsonik: has joined #RubyOnRails
[07:03:02] yottanami: My @scope.class returns `Product::ActiveRecord_Relation` how can I just get the model name? in this example I mean `Product`
[07:03:27] yfeldblum: has joined #RubyOnRails
[07:04:07] yfeldblum: has joined #RubyOnRails
[07:04:41] GoranPavlovic: has joined #RubyOnRails
[07:04:46] Ropeney: yottanami use .name
[07:05:28] dminuoso: has joined #RubyOnRails
[07:06:24] Dbugger: has joined #RubyOnRails
[07:06:34] Dbugger: Hello everyone, I have a small issue
[07:07:19] Ropeney: dbugger, that's no good
[07:07:24] Dbugger: "select_month 2, prefix: :something, include_blank: true" gives me the <select> for all the months, with an empty option, but if I do this "select_month 2, prefix: :something, include_blank: 'blank'", that blank option is not filled with a string... what am I doing wrong?
[07:07:33] kevr: has joined #RubyOnRails
[07:07:38] Dbugger: Ropeney, no, it is not :(
[07:08:33] mfilipe: has joined #RubyOnRails
[07:09:32] Ropeney: dbugger, try prompt instead of include_blank ?
[07:10:18] Dbugger: so "include_blank: true, prompt: "something" ?
[07:11:21] Ropeney: remove include_blank
[07:11:27] Dbugger: Indeed, that makes 2 blanks
[07:11:35] Dbugger: Awesome, thank you, mate!
[07:11:39] Ropeney: small problem gone! vamoosh!
[07:12:23] artto: has joined #RubyOnRails
[07:12:28] TomyWork: has joined #RubyOnRails
[07:12:51] navneet: has joined #RubyOnRails
[07:13:20] darutoko: has joined #RubyOnRails
[07:13:53] arup_r: has joined #RubyOnRails
[07:14:09] TomyWork: i want to make a rails app that only reads from a database. i can under no circumstance write to that db. how do i prevent it?
[07:14:25] TomyWork: http://stackoverflow.com/questions/3391860/read-only-mode-for-ruby-on-rails-application I found this stackoverflow article but all the solutions seem hacky
[07:15:01] Ropeney: TomyWork, enforce it at the db user level?
[07:15:25] dragon9783: has joined #RubyOnRails
[07:16:20] utal: has joined #RubyOnRails
[07:16:46] TomyWork: i have a user with write access but no administrative access
[07:17:33] Ropeney: That probably won't enforce it then
[07:17:59] monoprotic: has joined #RubyOnRails
[07:18:16] TomyWork: let me rephrase that: I can't get a db user without write access
[07:19:49] Ropeney: TomyWork http://apidock.com/rails/ActiveRecord/Base/readonly%3F looks the only way then
[07:20:13] dminuoso: TomyWork: after_initialize :readonly!
[07:20:20] dminuoso: TomyWork: If you use that, the model becomes readonly.
[07:20:33] Ropeney: and put it into ActiveRecord::Base
[07:20:38] Ropeney: so every model becomes read only
[07:20:45] TomyWork: does that include insert and delete statements?
[07:20:48] dminuoso: Well, you should simply subclass ActiveRecord::Base.
[07:20:55] dminuoso: Don't fucking monkey patch core classes.
[07:21:13] dminuoso: TomyWork: Yes.
[07:21:42] arup_r: Ropeney: how are you? :)
[07:21:44] dionysus69: has joined #RubyOnRails
[07:21:49] Ropeney: good arup_r, you?
[07:22:04] TomyWork: http://apidock.com/rails/ActiveRecord/Base/readonly%3F says "Note, however, that destroy and delete will still work on the model unless you intercept those calls" at the end
[07:22:09] utal: has joined #RubyOnRails
[07:22:17] arup_r: I wouldn't say good, I would say my life is messed up now.. haha.. waiting when it will be cleared.. lol
[07:22:41] Ropeney: arup_r no good :(
[07:22:44] dminuoso: TomyWork: Note that this will not present users from really modifying if they try to.
[07:23:03] TomyWork: dminuoso remote users?
[07:23:08] dminuoso: TomyWork: Developers.
[07:23:13] TomyWork: well of course
[07:23:27] lxsameer: has joined #RubyOnRails
[07:23:53] TomyWork: this is just so i dont accidentally mess up the DB while I write this report app
[07:24:00] dminuoso: TomyWork: Just don't monkey patch ActiveRecord::Base. Sub-class it to "ReadOnlyModel" or whatever, where you make the necessary modifications, and then derive every model from that.
[07:24:25] Ropeney: new app TomyWork?
[07:24:34] antgel: has joined #RubyOnRails
[07:24:37] dminuoso: TomyWork: Use a development database? ...
[07:24:45] Ropeney: use rails 5 and you get a intermediate model then :)
[07:24:45] dminuoso: Stop trying to develop against live data.
[07:25:18] dminuoso: TomyWork: So there is your real problem them - don't develop against a live database. Don't get against a live database.
[07:25:19] Ropeney: TomyWork, in rails 5 you get a application_record.rb like application_controller.rb where you can put all class restrictions on
[07:25:36] TomyWork: dminuoso ordinarily, fair point. but i dont even want to know how long it takes to dump this thing :)
[07:25:45] dminuoso: TomyWork: Don't dump it...
[07:25:57] dminuoso: TomyWork: Just create some simple test data to work with.
[07:26:31] dminuoso: If the correctness of your application depends on full production data, there's something seriously fucked up in your programming style.
[07:26:54] Synthbread: has joined #RubyOnRails
[07:26:57] DoubleMalt: has joined #RubyOnRails
[07:27:05] TomyWork: that is quite possible
[07:27:07] Pazician: has joined #RubyOnRails
[07:27:14] TomyWork: this is going to be my first rails app
[07:27:14] blackmesa: has joined #RubyOnRails
[07:27:52] dminuoso: TomyWork: Well, then it is even more important that you don't develop against a production database.
[07:28:21] dminuoso: TomyWork: What underlying production database do you have?
[07:28:24] Kedare: has joined #RubyOnRails
[07:29:35] dminuoso: TomyWork: You can simply dump the existing schema so that you can use it in a different database (possibly even database adapter).
[07:29:50] dminuoso: Then use some basic seeds to create a minimum set for development that you may need.
[07:31:36] Pazician: has joined #RubyOnRails
[07:32:39] finnnnnnnnnnn: has joined #RubyOnRails
[07:35:22] arup_r: has joined #RubyOnRails
[07:35:28] mixnblend: has joined #RubyOnRails
[07:36:53] arBmind: has joined #RubyOnRails
[07:41:02] pawnbox: has joined #RubyOnRails
[07:44:14] pawnbox: has joined #RubyOnRails
[07:47:43] jenrzzz: has joined #RubyOnRails
[07:53:17] edwinvdgraaf: has joined #RubyOnRails
[07:56:01] marr: has joined #RubyOnRails
[07:56:21] timmyBsd: has joined #RubyOnRails
[07:59:09] fermonkus: has joined #RubyOnRails
[08:00:04] mikecmpbll: has joined #RubyOnRails
[08:00:25] atomx: has joined #RubyOnRails
[08:02:17] Klumben: has joined #RubyOnRails
[08:02:19] maletor1: has joined #RubyOnRails
[08:02:52] xall: has joined #RubyOnRails
[08:04:11] banisterfiend: do people typically use the same redis instance for both sidekiq and rails caching? or do they create a separate instance?
[08:06:21] arBmind: has joined #RubyOnRails
[08:11:25] roshanavand: has joined #RubyOnRails
[08:11:42] mikecmpbll: banisterfiend : i'd guess the same one.
[08:12:39] mikecmpbll: actually maybe not. idk, ignore me.
[08:14:02] wethu: has joined #RubyOnRails
[08:14:08] Palsson: has joined #RubyOnRails
[08:15:30] snowy: has joined #RubyOnRails
[08:15:52] AimlessRAven: has joined #RubyOnRails
[08:16:06] AimlessRAven: what is the way to dinamicly create comment without refresh page
[08:20:55] tbuehlmann: AimlessRaven: sending the form remotely and responding with javascript code that updates the page
[08:21:44] mikecmpb_: has joined #RubyOnRails
[08:22:52] AimlessRAven: tbuehlmann: is somewhere some example for this
[08:25:58] tbuehlmann: google for "rails comment form remote true"
[08:26:05] tbuehlmann: you'll get this, for example: http://www.korenlc.com/remote-true-in-rails-forms/
[08:26:18] utal: has joined #RubyOnRails
[08:26:18] pseudoreza: has joined #RubyOnRails
[08:28:12] vedu: Hello. I have some assets (scss and js) that are specific to some views. Is it correct to load them in the body of the specific view? Uptil now I am including all assets in layouts/application.html.erb
[08:29:21] mikecmpbll: vedu : the latter is the correct way.
[08:29:26] mikecmpbll: what you're currently doing :)
[08:29:27] _reza: has joined #RubyOnRails
[08:30:27] vedu: mikecmpbll: really? Doesn't feel right to include all the various assets even when the particular page is not using them. Plus, I will have to worry about namespace collisions in css
[08:31:11] mikecmpbll: the size makes no real difference except initial page load, thereafter it's cached
[08:31:41] vedu: hmm okay cool :)
[08:32:29] srinidhi: has joined #RubyOnRails
[08:32:59] edwinvdgraaf: has joined #RubyOnRails
[08:34:28] rubyonrails356: has joined #RubyOnRails
[08:36:19] conta: guys, does number_field changes values to decimal or is there some other problem with my app? I have simple number_field but in browser it always changes 1 to 1.0
[08:38:32] raunicolae: has joined #RubyOnRails
[08:39:04] raunicolae: has left #RubyOnRails: ()
[08:39:26] rafaelflores: has joined #RubyOnRails
[08:41:45] mikecmpbll: conta : what's the produced html code?
[08:42:40] jenrzzz: has joined #RubyOnRails
[08:42:41] conta: mikecmpbll
[08:42:41] conta: <input value="270.0" class="form-control cart_item_amount" min="10" step="10" required="required" data-rule-required="true" data-rule-number="true" type="number" name="cart[cart_items_attributes][0][quantity]" id="cart_cart_items_attributes_0_quantity" aria-required="true" aria-invalid="false">
[08:43:12] jhass: what's the type in the database?
[08:43:43] mikecmpbll: what's all the data-rule-* stuff? :) looks like some details for a JS library
[08:43:56] conta: yeah, it's for validations
[08:44:38] mikecmpbll: well, when i stick your code on jsfiddle i don't get a ".0"
[08:45:02] rocketsurgeon: has joined #RubyOnRails
[08:45:21] conta: I see, so probably that plugin
[08:45:25] conta: in DB it's numeric(10,4)
[08:46:31] conta: ah, so it was that DB type. I changed it to value.to_i
[08:46:38] conta: thanks guys
[08:46:46] atomx: has left #RubyOnRails: ("WeeChat 1.5")
[08:46:46] mikecmpbll: hmpf, maybe browser differences then.
[08:47:49] jhass: conta: you should probably fix your DB then, not stick to_i's everywhere
[08:49:02] conta: I know, I'll need to talk to product guys to see why they needed float point there
[08:49:26] mikecmpbll: you could probably get around it with the attributes API in rails 5 :D
[08:51:20] conta: I'll check it but not going to upgrade any time soon I think :D
[08:56:23] akira616: has joined #RubyOnRails
[08:59:45] finnnnnnnnnnn_: has joined #RubyOnRails
[09:00:23] der-landgraf: has joined #RubyOnRails
[09:00:45] xall: has joined #RubyOnRails
[09:00:54] hekin: has joined #RubyOnRails
[09:02:52] hekin: I am using Paperclip and s3 for object storage, while s3 is blocked in China, I’m trying to respond with a cloud object storage service url hosted in China instead of s3 if the request is from China, is there a way of setting the Paperclip storage options dynamically with the incoming request?
[09:03:03] maletor1: has joined #RubyOnRails
[09:04:11] akira616`: has joined #RubyOnRails
[09:04:57] ybart: has joined #RubyOnRails
[09:06:00] ybart: Hi, when I have an ActiveJob, is it OK to use instance variables (@foo) and other methods than the `perform` method to do some processing?
[09:06:16] ybart: or is it better to pass everything as function parameters
[09:06:34] lacce: has joined #RubyOnRails
[09:08:08] Velizar: has joined #RubyOnRails
[09:09:25] mikecmpbll: hekin : most the paperclip configuration options can be procs or lambdas
[09:09:51] mikecmpbll: hekin : https://github.com/thoughtbot/paperclip/blob/511f3bc9e0c033c83f114ed538a30f6dfe4a73b2/lib/paperclip/storage/fog.rb#L191 fog_host, for instance.
[09:10:31] hekin: mikecmpbll: yes, that’s true, but they don’t take request as argument, thus you could determine where the request is from within the Proc
[09:10:51] mikecmpbll: ACTION ah, gotcha. yeah that get's tricky.
[09:10:58] utal: has joined #RubyOnRails
[09:11:02] mikecmpbll: oops? didn't mean to describe that.
[09:12:05] hekin: mikecmpbll: but you did lighten me to have a virtual attr on the owner object, say `request` or `location` :)
[09:12:35] oystersauce8: has joined #RubyOnRails
[09:13:14] efy: has joined #RubyOnRails
[09:13:21] mikecmpbll: that's possible indeed.
[09:15:02] artto: has joined #RubyOnRails
[09:15:33] Guest683: has joined #RubyOnRails
[09:16:08] _reza: has left #RubyOnRails: ()
[09:16:48] pseudoreza: has joined #RubyOnRails
[09:19:06] tvw: has joined #RubyOnRails
[09:21:10] Kuukunen: has joined #RubyOnRails
[09:27:39] dangerousdave: has joined #RubyOnRails
[09:27:45] pLaTo0n: has joined #RubyOnRails
[09:29:40] edwinvdgraaf: has joined #RubyOnRails
[09:33:35] Velizar: has left #RubyOnRails: ()
[09:33:59] Palsson: has joined #RubyOnRails
[09:34:47] pLaTo0n: has joined #RubyOnRails
[09:35:07] xall: has joined #RubyOnRails
[09:36:06] filter85: has joined #RubyOnRails
[09:38:51] lexileo: has joined #RubyOnRails
[09:39:17] macsteps: has joined #RubyOnRails
[09:42:59] xall_: has joined #RubyOnRails
[09:43:27] Devalo: has joined #RubyOnRails
[09:44:02] cd-rum: has joined #RubyOnRails
[09:46:21] marahin: Is there something like pluralize in Rails 5?
[09:46:21] davidklsn: has joined #RubyOnRails
[09:46:58] cd-rum_: has joined #RubyOnRails
[09:51:27] vedu: _bart: better to pass everything as parameters and not access other varibles. accessing class methods is fine
[09:52:08] mikecmpbll: marahin: yes
[09:52:27] marahin: mikecmpbll, I just got it, couldn't find it by google somehow. 'string'.pluralize(count) :)
[09:52:50] mikecmpbll: marahin : !api
[09:52:50] helpa: marahin : For the rails API, check out http://api.rubyonrails.org/
[09:53:06] mikecmpbll: count is optional.
[09:54:06] pawnbox: has joined #RubyOnRails
[09:54:23] reaVer: has joined #RubyOnRails
[09:54:25] bruce_lee: has joined #RubyOnRails
[09:55:32] AimlessRAven: how to remote like my post .. i mean without refresh page
[09:55:40] AimlessRAven: i add remote: true on my link_to "Like"
[09:55:48] AimlessRAven: but again refresh page
[09:55:57] mikecmpbll: AimlessRaven : !gist
[09:55:57] helpa: AimlessRaven : http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[09:56:27] pawnbox: has joined #RubyOnRails
[09:56:39] Klumben: has joined #RubyOnRails
[09:57:36] solars: quick question: is validates :channel_id, inclusion: { in: Channels::Base.all_channels} calculated on the fly or only once?
[09:57:47] ybart: vedu: is that a general rule or specific to ActiveJobs?
[09:58:13] mikecmpbll: solars : once.
[09:58:16] sarink: has joined #RubyOnRails
[09:58:25] solars: mikecmpbll, damn
[09:58:46] ybart: vedu: in services it makes more sense to use instance variables I guess, since there's an initialize
[10:02:39] arup_r: has joined #RubyOnRails
[10:03:52] maletor1: has joined #RubyOnRails
[10:04:28] Mia: has joined #RubyOnRails
[10:04:44] vedu: _bart: think of it this way. you are issuing a command that will run sometime in the future. Its best to have everything encapsulated in that command rather than have it access some state than may change in between the time the command was issued and it was actually executed
[10:05:34] c355E3B: has joined #RubyOnRails
[10:06:38] rocketsurgeon: has joined #RubyOnRails
[10:07:10] drale2k: i am creating a chatapp and i have 3 models, ChatRooms, Users and Messages
[10:07:29] drale2k: would i just do a HABTM relation between ChatRooms and Users ?
[10:07:56] ybart: vedu: you could treat the `perform` actually as a sort of initialize to create a bunch of instance variables that other methods within the job use. So I mean it's all at the time it is actually executed
[10:07:58] drale2k: a chat room can have many users and a user can be in multiple chat rooms
[10:09:18] vedu: _bart: If you need to create a class object, create a new one inside the perform. But this is as much info I can give without code
[10:09:24] mikecmpbll: drale2k : sure.
[10:10:02] drale2k: mikecmpbll: ok. Asking because there are a lot of posts about using has many through instead of HABTM but i don't see how in my case
[10:10:17] mikecmpbll: drale2k : habtm is just a hmt under-the-hood.
[10:10:43] mikecmpbll: if you don't need an explicit join model (i.e. if there's no additional logic associated with the join), habtm is just fine.
[10:11:33] vedu: drale2k: yeah. You can always create a new model for the existing join later if you need.
[10:11:36] mikecmpbll: if it was a join between a contact and a person, you might like to have a join model "relationship" where you can store additional information about the relationship such as "father", etc.
[10:11:51] drale2k: hmm k got it thanks
[10:11:57] vedu: yep. agreeing with mikecmpbll
[10:12:38] artto: has joined #RubyOnRails
[10:15:13] harfangk: has joined #RubyOnRails
[10:24:22] AimlessRAven: https://gist.github.com/anonymous/042858a665902685db51e31fa9078859
[10:24:36] AimlessRAven: where is my error to dynamicly like post without reload page
[10:24:37] artto: has joined #RubyOnRails
[10:25:24] utal: has joined #RubyOnRails
[10:28:12] utal: has joined #RubyOnRails
[10:29:35] finnnnnnnnnnn: I’m trying to upgrade to rails five and failing at the first step - http://guides.rubyonrails.org/upgrading_ruby_on_rails.html. I’m getting a command not found: rails:update
[10:30:13] utal: has joined #RubyOnRails
[10:31:34] fermonkus: has joined #RubyOnRails
[10:31:45] jhass: "After updating the Rails version in the Gemfile, run this task" did you?
[10:31:55] utal: has joined #RubyOnRails
[10:32:01] pseudoreza: hi all... im ruby on rails enthusiast. started learning rails a month back. completed codecademy courses and guides.rubyonrails.org
[10:32:22] pseudoreza: whats the next step should be taken?
[10:33:26] tparenti: has joined #RubyOnRails
[10:33:55] utal: has joined #RubyOnRails
[10:33:58] finnnnnnnnnnn: jhass: I’ve changed the line gem 'rails', '4.2.5' to gem 'rails', ‘5.0.0’
[10:34:10] jhass: finnnnnnnnnnn: run bundle update rails now
[10:34:19] norfumpit: has joined #RubyOnRails
[10:34:25] nettoweb: has joined #RubyOnRails
[10:34:36] AimlessRAven: https://gist.github.com/anonymous/042858a665902685db51e31fa9078859 someone knows shy my like action reload my page
[10:36:15] finnnnnnnnnnn: jhass: running…
[10:37:17] kitsuneyo: has joined #RubyOnRails
[10:37:25] jhass: AimlessRaven: http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript
[10:37:57] kitsuneyo: i asked this before but i really wanna know how unsafe it is to name a table 'images'
[10:38:42] kitsuneyo: i read it's unsafe because of the image_path_helper class (or whatever it's called)
[10:39:09] finnnnnnnnnnn: jhass: getting Bundler could not find compatible versions for gem "railties"
[10:40:29] bbrowning: has joined #RubyOnRails
[10:41:07] wethu: has joined #RubyOnRails
[10:41:24] rafaelflores: has joined #RubyOnRails
[10:41:56] kitsuneyo: nobody has any opinion or experience with this?
[10:47:31] jhass: finnnnnnnnnnn: I'm sure you get more than that
[10:47:51] finnnnnnnnnnn: jhass: oh yeah, I do I’m trying to update each of the offending gems now
[10:47:58] finnnnnnnnnnn: that the right way to do things?
[10:48:03] AimlessRAven: jhass: this link dont help me for my remote true
[10:48:23] jhass: AimlessRaven: it's the best we can offer based on the information given
[10:50:53] artto: has joined #RubyOnRails
[10:53:46] finnnnnnnnnnn: hmm, still not working
[10:55:12] finnnnnnnnnnn: jhass: here’s my error https://gist.github.com/fionnbharra/6c95a6ebacdea7e944a5cfe9e07a6233
[10:56:49] jhass: finnnnnnnnnnn: you need rspec-rails >= 3.5 and sass-rails >= 5.0.5
[10:57:22] finnnnnnnnnnn: will update, thanks
[10:58:22] dionysus69: has joined #RubyOnRails
[10:58:23] finnnnnnnnnnn: ahh, that’s working. Thanks, I should really learn to read.
[10:59:22] Palsson: has joined #RubyOnRails
[10:59:39] dminuoso: jhass: I find it so sad, that someone like AimlessRaven keeps returning with basic questions. After nearly 9 months, he still hasn't read the most basic Ruby or Rails guides yet, but somehow manages to produce code that feels like was randomly copied from pretty shit tutorials on the web.
[11:00:17] codelahoma: has joined #RubyOnRails
[11:00:18] dminuoso: Either he should have become completely frustrated by lack of any advancement or actually experienced.
[11:00:28] srinidhi: has joined #RubyOnRails
[11:00:54] jhass: welcome to IRC ;)
[11:01:30] dminuoso: If google maps can show me a route how to leave my apartment, I would go outside - jhass.
[11:01:51] jhass: tried openstreetmap?
[11:02:18] dminuoso: That could work.
[11:03:23] rodfersou: has joined #RubyOnRails
[11:04:36] maletor1: has joined #RubyOnRails
[11:04:57] utal: has joined #RubyOnRails
[11:07:49] edwinvdg_: has joined #RubyOnRails
[11:10:23] ybart: vedu: ok thanks!
[11:10:27] moeabdol: has joined #RubyOnRails
[11:12:26] sarink: has joined #RubyOnRails
[11:13:45] utal: has joined #RubyOnRails
[11:14:39] Ropeney: has joined #RubyOnRails
[11:18:38] artto: has joined #RubyOnRails
[11:19:12] Qwertie: has joined #RubyOnRails
[11:19:30] Qwertie: What does a variable starting with @@ mean?
[11:19:38] arup_r: class variable
[11:19:53] dminuoso: Qwertie: Those are class variables and they are special.
[11:20:00] Qwertie: What do they do?
[11:20:02] jhass: usually it means "i didn't understand ruby" :P
[11:20:15] dminuoso: Qwertie: They exist.
[11:20:17] dminuoso: It's what they do.
[11:20:33] Qwertie: Where can they be accessed is a better question then
[11:21:03] arup_r: Qwertie: https://www.manning.com/books/the-well-grounded-rubyist-second-edition
[11:21:05] dminuoso: Qwertie: I'm simply assuming that you came in here a while ago and asked about a good book to read, and accidentally skipped that chapter. Am I right?
[11:21:20] dminuoso: Because you wouldn't happen to come into this channel asking about language features without first giving some book or tutorial a read.
[11:21:34] Qwertie: Of course not
[11:21:47] Qwertie: Must have missed that bit
[11:22:12] elomatreb: Many tutorials skip those, as they're usually not something you want to use
[11:22:17] dminuoso: jhass: I was amazed when Ruby Under A Microscope showed how class variables are different from instance variables.
[11:22:43] dminuoso: It was such moments when I realized "I still don't understand Ruby well"
[11:24:38] Palsson: has joined #RubyOnRails
[11:25:34] finnnnnnnnnnn_: has joined #RubyOnRails
[11:33:13] pLaTo0n: has joined #RubyOnRails
[11:33:36] harfangk: has joined #RubyOnRails
[11:34:34] artto: has joined #RubyOnRails
[11:36:28] alfiemax: has joined #RubyOnRails
[11:38:03] finnnnnnnnnnn: yeah, this is odd. If I do PortfolioState.last.date.to_i on my model I get 1435795200. But if I do PortfolioState.find_by_date(Time.zone.at(1435795200)) I get nil
[11:38:09] finnnnnnnnnnn: anyone know why?
[11:42:02] blackmesa: has joined #RubyOnRails
[11:42:52] glasz_: has joined #RubyOnRails
[11:45:01] Jet4Fire: has joined #RubyOnRails
[11:46:57] artto_: has joined #RubyOnRails
[11:48:12] dminuoso: finnnnnnnnnnn: Why would you use Time.zone.at?
[11:48:36] finnnnnnnnnnn: dminuoso: to convert to int to a date? open to a better way
[11:51:22] AimlessRAven: has joined #RubyOnRails
[11:51:58] AimlessRAven: https://gist.github.com/anonymous/13626ecd38a5eaf18c57b099e2debce8
[11:52:12] AimlessRAven: now how would be looks like my like.js.coffe to create like without reload page
[11:52:29] dminuoso: finnnnnnnnnnn: My first guess is that there's some bizarreness with timezones happening. Can you look at PortfolioState.last.date
[11:52:31] finnnnnnnnnnn: dminuoso: If I do Time.at(1435795200) == PortfolioState.last.date I get true but if I do PortfolioState.find_by_date(Time.at(1435795200)) I get nil
[11:52:49] finnnnnnnnnnn: dminuoso: it’s Thu, 02 Jul 2015 00:00:00 UTC +00:00
[11:53:09] dminuoso: AimlessRaven: You could have spend those last 2 hours to read what unubstrusive JavaScript is.
[11:53:25] dminuoso: finnnnnnnnnnn: What timezone is rails configured in? What database do you have?
[11:53:42] finnnnnnnnnnn: erm configured timezone….
[11:53:51] finnnnnnnnnnn: I’ve just updated to rails 5, where is that stored?
[11:54:01] dminuoso: Id guess still in config/application.rb
[11:54:02] dminuoso: Im not sure.
[11:54:49] boshhead: does rails 4 and 5 not auto-reload files in /lib under development mode? It doesn't seem to. I have: "config.autoload_paths << Rails.root.join('lib')" in my application.rb file
[11:55:22] finnnnnnnnnnn: hmmm, in a file called new_framework_defaults.rb theres the following..
[11:55:23] finnnnnnnnnnn: # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
[11:55:23] finnnnnnnnnnn: # Previous versions had false.
[11:55:24] finnnnnnnnnnn: ActiveSupport.to_time_preserves_timezone = false
[11:55:29] finnnnnnnnnnn: (sorry about code paste)
[11:55:36] zpe: has joined #RubyOnRails
[11:55:46] finnnnnnnnnnn: I’m going to see what happens if I remove that…
[11:55:56] AimlessRAven: dminuoso: i read about it but .. in my js view now i need to create object ?
[11:55:59] AimlessRAven: or something else ?
[11:56:26] dminuoso: AimlessRaven: Read the Rails guide again.
[11:56:32] utal: has joined #RubyOnRails
[11:57:28] dminuoso: There is no reason why you should have javascript views - at all.
[11:59:19] workmad3: has joined #RubyOnRails
[11:59:23] davidklsn: has joined #RubyOnRails
[12:00:06] ldnunes: has joined #RubyOnRails
[12:00:30] yardenbar: has joined #RubyOnRails
[12:00:49] jhass: boshhead: by default never, right. If you add it to autoload_path, the filename <-> constant conventions still need to match up
[12:03:58] utal: has joined #RubyOnRails
[12:04:07] lacce: has joined #RubyOnRails
[12:04:13] srinidhi: has joined #RubyOnRails
[12:05:26] maletor1: has joined #RubyOnRails
[12:07:46] finnnnnnnnnnn: has joined #RubyOnRails
[12:08:37] dminuoso: has joined #RubyOnRails
[12:10:59] Pazician: has joined #RubyOnRails
[12:11:57] finnnnnnnnnnn: ohh ffs - PortfolioState.find_by_date(PortfolioState.first.date) returns nil
[12:13:13] workmad3: has joined #RubyOnRails
[12:13:31] mdw: has joined #RubyOnRails
[12:14:11] edwinvdgraaf: has joined #RubyOnRails
[12:14:26] finnnnnnnnnnn: I dumped my database and reseeded, tests now passing. not sure what the issue was.
[12:16:47] artto: has joined #RubyOnRails
[12:22:35] finnnnnnnnnnn: has joined #RubyOnRails
[12:23:12] artto: has joined #RubyOnRails
[12:24:45] marahin: Rails 5 - squish doesn't work.
[12:24:51] marahin: As: "multiline\nstring".squish
[12:25:27] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[12:25:29] wd40s: has joined #RubyOnRails
[12:27:10] marahin: https://gist.github.com/anonymous/196bcefbf6c0fbee72209c498bd68519
[12:28:16] marahin: So, as I've said, there's no such method for String as Squish in Rails 5.
[12:28:24] marahin: Calling squish does not work.
[12:29:26] marahin: dminuoso, pardon, my bad: I did not load Rails environment properly, so it did not load Rails' string methods.
[12:29:44] yottanami1: has joined #RubyOnRails
[12:31:35] dminuoso: 14:28 < marahin> So, as I've said, there's no such method for String as Squish in Rails 5.
[12:31:38] dminuoso: 14:24 < marahin> Rails 5 - squish doesn't work.
[12:31:48] dminuoso: There's a difference between "no such method" and "doesn't work"
[12:32:34] marahin: dminuoso, you are right. I'm sorry.
[12:33:58] mikecmpb_: has joined #RubyOnRails
[12:36:26] blackmesa: has joined #RubyOnRails
[12:37:08] artto: has joined #RubyOnRails
[12:41:13] srinidhi: has joined #RubyOnRails
[12:42:42] ewelina: has joined #RubyOnRails
[12:43:19] rafaelflores: has joined #RubyOnRails
[12:43:57] Spaulding: has joined #RubyOnRails
[12:44:11] Spaulding: has left #RubyOnRails: ("WeeChat 1.4")
[12:45:13] the_drow: has joined #RubyOnRails
[12:45:40] ngw: has joined #RubyOnRails
[12:47:02] xall_: has joined #RubyOnRails
[12:47:20] sevenseacat: has joined #RubyOnRails
[12:48:40] the_drow: has joined #RubyOnRails
[12:54:35] oystersauce8: has joined #RubyOnRails
[12:54:38] umdstu: has joined #RubyOnRails
[12:56:40] chaker: has joined #RubyOnRails
[12:58:37] ewelina: has joined #RubyOnRails
[12:58:56] camilasan: has joined #RubyOnRails
[13:02:13] fermonkus: has joined #RubyOnRails
[13:02:25] ewelina: has joined #RubyOnRails
[13:02:55] abhvl: has joined #RubyOnRails
[13:03:05] abhvl: how to assign_attributes on association?
[13:03:21] abhvl: undefined method `attributes' for #<ActiveRecord::Relation:0
[13:05:58] l4v2: has joined #RubyOnRails
[13:06:11] maletor1: has joined #RubyOnRails
[13:08:19] arup_r: has joined #RubyOnRails
[13:08:53] rafaelflores: has joined #RubyOnRails
[13:09:00] subsonik_: has joined #RubyOnRails
[13:10:04] fryguy: abhvl: what you are trying to do doesn't make sense
[13:10:15] pawnbox: has joined #RubyOnRails
[13:11:42] Macaveli: has joined #RubyOnRails
[13:12:16] pawnbox: has joined #RubyOnRails
[13:14:25] abhvl: i was triping to clone record to new record
[13:14:30] abhvl: along with their association
[13:23:50] edwinvdgraaf: has joined #RubyOnRails
[13:25:29] ramortegui: has joined #RubyOnRails
[13:31:01] ciastek: has joined #RubyOnRails
[13:31:23] Axilla: has joined #RubyOnRails
[13:32:57] Terens: has joined #RubyOnRails
[13:33:04] Terens: Hello I am having some trouble
[13:33:48] Terens: I create a join table with : create_join_table :spree_filters, :spree_properties, table_name: :spree_property_filters do |t|
[13:34:18] Terens: so far everyhing is good. However when i try to query
[13:34:42] Terens: has_many :property_filters, class_name: "Spree::PropertyFilter"
[13:34:59] fmcgeough: has joined #RubyOnRails
[13:35:10] Terens: property_filters although I have set foreign_key to PropertyFilter class it ignores them
[13:35:17] dvinciguerra_: has joined #RubyOnRails
[13:37:11] adavia: has joined #RubyOnRails
[13:40:10] roamingdog: has joined #RubyOnRails
[13:41:18] xall_: has joined #RubyOnRails
[13:42:04] ciastek: I have a working, single query: Image.eager_load(:rights).where(rights: {user_id: @user.id}). Can I achieve the same results using @user.rights ?
[13:42:37] ciastek: Something like Image.eager_load(:rights).where(rights: @user.rights) # INVALID
[13:43:27] ciastek: I've tried Image.eager_load(:rights).where(rights: @user.right_ids). It works, but fires two queries: one for right_ids, and the second for images.
[13:43:36] Palsson: has joined #RubyOnRails
[13:43:46] Tempesta: has joined #RubyOnRails
[13:45:25] nersoh: has joined #RubyOnRails
[13:46:15] the_drow: has joined #RubyOnRails
[13:47:08] ponzii: has joined #RubyOnRails
[13:47:30] pvertenten: has joined #RubyOnRails
[13:49:49] arup_r: ciastek: last one is totally fine
[13:50:13] arup_r: this set up makes 2 queries.
[13:50:33] arup_r: N+1 is the issue, not the 2 queries
[13:50:33] dminuoso: ciastek: It's how Rails eager loading works.
[13:51:08] dminuoso: ciastek: Perhaps you actually meant to use "joins" ?
[13:51:46] arup_r: I think join will not work if OP intends to do like @image.rights later
[13:51:47] nettoweb: has joined #RubyOnRails
[13:52:43] arup_r: ciastek: anyway you are solving N+1 queries to 2 queries which is fine.
[13:53:02] arup_r: ACTION always get confused with eager_load and included :)
[13:53:11] arup_r: *includes
[13:53:48] dminuoso: Actually...
[13:53:52] dminuoso: eager_load should use a single query.
[13:54:14] dminuoso: ciastek: Can you gist the full output of your log, including the SQL log?
[13:54:25] arup_r: oh I see. then ignore my all advises.
[13:54:30] ponzii: In Rails console my Active Record query: logrow = LogForm.find_by_sql([log_row_sql(5339), 18998])[0]
[13:54:41] ponzii: ... produces the output: LogForm Load (17.0ms) SELECT masterid,activityid,firstname,surname,sex,age,address,towncity,postcode,l.county AS usercounty,tel,mobile,email,dancer,updates,source,rooms, occupancy,ch1firstname,ch1surname,ch1sex,ch1age,ch2firstname,ch2surname,ch2sex,ch2age,to_char(eventdate,'DD Mon YYYY') as eventdate,eventmusic,eventinfo,participants,vouchernum,pin,to_char(voucherexp,'DD Mon YYYY') as voucherexp,expcode,a.header as subject, a.t
[13:54:46] dminuoso: ponzii: gist please.
[13:54:50] ponzii: .... followed by: #<LogForm:0x007faeb396b1d0 id: nil, activityid: 9, packageid: 244, masterid: 5339, firstname: "Alan", surname: "Short", sex: "male", age: "adult", address: "12 Kember Road", towncity: "London", postcode: "SW81FG", tel: "02077629045", mobile: nil, email: "alan.short276@gmail.com", dancer: nil, updates: "yes", source: nil, eventdate: nil, eventmusic: nil, eventinfo: nil, vouchernum: "asd123", expcode: nil, voucherexp: Thu, 08 Aug 2019, r
[13:54:58] ponzii: There are many fields missing in the output but: logrow.template ... or ... logrow[:template] returns the missing data: "standard". However, when I call logrow[:template] in my application it returns nil.
[13:54:59] ciastek: arup_r: yeah, that's why i look for a way to use @user.rights. Today it's a simple association, but tomorrow may be for example a scope ->{ active: true} :)
[13:55:03] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[13:55:05] arup_r: ahh... please listen dminuoso
[13:55:11] arup_r: ponzii: :(
[13:55:27] ciastek: dminuoso: will get a SQL log
[13:57:39] roamingdog: has joined #RubyOnRails
[13:58:15] travismathis: has joined #RubyOnRails
[13:59:16] gh0st3d: has joined #RubyOnRails
[13:59:43] gh0st3d: Fairly new to ruby/rails. Can anyone help me sort out why I can't access the API i'm trying to make through a tutorial?
[13:59:52] gh0st3d: I think it has something to do with being in a subdirectory on my server
[14:00:14] helpa: 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.
[14:01:27] gh0st3d: Ok well it's not really related to the code since I haven't even started coding but nevermind.
[14:01:59] artto: has joined #RubyOnRails
[14:02:15] JakFrist: has joined #RubyOnRails
[14:03:31] finnnnnnnnnnn: has joined #RubyOnRails
[14:03:46] alfiemax: has joined #RubyOnRails
[14:07:00] maletor1: has joined #RubyOnRails
[14:07:40] mdw: has joined #RubyOnRails
[14:08:38] AntiSpamMeta: has joined #RubyOnRails
[14:08:43] Pazician: has joined #RubyOnRails
[14:08:55] Pazician: has joined #RubyOnRails
[14:08:55] AntiSpamMeta: has joined #RubyOnRails
[14:09:48] roshanavand: has joined #RubyOnRails
[14:12:06] artto: has joined #RubyOnRails
[14:12:24] eljimmy: has joined #RubyOnRails
[14:14:31] The_Phoenix: has joined #RubyOnRails
[14:17:06] The_Phoenix: has joined #RubyOnRails
[14:18:11] The_Phoenix: has joined #RubyOnRails
[14:19:31] The_Phoenix: has joined #RubyOnRails
[14:20:56] The_Phoenix: has joined #RubyOnRails
[14:23:13] ciastek: dminuoso: here's the SQL logs: https://gist.github.com/anonymous/2dcad54d50afcdb9b09e8d8dfaf01bf0
[14:25:15] ciastek: dminuoso: i try to use @user.rights in the query instead of {rights: {user_id: @user.id}} association, to be able to modify @user.rights in a future and not be forced to update the query.
[14:25:23] mdw: has joined #RubyOnRails
[14:27:38] dminuoso: ciastek: .load works on relations
[14:28:09] dminuoso: ciastek: Using features like eager_load or load does not mean it will cache these records globally.
[14:28:40] dminuoso: ciastek: for example if you use: c = a.includes(:b); then c.b will not emit a new query.
[14:29:11] dminuoso: But if you did a.includes(:b); and then used d.b() then a new query would have to be fired, since its only preloaded for "a"
[14:29:20] dminuoso: If that makes any sense.
[14:32:50] FooBarWidget: has joined #RubyOnRails
[14:34:09] ewelina: has joined #RubyOnRails
[14:35:31] LBRapid: has joined #RubyOnRails
[14:38:05] chenillen: has joined #RubyOnRails
[14:38:14] ciastek: dminuoso: i've used .load just to fire up a query
[14:38:30] ewelina_: has joined #RubyOnRails
[14:40:12] the_drow: has joined #RubyOnRails
[14:43:25] prithaj: has joined #RubyOnRails
[14:44:24] dminuoso: has joined #RubyOnRails
[14:47:05] Guest39: has joined #RubyOnRails
[14:49:55] arup_r: has joined #RubyOnRails
[14:51:59] agent_white: has joined #RubyOnRails
[14:52:32] LBRapid: has joined #RubyOnRails
[14:53:30] matt_d: hi agent_white
[14:55:43] polishdub: has joined #RubyOnRails
[14:57:15] lxy: has joined #RubyOnRails
[15:01:05] Dysp: has joined #RubyOnRails
[15:01:08] orolo: has joined #RubyOnRails
[15:02:52] Dysp: Hi there. I am trying to develop my own extensions to classes and implement testing on my own. I am simply trying to look into how rails manages this to get inspiration. However Rails is quite complex for a newb like me. I have managed to find the core extensions (to hashes) in the source. But figuring out how to set up testing seems difficult to me. My question thus is.. where are tests for the core extensions located?
[15:03:36] DX1: has joined #RubyOnRails
[15:03:44] dionysus69: has joined #RubyOnRails
[15:03:46] Dysp: I've found https://github.com/rails/rails/tree/master/activesupport/lib/active_support/testing
[15:03:51] rubyonrails425: has joined #RubyOnRails
[15:04:02] Dysp: But, I cannot seem to find where the exact tests for the methods are being done.
[15:04:23] sevenseacat: https://github.com/rails/rails/tree/master/activesupport/test/core_ext
[15:04:34] JamesGames: has joined #RubyOnRails
[15:05:05] Dysp: As easy as that.
[15:05:07] Dysp: Thank you :)
[15:05:24] Dysp: Would you care to explain what the directoy I linked to does?
[15:05:51] artto: has joined #RubyOnRails
[15:06:21] rafaelflores: has joined #RubyOnRails
[15:06:22] JamesGames: hey peeps! I am trying to pull an item description from a partial, using JS onclick. Any ideas? I suspect i need a workaround like "capture do"
[15:06:23] sevenseacat: provides helpers to be used in your own tests
[15:06:38] Dysp: ah, okay. I see. Thank you
[15:07:04] LBRapid: has joined #RubyOnRails
[15:07:42] maletor1: has joined #RubyOnRails
[15:07:54] JamesGames: Any ideas guys?
[15:08:24] JakFrist: has joined #RubyOnRails
[15:08:29] JamesGames: https://gist.github.com/anonymous/1e277c13151f1b38cea83ca715908b44
[15:08:33] cschneid_: has joined #RubyOnRails
[15:09:23] JamesGames: come on. Stroke your beards people, and think!
[15:09:26] blackmesa: has joined #RubyOnRails
[15:10:06] sevenseacat: JamesGames: thats a little insulting
[15:10:17] Terens1: has joined #RubyOnRails
[15:10:29] Terens1: I guess sometime someone would write a framework for testing tests
[15:10:48] GoranPavlovic: has joined #RubyOnRails
[15:10:48] Terens1: and then it would become best practice
[15:10:51] JamesGames: sevenseacat: seriously?
[15:11:12] arup_r: Terens1: lol
[15:11:31] lupine: *actually has a beard, is insulted by the code*
[15:11:37] JamesGames: sevenseacat i remember you. You helped me b4
[15:11:43] sevenseacat: 'guys! guys! stroke your beards! i demand help!'
[15:11:47] lupine: ain't no thang like a dblclick thang
[15:11:53] JamesGames: sevenseacat: i guess
[15:11:56] roamingdog: i stopped at thang
[15:12:12] lupine: I struggled on through the camelCase but also stopped at thang
[15:12:29] lupine: maybe it'd be productive to suggest code snippets should pass rubocop before presentation?
[15:12:29] JamesGames: lupine: roamingdog : what shud i do?
[15:12:41] Pumukel: has joined #RubyOnRails
[15:12:58] roamingdog: JamesGames: make a concise gist and a specific question
[15:13:02] orolo: has joined #RubyOnRails
[15:13:36] one_zero: has joined #RubyOnRails
[15:13:39] sypheren: has joined #RubyOnRails
[15:13:42] drale2k: hm i think there is a bug with byebug (ye funny)
[15:13:54] roamingdog: JamesGames: and mend your speech a little to be more inclusive
[15:14:03] drale2k: everytime i use it once for a second and then i remove the line, my app is really slow. I have to restart the rails server to fix it
[15:14:29] JamesGames: ok. S. Question - How do I pull the description attribute from the items table with dblclick? I'll post relevant code now
[15:14:52] roamingdog: what's dblclick?
[15:15:26] roamingdog: oh, jquery, i see
[15:15:58] Oliphaunte: has joined #RubyOnRails
[15:16:15] rafaelflores: has joined #RubyOnRails
[15:17:07] jtong: has joined #RubyOnRails
[15:17:53] JamesGames: https://gist.github.com/anonymous/3cc631d0015e0738c5fc93975166358b
[15:17:58] drale2k: roamingdog: ok didn#t know there is a dblclick in jquery good to know
[15:18:09] JamesGames: i shortened the file to be concise
[15:18:38] JamesGames: drale2k: yes, but it's hard to integrate
[15:19:03] gh0st3d: If I'm working on a rails API should the httpd.conf virtual host settings point to the /public folder of the rails app?
[15:19:16] gh0st3d: or is that just for regular rails apps
[15:19:47] sevenseacat: an API is a regular rails app
[15:19:58] gh0st3d: ok. sorry, fairly new to rails
[15:21:04] JamesGames: sevenseacat: what u think?
[15:21:11] roamingdog: JamesGames: " <%= thang.dblclick.to_str %>" ? you're calling a jquery function on a model instance inside erb tags? what do you expect that to do?
[15:21:26] sevenseacat: JamesGames: I think you don't know what you're doing
[15:21:48] JamesGames: roamingdog: sevenseacat : the dblclick is a column in the items table
[15:22:11] JamesGames: ie - when double clicked what output they give
[15:22:18] disgrntld: has joined #RubyOnRails
[15:22:40] JamesGames: can i gist a database?
[15:22:45] roamingdog: JamesGames: so, what's the code doing now?
[15:23:05] roamingdog: JamesGames: no need to gist db, now that we know dblclick is a field in a table
[15:23:16] JamesGames: it shows variables for the room and objects that have that room as thier variable
[15:23:31] JamesGames: but i jus want the discription to show
[15:23:48] roamingdog: what is .to_str ?
[15:24:11] JamesGames: it makes the variable a string? is it wrong
[15:24:17] roamingdog: maybe thang.dblclick.description
[15:24:42] JamesGames: roamingdog: i dont getcha
[15:25:06] JamesGames: is that a method?
[15:25:09] Guest54296: has joined #RubyOnRails
[15:25:14] roamingdog: JamesGames: dblclick is not a string already?
[15:25:20] cschneid_: Does anybody know of a list of common rails db adapters? Like "mysql" and "mysql2" and "postgres", "postgis" etc. The actual strings that go into the adapter field in database.yml
[15:25:21] hansc: has joined #RubyOnRails
[15:25:33] JamesGames: it is . Ill delete that
[15:25:54] roamingdog: JamesGames: so, again, what's the code doing now? error, no output, what
[15:26:14] JamesGames: it does nothing when I double click the test object
[15:26:31] JamesGames: it ran b4 i tried to pass variables
[15:26:41] rafaelflores: has joined #RubyOnRails
[15:28:08] pontiki: has joined #RubyOnRails
[15:28:10] stephenmac7: has joined #RubyOnRails
[15:28:18] roamingdog: JamesGames: <% @room.save %> you're saving in a view, it's fine to be new to rails, everyone is at one point, but... you should learn some basics first i think
[15:29:01] JamesGames: roamingdog: ? where shud i b saving
[15:29:31] roamingdog: JamesGames: saving (and any such things that change the db) is done in the controller
[15:29:43] xall_: has joined #RubyOnRails
[15:30:41] JamesGames: roamingdog: if i show u my controller u tell me where ?
[15:30:44] djbkd: has joined #RubyOnRails
[15:31:06] LBRapid: has joined #RubyOnRails
[15:31:15] roamingdog: JamesGames: no, sorry, you need some basics first, there are many tutorials out there, you should run through a few
[15:32:10] ewelina: has joined #RubyOnRails
[15:32:24] JamesGames: ok will do. But about getting the desciption with dblclick?
[15:32:32] hanschiang: has joined #RubyOnRails
[15:32:57] k13nox: has joined #RubyOnRails
[15:33:48] pontiki: persistent
[15:33:48] roamingdog: JamesGames: you've just arrived at the monastery, the man at the door offers to take your coat, you say, so how do i get enlightenment
[15:34:18] sevenseacat: its all about the instant gratification
[15:34:45] JamesGames: not really. jus one problem i thought you guys would know
[15:34:57] JamesGames: don't mean to b a pain
[15:34:58] k13nox: Hi in Rails5 with ActionCable i use `reject_unauthorized_connection` but the client dont have a message like 'unauthorized access', it's ok ?
[15:35:08] sevenseacat: i bet the guys do know. the people who arent guys know too
[15:35:23] ewelina_: has joined #RubyOnRails
[15:36:20] JamesGames: have you used "capture do"
[15:37:15] roamingdog: JamesGames: i know what it does, but don't think i've ever used it
[15:38:40] rbr: has joined #RubyOnRails
[15:38:41] JamesGames: roamingdog: me neither
[15:39:03] JamesGames: how would you go about it?
[15:39:22] roamingdog: http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html
[15:39:23] artto: has joined #RubyOnRails
[15:39:23] pontiki: read the docuententation on it and try it out a few times
[15:39:29] rafaelflores: has joined #RubyOnRails
[15:39:58] JamesGames: roamingdog: Ye. i saw that
[15:40:20] JamesGames: i tried it but not successfully
[15:41:41] roamingdog: JamesGames: it's just baby steps, if you want to master that particular thang (couldn't resist), make a small page where you're only doing that thing, when it doesn't work, that's when you ask here, then move on to the next thing
[15:42:11] Devalo: has joined #RubyOnRails
[15:43:05] JamesGames: roamingdog: Ok. what do you think of my code. Objectively
[15:43:38] dionysus69: has joined #RubyOnRails
[15:45:15] rafaelflores: has joined #RubyOnRails
[15:46:08] JamesGames: like a= <% my_variable %> within capture do ,
[15:47:12] JamesGames: roamingdog: this is mi next thing
[15:47:26] JamesGames: like a= <%= my_variable %> within capture do ,
[15:50:11] JamesGames: function disc_function(a) { <% @ITEMroom = capture do %> a <% end %>
[15:50:28] roamingdog: JamesGames: i'm done
[15:50:51] JamesGames: ok bye then. thanks 4 your help
[15:50:56] sevenseacat: what... is that
[15:51:40] JamesGames: sevenseacat: the start of a js fn i link to dblclick
[15:52:06] sevenseacat: if you say so
[15:52:25] artto: has joined #RubyOnRails
[15:52:50] JamesGames: sevenseacat: the whole thing is : function disc_function(a) { <% @ITEMroom = capture do %> a <% end %> document.getElementById("output").innerHTML += "<br />" + "<%= render :partial => "/items/itemdisc", :locals => {:i => a, :m =>b}%> " ; }
[15:53:13] JamesGames: sevenseacat: What u think?
[15:53:57] sevenseacat: JamesGames: I think you don't know what you're doing
[15:53:58] nettoweb: has joined #RubyOnRails
[15:54:46] JamesGames: ok. but objectively. if this was your code and u wanted to pull a partial
[15:54:50] arooni-mobile: has joined #RubyOnRails
[15:54:56] arooni-mobile__: has joined #RubyOnRails
[15:55:00] mdw: has joined #RubyOnRails
[15:55:24] JamesGames: im jus putting a into @ITEMroom no
[15:55:30] roamingdog: JamesGames: why ask for advice if you don't want to take the advice?
[15:55:56] JamesGames: roamingdog: other than, go away and read a book u mean
[15:56:00] roamingdog: crap, i forgot i said i was done
[15:56:22] JamesGames: roamingdog: ok. what advice
[15:56:50] roamingdog: make a small page just to try out capture to see how that works.
[15:57:12] Emily: has joined #RubyOnRails
[15:57:26] dminuoso: has joined #RubyOnRails
[15:57:34] lacce: has joined #RubyOnRails
[15:58:59] zacts: has joined #RubyOnRails
[15:59:07] sypheren: has joined #RubyOnRails
[15:59:49] arup_r: has joined #RubyOnRails
[16:06:40] LBRapid: has joined #RubyOnRails
[16:07:26] JakFrist: has joined #RubyOnRails
[16:08:30] maletor1: has joined #RubyOnRails
[16:09:29] centrx: has joined #RubyOnRails
[16:09:40] JamesGames: roamingdog: here. It's not showing even when I put in fixed values
[16:09:42] JamesGames: https://gist.github.com/anonymous/c1aedb3af8b4e49e114b93d62fca471c
[16:10:25] seaworthy: has joined #RubyOnRails
[16:11:13] JamesGames: the partial is ok? no?
[16:11:31] roamingdog: JamesGames: there's a lot there besides 'trying out capture to see how it works'. does the code work?
[16:11:48] JamesGames: yes. except for the dblclick
[16:12:17] JamesGames: but the partial is'nt rendering
[16:12:19] blackmesa: has joined #RubyOnRails
[16:13:08] shinnya: has joined #RubyOnRails
[16:13:25] davidklsn: has joined #RubyOnRails
[16:13:58] roamingdog: JamesGames: you don't have to start with 'capture' to learn this stuff. my point is you have to learn things one-at-a-time. pick another thing, the js part if you wish, and just get that working. isolate.
[16:14:34] travismathis: has joined #RubyOnRails
[16:15:05] JamesGames: ok. what do you suspect to be the problem with my partial? the js renders plain text ok 4 dblclick
[16:16:15] roamingdog: JamesGames: fwiw, by bad when i questioned '.to_str'; didn't know that was a thing; usually it's .to_s
[16:16:41] JamesGames: i put it back in?
[16:17:10] diegoviola: has joined #RubyOnRails
[16:17:44] JamesGames: no. not working
[16:17:48] [Butch]: has joined #RubyOnRails
[16:18:20] nersoh: has joined #RubyOnRails
[16:18:39] roamingdog: no, but know the difference (between .to_s and .to_str)
[16:19:13] loveablelobster: has joined #RubyOnRails
[16:20:26] JamesGames: i will. why u think mi partial is failing?
[16:20:32] M-MichaelKulpa: has joined #RubyOnRails
[16:22:14] d5sx43: has joined #RubyOnRails
[16:24:01] JamesGames: roamingdog: so i .to_s the partial?
[16:24:16] xall_: has joined #RubyOnRails
[16:24:52] M-MichaelKulpa: Hey folks, I'm a windows guy who's needing to setup a centos box with Ruby, I'm a bit over my head on getting everything setup and running. Can anyone recommend a guide or offer a bit of guidance?
[16:25:20] manfrin: has joined #RubyOnRails
[16:25:27] M-MichaelKulpa: I've tried this guide https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-centos-7 but when I get to # rbenv install -v 2.3.1, rbenv isnt a recognized command
[16:25:29] Cohedrin: has joined #RubyOnRails
[16:25:58] roamingdog: M-MichaelKulpa: did the article have you install rbenv?
[16:26:47] Polysics: has joined #RubyOnRails
[16:26:55] M-MichaelKulpa: seemingly, I cloned it from git
[16:27:09] M-MichaelKulpa: it seemed to go well
[16:27:30] Polysics: hello! still fighting that weird Rails 5 update issue, where an upgraded app (from 4 to 5 and from Devise 3.x to 4.x) always gnerates invalid CSRF tokens
[16:27:30] M-MichaelKulpa: [root@localhost ~]# git clone git://github.com/sstephenson/rbenv.git .rbenv
[16:27:31] M-MichaelKulpa: Cloning into '.rbenv'...
[16:27:32] M-MichaelKulpa: remote: Counting objects: 2500, done.
[16:27:32] M-MichaelKulpa: remote: Total 2500 (delta 0), reused 0 (delta 0), pack-reused 2500
[16:27:33] M-MichaelKulpa: Receiving objects: 100% (2500/2500), 456.38 KiB | 0 bytes/s, done.
[16:27:34] M-MichaelKulpa: Resolving deltas: 100% (1546/1546), done.
[16:27:43] whathappens: has joined #RubyOnRails
[16:28:02] flashpoint9: has joined #RubyOnRails
[16:28:04] roamingdog: M-MichaelKulpa: shall we assume that was an accident? don't pollute the chat please
[16:28:16] Polysics: I tried clearing the tmp/ folder, the browser cache, even changing the secret
[16:28:28] Polysics: I am SURE this is one silly small thing, but I can't find it
[16:29:05] roamingdog: polysics: just upgraded from 4 to 5 on an app, no such issue here
[16:29:22] Polysics: roamingdog: yeah, that is what makes me think it is some other silly thing
[16:29:30] roamingdog: M-MichaelKulpa: rbenv is probably not in your path
[16:29:31] d5sx43: has joined #RubyOnRails
[16:29:38] Polysics: the only "custom" thing here is the login form and it's just HTML changes
[16:29:45] Polysics: the CSRF field is in the source
[16:30:28] rogue_koder: has joined #RubyOnRails
[16:30:48] roamingdog: M-MichaelKulpa: wait, you only cloned it, didn't install it?
[16:30:49] rafaelfranca: has joined #RubyOnRails
[16:31:57] M-MichaelKulpa: when I tried it gave me an error
[16:32:14] M-MichaelKulpa: #rbenv install -v 2.3.1
[16:32:14] M-MichaelKulpa: bash: rbenv: command not found
[16:32:35] ewelina: has joined #RubyOnRails
[16:32:52] roamingdog: M-MichaelKulpa: no, that's for installing a ruby _using_ rbenv (i think, haven't used it in a while). i mean did you install rbenv?
[16:32:59] M-MichaelKulpa: It's likely a simple bit of assumed knowledge I'm just missing.
[16:33:13] roamingdog: M-MichaelKulpa: https://github.com/rbenv/rbenv see installation instructions
[16:34:31] M-MichaelKulpa: I'll look that over and let you know, it could be so simple as that.
[16:35:18] maletor1: has joined #RubyOnRails
[16:36:53] Polysics: roamingdog: do you mind if I ask if I could see your Gemfile.lock?
[16:37:33] M-MichaelKulpa: Everything looked good, the only difference was the path update "$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile" vs "echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile"
[16:37:55] M-MichaelKulpa: however once I used the github command it seems to be clipping along
[16:39:07] DoctorMonocular: has joined #RubyOnRails
[16:39:38] siaw23: has joined #RubyOnRails
[16:40:06] davidklsn: has joined #RubyOnRails
[16:41:40] siaw23: i’m starting to play with rails and json/api stuff. can someone explain why this URL returns an array instead of a “PURE” json object? https://gyazo.com/52be77c321c022a0f7677d2b5b350ebb
[16:42:32] JamesGames: https://gist.github.com/anonymous/5f96b33e25999703b8807f9c0ca93e56 -- why is the partial not rendering?
[16:43:48] aazsdk: has joined #RubyOnRails
[16:44:25] lupine: siaw23: it's pretty normal- default behaviour for rails, I think - to return a json array of json objects for collection URLs
[16:45:06] lupine: richer descriptions of collections do exist under a variety of standards. I'm vaguely familiar with HAL, but I don't think anyone uses it
[16:45:07] davidklsn: has joined #RubyOnRails
[16:45:22] rafaelflores: has joined #RubyOnRails
[16:45:59] _djbkd: has joined #RubyOnRails
[16:46:14] Coldblackice: has joined #RubyOnRails
[16:47:29] JamesGames: i mean it looks golden and the values are constants
[16:47:58] jon31: hey guys, capistrano works when deploying to staging but not production, same server different accounts. IT used to work then suddenly stopped. it breaks at bundle install... the error is not clear :[
[16:47:58] drale2k: has joined #RubyOnRails
[16:47:59] jon31: https://gist.github.com/slavajacobson/8475042549ee07c7a9a40d7501bc58bd
[16:48:25] JamesGames: roamingdog: u there?
[16:48:40] drale2k: how do i subscribe to multiple channels with ActionCable
[16:48:57] drale2k: i have a subscription on "ChatChannel" but i need to subscribe to every room i am in
[16:49:04] JamesGames: anyway. ive stripped it down but it still wont render
[16:49:33] JamesGames: https://gist.github.com/anonymous/5f96b33e25999703b8807f9c0ca93e56
[16:50:56] JamesGames: i sense a plot to destroy the jedi
[16:51:27] blackmesa: has joined #RubyOnRails
[16:52:40] d5sx43: has joined #RubyOnRails
[16:56:43] JamesGames: roamingdog: ok? any tips?
[17:00:06] sumobob: has joined #RubyOnRails
[17:00:10] nettoweb: has joined #RubyOnRails
[17:00:23] d5sx43_: has joined #RubyOnRails
[17:02:34] whathappens: has joined #RubyOnRails
[17:07:39] manfrin: has joined #RubyOnRails
[17:08:39] upsell5: has joined #RubyOnRails
[17:08:57] rafaelflores: has joined #RubyOnRails
[17:11:39] queequeg1: has joined #RubyOnRails
[17:16:35] dionysus69: has joined #RubyOnRails
[17:17:19] yardenbar: has joined #RubyOnRails
[17:19:24] arup_r: has joined #RubyOnRails
[17:20:00] DoctorMonocular: has joined #RubyOnRails
[17:20:41] Leepoff: has joined #RubyOnRails
[17:25:09] barhum2013: has joined #RubyOnRails
[17:25:26] Dimik: has joined #RubyOnRails
[17:25:27] JakFrist: has joined #RubyOnRails
[17:25:33] arooni-mobile__: has joined #RubyOnRails
[17:25:55] queequeg1: has joined #RubyOnRails
[17:26:06] artto: has joined #RubyOnRails
[17:26:11] arooni-mobile__: has left #RubyOnRails: ()
[17:29:50] Cache_Money: has joined #RubyOnRails
[17:30:48] davidklsn: has joined #RubyOnRails
[17:31:01] Cache_Money: I use `number_to_human()` in my views but I'd like to use this function within my controller. Is this possible? I'm getting undefined method `number_to_human' for #<KpisController:0x007fabc8d15788>
[17:32:35] arooni-mobile: has joined #RubyOnRails
[17:32:50] arup_r: Cache_Money: those helpers are for presentation.. Why to use in controller?
[17:33:32] d5sx43: has joined #RubyOnRails
[17:33:34] Cache_Money: arup_r: I'm not sure how to turn 23,456,789 into 23.5 in ruby.
[17:33:37] cnk: has joined #RubyOnRails
[17:33:38] JamesGames: anyone know what to do w this? --- https://gist.github.com/anonymous/5f96b33e25999703b8807f9c0ca93e56
[17:33:41] arup_r: anyway it is your code do what you want. look http://stackoverflow.com/a/489910/2767755
[17:33:56] arup_r: Cache_Money: that is a string, then
[17:34:05] queequeg1: has joined #RubyOnRails
[17:34:18] Cache_Money: I've previously just used that helper function, but it's obviously not available within a controller. I think I converted it to a string then ran the function over it
[17:35:00] mikecmpbll: has joined #RubyOnRails
[17:35:25] arup_r: Cache_Money: from where that value is coming btw?
[17:35:36] Qwertie: has joined #RubyOnRails
[17:36:25] arup_r: JamesGames: What editor you use to write code? :) I am curious to know
[17:36:42] JamesGames: arup_r: cloud9, why?
[17:37:26] arup_r: ok.. your gist seems so ugly.. that is why
[17:37:39] arup_r: can you indent it properly?
[17:38:04] JamesGames: i could. but why? it doesnt work properly
[17:38:22] JamesGames: arup_r: i will. hang on
[17:38:52] arup_r: so that others can get interest to look at it. JamesGames .. :) Otherwise people will not read. code indentation is too important
[17:38:57] arup_r: JamesGames: thank you
[17:39:46] fermonkus: has joined #RubyOnRails
[17:40:47] JamesGames: https://gist.github.com/anonymous/f4ea09a1e6b9dd61d96d57b2393064fb
[17:41:08] JamesGames: maybe not much better. plus i was messing w it to try and get some output
[17:42:00] jtong: has joined #RubyOnRails
[17:42:01] adam12: JamesGames: You should explain the problem at the top of the gist, so people know what's up.
[17:42:19] JamesGames: Adam!!! long time!!
[17:42:19] adam12: JamesGames: And the idea about indentation is that we're all very busy here, and having to digest a bunch of disorganized code will turn many off.
[17:42:41] adam12: If you want to get help, explain your problem clearly, with nicely formatted code, so people don't have to work to help you.
[17:42:54] JamesGames: ok. it looks pretty on my screen. maybe it's the resolution
[17:43:25] adam12: Yeah, it's not good at all. Anyways - what's wrong with the code in the gist.
[17:43:33] JamesGames: The problem is, I cannot get the itemdisc partial to render inside of the onclick js fn
[17:43:41] adam12: I'm not here long.
[17:43:41] Cache_Money: arup_r: that value is coming from my database, within a controller action
[17:43:51] Rodya_: has joined #RubyOnRails
[17:44:12] arup_r: ok, Cache_Money and from controller where you are sending the data?
[17:44:13] Cache_Money: arup_r: So, how would you turn 23,456,789 into 23.5 in pure ruby?
[17:44:56] adam12: JamesGames: Explain what you want to happen. On double click of the item partial, you want X.
[17:44:59] arup_r: "23,456,789".sub(',','.').tr(',','').to_f.round(2)
[17:45:01] arup_r: Cache_Money: ^
[17:45:17] arup_r: yeah I know this is ugly
[17:45:19] Cache_Money: arup_r: sending it out in a JSON array
[17:45:50] JamesGames: On dblclick of the partial at the top of the page I want to display the text in the table for that item
[17:45:51] codelahoma: has joined #RubyOnRails
[17:45:55] Cache_Money: arup_r: that returns `23456789.0`
[17:46:29] Cache_Money: arup_r: I'd like `23.5`
[17:46:31] arup_r: "23,456,789".sub(',','.').tr(',','').to_f.round(2) # => 23.46
[17:47:05] arup_r: I am getting ^ in my IRB Cache_Money
[17:48:01] havenwood: Cache_Money: 23_456_789.fdiv(1_000_000).round(1)
[17:48:18] Cache_Money: arup_r: ahh, I'm getting that too. My original value is an integer though (not a string). How would I turned 23456789 (int) into 23.5?
[17:48:39] arup_r: aww.. I don't know how integer column stores them as `,`
[17:48:59] adam12: JamesGames: I think part of the problem is that Rails has no idea about your Javascript variables. Totally separate - browser vs server.
[17:49:00] Cache_Money: arup_r: It doesn't, I just used `,` to make it easy to see it was 23 million
[17:49:08] arup_r: Cache_Money: :(
[17:49:12] havenwood: Cache_Money: try my answer
[17:49:16] arup_r: Cache_Money: ^
[17:49:32] arup_r: ACTION wondering how havenwood got to know the actual data
[17:49:35] adam12: JamesGames: And I don't see a table?
[17:49:49] Cache_Money: arup_r: `23456789.fdiv(1_000_000).round(1)` works. Thanks!
[17:50:44] sunjiv: has joined #RubyOnRails
[17:51:05] dopamean_: has joined #RubyOnRails
[17:51:31] JamesGames: adam12: here is a better edit of the file
[17:51:33] JamesGames: https://gist.github.com/anonymous/bfc26b39c5f5e51f2677e0ce22323eeb
[17:51:44] JamesGames: how do I gist a table
[17:52:05] adam12: JamesGames: I see now.
[17:52:28] adam12: JamesGames: You likely want to wrap it in quotes. "<%= render partial: ETC %>"
[17:52:47] adam12: And maybe even use the javascript escape helper. "<%=j render partial: ETC %>"
[17:54:18] Oliphaunte: has joined #RubyOnRails
[17:56:10] Circuit8: has joined #RubyOnRails
[17:56:43] JamesGames: has joined #RubyOnRails
[17:57:20] JamesGames: u wanna see the partial files?
[17:57:24] siaw23: has left #RubyOnRails: ()
[17:58:25] Circuit8: Hi guys. Say I have a model Image which is polymorphic as imageable, and a model Exercise which `has_one :image, as: :imageable`. If I have ex = Exercise.new, and ex.image = Image.new, then do ex.save! I get an error `Validation failed: Imageable must exist`
[17:58:55] Circuit8: I think this is because rails saves the image first, but the imageable_id isn't set yet as the exercise hasn't been saved
[17:59:12] Circuit8: What is the best work around for saving things in this way, I've seen some pretty hacky solutions online
[17:59:25] adam12: JamesGames: No. I just gave you answer - did you not see it?
[17:59:51] adam12: 13:52 adam12: JamesGames: You likely want to wrap it in quotes. "<%= render partial: ETC %>"
[17:59:51] adam12: 13:52 adam12: And maybe even use the javascript escape helper. "<%=j render partial: ETC %>"
[18:00:26] JamesGames: ok, ill try that. hang on
[18:01:31] blackmesa: has joined #RubyOnRails
[18:04:05] JamesGames: adam12: That worked a treat!!! Once again you saved mi bacon!! Thank u!!!
[18:04:17] adam12: JamesGames: I'm out. Have fun.
[18:04:31] zekriad: has joined #RubyOnRails
[18:05:41] rafaelflores: has joined #RubyOnRails
[18:05:47] zacts: has joined #RubyOnRails
[18:06:36] arup_r: Circuit8: did you try build_image(..) version. try and let me know
[18:07:45] Circuit8: arup_r: Yes I've tried `exercise.build_image(attributes_for(:image))`
[18:07:58] Circuit8: arup_r: Same thing happens
[18:08:34] Circuit8: arup_r: I've realized I can do it but I have to do exercise.save; then do exercise.build_image(attributes_for(:image)).save;
[18:08:44] Circuit8: arup_r: But I'm having to save twice in my controller then
[18:08:45] Klumben: has joined #RubyOnRails
[18:09:02] Circuit8: arup_r: Which seems bad, I rather have it done in one go
[18:09:19] naftilos76: has joined #RubyOnRails
[18:09:54] LBRapid: has joined #RubyOnRails
[18:11:05] arup_r: you can try optional: true to the belongs_to side,, but no idea if it is best practice
[18:12:44] xall_: has joined #RubyOnRails
[18:12:58] Circuit8: arup_r: Hmm that does work but as you say it doesn't seem like a good practise as I don't ever want Image to exist without a polymorphic association
[18:13:00] arup_r: Circuit8: don't use optional: true .. it is not healthy solution
[18:13:01] DoctorMonocular: has joined #RubyOnRails
[18:13:11] Circuit8: arup_r: haha
[18:13:47] Circuit8: I'm surprised rails doesn't have an out of the box solution as this seems to me like it would happen quite often
[18:14:20] pLaTo0n: has joined #RubyOnRails
[18:14:52] arup_r: Circuit8: may be they have but we don;t know.. hehe
[18:16:18] Circuit8: arup_r: true true
[18:16:24] Circuit8: arup_r: Google doesn't seem to know
[18:19:12] Circuit8: Anyone else have an answer to this riddle?
[18:19:13] davidklsn: has joined #RubyOnRails
[18:20:50] upsell5: has joined #RubyOnRails
[18:20:56] uranther: has joined #RubyOnRails
[18:21:27] matthewd: Circuit8: I'm not sure I follow the problem
[18:21:59] Circuit8: Ill make a gist to make it clearer one sec
[18:22:44] arup_r: matthewd: he has a polymorphic model. And he want to save parent and child both at the same time, when both are new object.
[18:22:59] Axsuul: has joined #RubyOnRails
[18:23:56] matthewd: Circuit8: http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#create-an-executable-test-case may help
[18:24:02] sneakers: has joined #RubyOnRails
[18:24:39] Oliphaunte: has joined #RubyOnRails
[18:24:47] whathappens: has joined #RubyOnRails
[18:25:01] arup_r: that is nice!
[18:25:36] arup_r: Circuit8: just gram those 2 models and and try the code in rails console and present the gist here. Why are you taking so much time? :)
[18:27:00] Circuit8: https://gist.github.com/Circuit8/5c546d0d12a17d114112e7c582e3cfd9
[18:27:08] Circuit8: arup_r: Sorry just trying to make it presentable
[18:27:19] Circuit8: arup_r: That gist should explain everything
[18:27:25] n90b0jjf: has joined #RubyOnRails
[18:27:44] banisterfiend: has joined #RubyOnRails
[18:28:26] Circuit8: "he has a polymorphic model. And he want to save parent and child both at the same time, when both are new object." <- That seems like an accurate explanation
[18:28:59] arup_r: Circuit8: you could use rails console to just try the code and show.. which is explicit more.. but anyway lets see, if there is an answer. I am waiting for a "TIL" moment
[18:29:48] Leepoff: has joined #RubyOnRails
[18:30:23] netzfisch: has joined #RubyOnRails
[18:31:09] Circuit8: arup_r: OK one sec
[18:31:34] k13nox: has joined #RubyOnRails
[18:31:41] conta: has joined #RubyOnRails
[18:34:13] Circuit8: arup_r: I've updated the gist with some rails console code
[18:34:46] davidklsn: has joined #RubyOnRails
[18:35:18] jstransky: has joined #RubyOnRails
[18:36:21] blackmesa: has joined #RubyOnRails
[18:37:05] barhum2013: Has anybody tried to print to a serial 9 pin printer (Epson LX-300 II) from a rails app?
[18:37:53] travismathis: has joined #RubyOnRails
[18:39:19] lupine: not me, but presumably you just want to get something into the print spool, not start with File.open("/dev/ttyS0")
[18:40:57] DoctorMonocular: has joined #RubyOnRails
[18:41:33] barhum2013: lupine: I am using qz.io to print from the browser but for some reason it works well on a speficic windows 7 machine. We tried other windows 7,8, 10 machines and it comes out misaligned. We tried Mac and it does seem to work well. But we do need it to work on a windows based pc,=.
[18:42:01] barhum2013: lupine: I am just a little puzzled by the situation.
[18:42:52] draig: has joined #RubyOnRails
[18:43:38] rocketsurgeon: has joined #RubyOnRails
[18:43:44] jheathco: has joined #RubyOnRails
[18:44:26] dionysus69: has joined #RubyOnRails
[18:45:09] augcesar: has joined #RubyOnRails
[18:54:20] beingjohnm: I'm looking to implement branded subdomains for my app e.g. businessname.myapp.com. Based on a Google search there are many different ways to implement this. Anybody here ever do that?
[18:56:47] apotry: has joined #RubyOnRails
[18:56:53] beingjohnm: this looks like the guide I'm going to try: https://richonrails.com/articles/basic-subdomains-in-ruby-on-rails. One comment mentions something about an issue with devise in rails 4. But maybe I'll just jump in and try some things out.
[19:02:21] whathappens: has joined #RubyOnRails
[19:06:59] flashpoint9: has joined #RubyOnRails
[19:12:42] yfeldblum: has joined #RubyOnRails
[19:14:20] arup_r1: has joined #RubyOnRails
[19:16:40] djbkd_: has joined #RubyOnRails
[19:16:58] eserror: has joined #RubyOnRails
[19:22:07] xall_: has joined #RubyOnRails
[19:22:23] Joni: has joined #RubyOnRails
[19:23:07] Joni: https://github.com/rails/rails/issues/19997#issuecomment-101460681
[19:23:41] Joni: it doesn't work for me, as result `NameError: uninitialized constant Rails::TestRunner`
[19:24:25] Joni: any idea how it could be resolved?
[19:28:44] k13nox: has joined #RubyOnRails
[19:30:22] JakFrist: has joined #RubyOnRails
[19:30:32] sher: has joined #RubyOnRails
[19:35:49] Vasa: has joined #RubyOnRails
[19:36:50] helpa: has joined #RubyOnRails
[19:37:05] mikecmpbll: has joined #RubyOnRails
[19:39:37] moep: has joined #RubyOnRails
[19:43:31] dionysus69: has joined #RubyOnRails
[19:44:28] k13nox: has joined #RubyOnRails
[19:44:54] Mirubiri: has joined #RubyOnRails
[19:45:12] AndrewIsHere: has joined #RubyOnRails
[19:45:55] _Sypheren: has joined #RubyOnRails
[19:48:58] dalbuschat: has joined #RubyOnRails
[19:50:35] rafaelflores: has joined #RubyOnRails
[19:53:35] pawnbox_: has joined #RubyOnRails
[19:54:21] Synthead: has joined #RubyOnRails
[19:57:01] whathappens: has joined #RubyOnRails
[19:57:40] l4v2: What does the * and & mean in this create(*args, &block)
[20:00:02] nekomune: has joined #RubyOnRails
[20:01:06] rafaelflores: has joined #RubyOnRails
[20:01:48] stephenmac7: has joined #RubyOnRails
[20:02:25] stephenmac7: Hey, I'm using scoping for my models and would like to know if there is a way to construct an Arel query using that scoping?
[20:04:56] upsell5: has joined #RubyOnRails
[20:12:41] arup_r1: l4v2: ask #ruby
[20:12:54] DoctorMonocular: has joined #RubyOnRails
[20:15:04] diegoviola: has joined #RubyOnRails
[20:15:43] weaksauce: has joined #RubyOnRails
[20:15:44] jheathco: has joined #RubyOnRails
[20:17:08] AmiMoench: has joined #RubyOnRails
[20:20:36] _djbkd: has joined #RubyOnRails
[20:21:13] DoubleMalt: has joined #RubyOnRails
[20:22:12] diegoviola: has joined #RubyOnRails
[20:23:25] jenrzzz: has joined #RubyOnRails
[20:23:25] jenrzzz: has joined #RubyOnRails
[20:28:44] xall_: has joined #RubyOnRails
[20:30:09] srinidhi: has joined #RubyOnRails
[20:34:22] mixnblend: has joined #RubyOnRails
[20:34:47] wd40s: has joined #RubyOnRails
[20:38:04] Palsson: has joined #RubyOnRails
[20:40:30] _djbkd: has joined #RubyOnRails
[20:40:40] jtong: has joined #RubyOnRails
[20:43:00] n90b0jjf: has joined #RubyOnRails
[20:43:19] tvw: has joined #RubyOnRails
[20:43:34] pawnbox: has joined #RubyOnRails
[20:49:47] cschneid_: has joined #RubyOnRails
[20:52:15] travismathis: has joined #RubyOnRails
[20:53:04] fermonkus: has joined #RubyOnRails
[20:54:10] alyosha: has joined #RubyOnRails
[20:57:35] eljimmy: has joined #RubyOnRails
[20:57:35] whathappens: has joined #RubyOnRails
[20:57:40] jetpackjoe: has joined #RubyOnRails
[20:59:07] hahuang61: has joined #RubyOnRails
[21:03:44] mdel: has joined #RubyOnRails
[21:04:37] n90b0jjf: has joined #RubyOnRails
[21:06:00] Terens1: https://github.com/rubygems/guides/tree/my_malloc
[21:06:04] Terens1: I got this
[21:06:09] Terens1: how can I run
[21:06:13] Terens1: irb there ?
[21:06:27] flashpoint9: has joined #RubyOnRails
[21:21:54] akira616: has joined #RubyOnRails
[21:22:56] dmz: has joined #RubyOnRails
[21:22:56] dmz: has joined #RubyOnRails
[21:24:01] barhum2013: has joined #RubyOnRails
[21:24:38] Rodya_: has joined #RubyOnRails
[21:28:21] markin: in an activerecords migration, I have a polymorphic table that I reference via t.references (so it creates 2 columns), is there a way to specify the length on the string column as 255 chars?
[21:29:30] arup_r: ok markin then add those 2 columns by hand inside the same migration. Don't use t.references
[21:29:39] cnk: check the guides but you may have to just define the 2 columns yourself if you need to chagne the params
[21:29:41] arup_r: just add the same 2 columns as per your usercase
[21:30:16] cnk: markin: that's the sort of question the API reference is good for
[21:30:17] markin: yeah, the purpose was that we're migrating from rails 4.1 to 4.2 and it looks like before it specified it as 255 and not it doesn't
[21:30:40] arup_r: ah, ok I didn't know that
[21:31:10] arup_r: then add migration to change default type/options
[21:31:39] cnk: has left #RubyOnRails: ()
[21:31:48] cnk: has joined #RubyOnRails
[21:33:48] davidklsn: has joined #RubyOnRails
[21:34:07] mdw: has joined #RubyOnRails
[21:37:26] SteenJobs: has joined #RubyOnRails
[21:38:59] rafaelflores: has joined #RubyOnRails
[21:40:24] yfeldblum: has joined #RubyOnRails
[21:43:10] akira616: has joined #RubyOnRails
[21:47:13] rakm: has joined #RubyOnRails
[21:48:31] n90b0jjf: has joined #RubyOnRails
[21:48:46] Leepoff: has joined #RubyOnRails
[21:50:20] blackmesa: has joined #RubyOnRails
[21:50:24] JamesGames: has joined #RubyOnRails
[21:50:55] JamesGames: https://gist.github.com/anonymous/cdc245650c8344fc4c5576834ddb00ed trouble w JS listing table attributes
[21:53:39] Darmani: has joined #RubyOnRails
[21:54:36] Darmani: So Rails is telling me that I'm pointing to a route that doesn't exist but I deleted the route and renamed it and I still get the same error.
[21:54:38] Darmani: https://gist.github.com/mfifth/001fb2cc70631511fc225546166be05e
[21:54:47] Darmani: Could someone tell me what's going on?
[21:55:29] JamesGames: Darmani: did u migrate?
[21:56:01] Darmani: JamesGames: yep. With a different model name.
[21:56:08] dminuoso: Darmani: check rake routes
[21:56:16] dminuoso: And include it in your gist.
[21:56:40] JamesGames: anyone use gon successfully?
[21:57:10] Darmani: dminuoso: https://gist.github.com/mfifth/001fb2cc70631511fc225546166be05e
[21:57:47] _djbkd: has joined #RubyOnRails
[21:57:54] Darmani: dminuoso: My bad I posted the old routes too, the new routes should be at the bottom of that file.
[21:58:56] dminuoso: Darmani: Please include a <Full Trace>
[21:59:03] JamesGames: dminuoso: u see mi code?
[21:59:23] dminuoso: Darmani: Also, is the webserver running in the same environment as your "rake routes" command?
[21:59:32] dminuoso: And which environment is it?
[21:59:34] davidklsn: has joined #RubyOnRails
[21:59:40] xall_: has joined #RubyOnRails
[22:00:15] Darmani: dminuoso: oh good point I never refreshed the server let me try that...
[22:01:02] fermonkus: has joined #RubyOnRails
[22:01:35] Darmani: now it says that "item" isn't an initialized constant...
[22:01:38] Darmani: ACTION sighs
[22:03:22] JamesGames: https://gist.github.com/anonymous/cdc245650c8344fc4c5576834ddb00ed
[22:03:28] arup_r: has joined #RubyOnRails
[22:03:41] _djbkd: has joined #RubyOnRails
[22:03:46] solars: has joined #RubyOnRails
[22:04:33] _djbkd: has joined #RubyOnRails
[22:06:34] wethu: has joined #RubyOnRails
[22:09:03] _djbkd: has joined #RubyOnRails
[22:09:09] JamesGames: anyone have time to look at mi gist
[22:10:55] flashpoint9: Im a nub but ill take a gander
[22:11:04] JamesGames: tnx flashpoint9
[22:11:48] flashpoint9: So what are you trying to do specifically?
[22:12:19] JamesGames: display the dblclick attribute of an item when it is double clicked
[22:12:57] JamesGames: I can do it for constants but cannot pass variables from js to rb
[22:13:14] qejk: has joined #RubyOnRails
[22:13:51] jtong: has joined #RubyOnRails
[22:14:40] JamesGames: see the line: <%= javascript_tag do %>
[22:15:19] JamesGames: that works in the tutorial but not for me. same w gon
[22:15:33] flashpoint9: Yea cant help sorry, although I do think you want to remove the function from the marup and place it js and target it via a dom element
[22:15:49] apotry: has joined #RubyOnRails
[22:16:57] flashpoint9: also try and utilize jquery for your click and mouse actions
[22:17:38] JamesGames: how do i target it via a dom? there is jquery in the text i omitted.
[22:18:19] flashpoint9: https://api.jquery.com/dblclick/
[22:19:04] flashpoint9: the dom element you want to target has a class of "entry"
[22:19:35] flashpoint9: so in the jquery example instead of #target you would put .entry
[22:22:14] JamesGames: $( ".entry" ).dblclick(function() { "disc_function()" });
[22:22:44] flashpoint9: Did you test it?
[22:22:46] JamesGames: but im trying to call diffrent variables from each div. swhy i did it the other wat
[22:23:18] flashpoint9: you could use "this" in the function which will always reference the object clicked
[22:23:55] flashpoint9: you would benefit a lot from taking some jquery classes online
[22:24:22] workmad3: flashpoint9: 'always' == 'unless the click handler was explicitly bound to something else'...
[22:24:34] flashpoint9: https://remysharp.com/2007/04/12/jquerys-this-demystified
[22:24:50] whathappens: has joined #RubyOnRails
[22:25:19] flashpoint9: workmad3: yes, maybe I shouldnt have used "always"
[22:25:44] flashpoint9: normally calling "this" in a function will refer to the object the function is being called on
[22:25:46] workmad3: it's a dangerous word to use, especially in programming :)
[22:25:55] flashpoint9: workmad3: is correct
[22:26:02] flashpoint9: you are correct*
[22:26:06] JamesGames: so it will call the image in the div?
[22:27:10] k13nox: has joined #RubyOnRails
[22:28:15] pontiki: has joined #RubyOnRails
[22:28:43] JamesGames: if i put it $(.entry).dblclick(function() disc_function(a,b)) how do I pass a and b?
[22:29:17] JamesGames: if i put a command in every div i can set each function u no
[22:29:28] flashpoint9: https://www.codecademy.com/learn/jquery
[22:29:50] flashpoint9: Im not a 100% sure but I think you need to beef up some js skills a bit before rails
[22:29:55] flashpoint9: its not mandatory
[22:30:00] flashpoint9: but will greatly help you
[22:31:13] JamesGames: main problem is calling the partial with variables. priority 1
[22:31:16] neohunter: has joined #RubyOnRails
[22:32:51] JamesGames: flashpoint9: i got the js to render a constant-valued partial
[22:33:20] moeabdol: has joined #RubyOnRails
[22:33:24] JamesGames: so the next step is pulling a specific one from variables
[22:34:29] flashpoint9: I have to bounce, hope you figure it out
[22:34:43] JamesGames: flashpoint9: ok thanks for your input
[22:35:07] flashpoint9: has joined #RubyOnRails
[22:35:18] FernandoBasso: I am looking for a way to translate and pluralize an entire sentence. Any directions?
[22:36:49] fryguy: has joined #RubyOnRails
[22:40:04] FernandoBasso: http://stackoverflow.com/questions/25064677/rails-how-to-pluralize-a-sentence <-- This is it, I think.
[22:40:11] JamesGames: what's wrong with : <!-- this SHOULD make a js array --> <%= javascript_tag do %> window.itemarray = "<%=j Item.all%>"; <% end %>
[22:40:53] JamesGames: im getting : undefined method `gsub' for #<Item::ActiveRecord_Relation:0x007fb705945890>
[22:42:28] maxx88: has joined #RubyOnRails
[22:43:01] SteenJobs: has joined #RubyOnRails
[22:43:32] cnk: JamesGames: so reading that error message it looks like you are getting a relation object not a serializable thing
[22:43:57] flashpoint9: has joined #RubyOnRails
[22:43:57] cnk: what do you expect item.all to be?
[22:44:09] JamesGames: cnk: right. Brilliant. What do you recommend?
[22:44:26] srinidhi: has joined #RubyOnRails
[22:44:33] cnk: callign to_json on it?
[22:44:57] JamesGames: I expect an array of objects. specifically items with discriptions (dblclick ) that show when double clicked
[22:45:20] cnk: OK but you needs something that serializes those objects
[22:45:20] quazimodo: has joined #RubyOnRails
[22:45:34] cnk: you can't json escape the ruby represenations that you have
[22:45:42] JamesGames: no I followed ryan bates' tutorial. no json
[22:46:18] fschuindt: has joined #RubyOnRails
[22:46:23] JamesGames: cnk: why? what did i do wrong?
[22:47:23] cnk: I am not following the tutorial. I can only tell you what the error message is telling you is wrong
[22:47:38] cnk: for giggles, what happens witht out the 'j'
[22:47:56] JamesGames: cnk: ill check
[22:47:57] cnk: does erb give you stuff in that tag
[22:49:37] JamesGames: it prints out the rest of the program in plain text
[22:49:55] stephenmac7: How do I get active record to bind the proper values when I use Something.all.arel?
[22:50:28] stephenmac7: Nevermind, I'll figure it out later.
[22:51:34] JamesGames: cnk: so, relational not serializeable riight? what IF, if i was to make an array of the descriptions?
[22:52:37] cnk: Yes an array of simple types - hashes or just strines - should at least change the error
[22:52:56] cnk: What do you actually want in that JS thingamajig
[22:53:47] apotry: has joined #RubyOnRails
[22:54:30] JamesGames: i want (really badly at this stage) to pull the description of an object from its js double-click funciton
[22:54:52] djbkd_: has joined #RubyOnRails
[22:55:02] JamesGames: cnk: And I CAN do it for static entries
[22:55:24] cnk: OK then an array of description strings sounds reasonable
[22:55:44] dvinciguerra_: has joined #RubyOnRails
[22:56:13] JamesGames: i put : <%= javascript_tag do %> window.itemarray = "<%=j Item.all.dblclick %>"; <% end %>
[22:56:36] JamesGames: and got : undefined method `dblclick' for #<Item::ActiveRecord_Relation:0x007fd8413b5490>
[22:56:37] amperry: has joined #RubyOnRails
[22:56:47] JamesGames: but there is an dblclick column
[22:58:21] upsell5: has joined #RubyOnRails
[22:59:13] jamesgames_: has joined #RubyOnRails
[22:59:32] jamesgames_: sorry i was offline there a sec. did u msg ?
[22:59:57] amperry: Gotta question about design strategy: if I'm writing a report that pulls information from multiple tables, is it advisable to create a custom Controller that pulls data from multiple Models?
[23:00:11] cnk: amperry: I would
[23:00:31] rafaelfranca: has joined #RubyOnRails
[23:00:33] jamesgames_: cnk: u were saying about it being relational
[23:00:46] cnk: JamesGames: where the heck are you getting item.all
[23:00:54] cnk: I think it is not correct
[23:01:48] jamesgames_: does that not return the list? It does in the rails console
[23:02:31] amperry: cnk: anything special about having a controller that's not named after any particular model? I.e., odd routing concerns or views?
[23:03:05] jamesgames_: cnk: ok. i try Item dot nothing?
[23:03:50] cnk: amperry: you probably don;t want to use 'resource :thingy' to define your routes but since it is a reporting controller, you want custom urls anyway
[23:04:33] cnk: jamesgames_: the rails console is implicitly calling something like to_s or inspect
[23:05:59] jamesgames_: cnk: what shud i google 4 that?
[23:06:48] amperry: cnk: cool, thanks.
[23:07:05] cnk: No idea. I have not been following closely enough to know what Item is
[23:08:20] jamesgames_: cnk: just a db of items, 5 maybe 6 columns
[23:09:08] cd-rum: has joined #RubyOnRails
[23:09:16] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[23:10:21] Darmani: Hey how do I get my "orders" to show me the "variants" by calling order.variants?
[23:10:21] Darmani: https://gist.github.com/mfifth/44fa3ee76d5d18a0372d34f7be12f632
[23:11:11] Darmani: Is that even possible with my setup? o.o
[23:12:09] cnk: Darmani: order.variants should work - try it it the rails console with a specific order: order333.variants
[23:12:36] JamesGames: has joined #RubyOnRails
[23:12:41] pwnd_nsfw`: has joined #RubyOnRails
[23:12:56] cnk: If that doesn't work, double check that order333.line_items works
[23:13:08] cd-rum_: has joined #RubyOnRails
[23:13:17] Darmani: cnk: will do, thanks(:
[23:13:23] JamesGames: sorry i was offline. I missed the start of that
[23:13:46] JamesGames: i was thinking; window.itemarray = "<%=j Item %>";
[23:14:00] JamesGames: or window.itemarray = "<%=j Item[] %>";
[23:14:33] quazimodo: has joined #RubyOnRails
[23:14:51] cnk: jamesGames: I think you are playing whack-a-mole. Take a break and come back to it when you are ready to think about what you have and what the eror messages mean
[23:15:02] JamesGames: undefined method `gsub' for #<Class:0x007f3c9a53f9e8>
[23:15:09] Darmani: cnk: It does work! So I'm getting the error for a different reason...
[23:15:13] Darmani: Nonetheless, thank you ^.^
[23:15:28] cnk: OK so what context is giving you an error?
[23:15:52] JamesGames: cnk: Ok, but first. One thing. What does the relational thing mean? How would I get an actual array?
[23:15:57] jtong: has joined #RubyOnRails
[23:16:34] cnk: I don't know because I don't know where you got Item
[23:16:52] cnk: usually in a view, you have an instance vairalbe @item
[23:17:30] cnk: I suspect somehow the model Item is in scope and you are somehow trying to json escape a Ruby class
[23:18:12] JamesGames: cnk: what does that mean?
[23:19:33] Darmani: cnk: So... Both of the associations work but I still get an error. When you have time ping me.
[23:19:35] Darmani: https://gist.github.com/mfifth/44fa3ee76d5d18a0372d34f7be12f632#file-error-msg
[23:19:37] travismathis: has joined #RubyOnRails
[23:21:00] flashpoint9: has joined #RubyOnRails
[23:22:41] JamesGames: cnk: there is a @item = Item.all in the controller. I put; window.itemarray[] = "<%=j @item %>"; but got undefined method `gsub' for #<Item::ActiveRecord_Relation:0x000000030be188>
[23:22:56] cnk: Darmani: can you please do `rake db:schema:dump` and add that to your gist
[23:23:02] Mirubiri: has joined #RubyOnRails
[23:23:51] cnk: jamesGames: in your controler, add puts@item.inspect and look at the console
[23:23:57] cnk: do you get what you expect?
[23:24:04] drale2k: i don't get the diff between "stream_from" and "broadcast" in ActionCable
[23:25:10] twilling: has joined #RubyOnRails
[23:25:20] Darmani: cnk: rake db:schema:dump doesn't output anything to the terminal o.o
[23:25:38] cnk: nope it put a file in db/
[23:25:44] cnk: schema.rb
[23:27:13] Darmani: cnk: okay... I think this is what you're looking for? But I'm not sure
[23:27:13] Darmani: https://gist.github.com/mfifth/44fa3ee76d5d18a0372d34f7be12f632#file-schema-rb
[23:28:09] Darmani: cnk: Also it's a mess I know I was experimenting with a few things before I found the correct way to make a shirt website so... ignore the clutter T.T
[23:29:21] cnk: Orders should not have a variant_id column
[23:30:18] Darmani: cnk: Is that why I'm getting an error? o.o
[23:30:24] JamesGames: cnk: it prints everything. picture attribute, double click ...
[23:30:24] cnk: and variants should not have an order_id column
[23:30:56] cnk: Darmani: I am not 100% sure but I am confident that getting rid of those would help clarity
[23:31:20] Darmani: cnk: Okay... For the record that was before I knew better T.T
[23:31:28] JamesGames: u want i paste output?
[23:31:50] cnk: and I bet order should not have shirt_id since it should get that through variant
[23:33:12] cnk: jamesGames: what would be more helpful would be an example of what should end up in window.itemarray[] if you were successful
[23:33:40] bga57: has joined #RubyOnRails
[23:35:14] JamesGames: cnk: the inspect option gives me a nice array. all I need is to take the dblclick column from it
[23:35:51] JamesGames: @item.inspect.dblclick
[23:37:08] cnk: in your controller @item = Item.all.map{|item| item.doubleclick}
[23:37:25] Darmani: cnk: Well all the id's are removed, the errors still there though
[23:38:02] _djbkd: has joined #RubyOnRails
[23:39:00] cnk: Darmani: change LineItem so belongs_to :variant
[23:39:02] _djbkd: has joined #RubyOnRails
[23:39:07] cnk: the relationship is backwards
[23:39:28] cnk: LineItem is a mapping table between orders and variants
[23:40:19] Darmani: cnk: I didn't think of that :O
[23:40:21] Darmani: good point.
[23:40:47] Darmani: it worked!
[23:40:55] Darmani: cnk: Your my hero<3
[23:41:43] cnk: congrats
[23:42:00] cnk: Are you going to the LARuby meetup this evening?
[23:42:27] Darmani: cnk: uhhhhhhhhhhhmmmmm I wasn't planning on it...
[23:42:29] cnk: It's in downtown - which is about as close to you as it gets
[23:43:19] Darmani: Actually I can't now that I think about it. I'm going with my dad to pickup a camper >.<
[23:44:32] dminuoso: has joined #RubyOnRails
[23:44:40] JamesGames: cnk: undefined method `gsub' for #<Array:0x007f747456a578> is what i got
[23:45:13] xall_: has joined #RubyOnRails
[23:45:29] unreal_: has joined #RubyOnRails
[23:46:48] cnk: jamesGames: http://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html
[23:47:01] cnk: escape_javascript needs to get a string
[23:47:22] cnk: so you could do @item.join(', ')
[23:47:28] jtong: has joined #RubyOnRails
[23:47:47] cnk: that should turn the array 1, 2, 3 to the litteral string 1, 2, 3
[23:52:16] JamesGames: cnk: ok. im on it
[23:55:19] dopamean_: has joined #RubyOnRails
[23:55:39] JamesGames: cnk: @itemdesc = Item.all.map{|item| item.dblclick.join(', ')}
[23:55:51] JamesGames: we are close
[23:56:31] yfeldblum: has joined #RubyOnRails
[23:56:55] JamesGames: cnk: if i just put brackets round the list?
[23:57:09] quazimodo: actioncable says registered connection then just nothing else, and a few seconds later the JS tries to reconnect the websocket connection (in dev mode)
[23:57:19] quazimodo: i wonder what i'v emissed
[23:57:34] JamesGames: @itemdesc = [Item.all.map{|item| item.dblclick}]
[23:58:41] dalbusch1t: has joined #RubyOnRails
[23:58:58] cnk: no then you have an array - which will give you the same error message as before
[23:59:28] JamesGames: cnk: OK. but I want an array?
[23:59:55] cnk: not if you are going to pass it to escape_javascript