« Back to channel list

#RubyOnRails - 22 June 2016

« Back 1 day Forward 1 day »
[00:00:35] Kallis: has joined #RubyOnRails
[00:01:05] baweaver: though the fact that it repeats on large screens might be a bad thing
[00:01:14] Cache_Money: baweaver: do you have any suggestions on the image size I should be shooting for?
[00:01:46] jtong: has joined #RubyOnRails
[00:01:48] Cache_Money: It shouldn't repeat, even if the screen is large
[00:02:08] Cache_Money: I'll do some more Googling and see what I can find in terms of guidelines
[00:03:05] jmignault: has joined #RubyOnRails
[00:03:21] Leepoff: has joined #RubyOnRails
[00:03:42] srinidhi: has joined #RubyOnRails
[00:06:30] pragmatism: Why can I test against a route that doesn't exist? AKA I have a GET for an action, but a test against a POST for the same action works in TEST. Obviously, it 404's in production or development.
[00:07:15] pragmatism: Rails 4, Rspec latest.
[00:10:24] macsteps: has joined #RubyOnRails
[00:10:51] quazimodo: has joined #RubyOnRails
[00:10:54] Rodya_: has joined #RubyOnRails
[00:11:53] DoctorMonocular: has joined #RubyOnRails
[00:12:55] mdw7: has joined #RubyOnRails
[00:12:59] coalwater: has left #RubyOnRails: ()
[00:14:37] rickmasta: has joined #RubyOnRails
[00:16:13] brandon_j: has joined #RubyOnRails
[00:18:34] brandon_j: I'm running one Rails website, and I want to run around 20 very simple node.js websites (all with different domains). Should I use a service like AWS/DigitalOcean to do this, or would it be cheaper to just do it on a regular server?
[00:18:59] Radar: brandon_j: You could deploy it to Heroku?
[00:19:03] Leepoff: has joined #RubyOnRails
[00:19:07] nettoweb: has joined #RubyOnRails
[00:19:41] brandon_j: Radar: all on one dyno?
[00:19:54] Radar: brandon_j: All on separate dynos.
[00:20:08] brandon_j: Radar: I'm looking for the cheapest option.
[00:20:13] pragmatism: brandon_j How much traffic are you expecting?
[00:20:15] mdw: has joined #RubyOnRails
[00:20:26] pragmatism: IIRC, Heroku limits free-tier to 18h of operation a day
[00:20:46] Radar: brandon_j: Cheap in the short term or cheap in the long term?
[00:20:49] pragmatism: whereas you could run them all on a $5/m DO instance with no downtime and way faster response rates.
[00:20:58] pragmatism: response times*
[00:21:05] brandon_j: Each website would vary probably. 10k requests/month for some and probably 100k/month for others
[00:21:40] pragmatism: DO for sure.
[00:22:12] pragmatism: For the 100k a month (unless you're getting all the requests at one time each day) you're going to end up paying for Dynos.
[00:25:59] brandon_j: pragmatism: You're saying that I would have to group the lower-traffic sites with eachother on one dyno and put the higher ones on their separate dyno?
[00:26:10] brandon_j: dyno/droplet/whatever
[00:26:29] pragmatism: brandon_j No, I'm saying get a DigitalOcean instance, and just run them all on there.
[00:26:41] pragmatism: Misread question
[00:27:07] pragmatism: I'm saying that the higher throughput sites would require you pay for service, and DO would be WAY WAY cheaper.
[00:27:25] pragmatism: Plus, you could host all your apps on one instance (may not be good depending on what your apps do, but possible)
[00:28:08] pragmatism: Also DO scales much more cheaply than Heroku, and again, you'd only have to change the size of one DO droplet instead of paying for a Dyno for each of your apps that needed more power.
[00:28:36] Gilgamesh15: has joined #RubyOnRails
[00:28:52] rubyonrailed: has joined #RubyOnRails
[00:28:58] brandon_j: pragmatism: I was hoping there was a solution where I didn't have to group applications together though.
[00:29:42] pragmatism: How do you mean? On a DO instance, you could have 20 apps running in parallel answering at different domains.
[00:29:55] pragmatism: I'm not sure what you mean by "group together"
[00:30:01] tribals: has joined #RubyOnRails
[00:30:20] haaj: has joined #RubyOnRails
[00:30:21] tribals: and girls (if there is one)
[00:30:33] pragmatism: Out. Out with you.
[00:30:43] mdw: has joined #RubyOnRails
[00:30:45] brandon_j: pragmatism: is 20 apps per instance the limit? I can't find any of that information on their website
[00:31:02] pragmatism: DO offers linux servers, not application-instances.
[00:31:07] brandon_j: sorry that I'm a bit confusing, this is the first time I'm trying to do something like this
[00:31:13] brandon_j: ah, I see pragmatism.
[00:31:15] pragmatism: You can configure your server to run whatever you want
[00:32:07] brandon_j: I'm just worried about having to constantly readjust which websites are hosted on which if I have to scale later on.
[00:32:08] pragmatism: So, on that point, brandon_j, if you have no experience managing a server, this would be a great time to learn! There are a bunch of guides all over (DigitalOcean has a GREAT collection) for protecting your new server and getting apps running.
[00:32:20] pragmatism: brandon_j You'd have the same issue with Heroku.
[00:32:28] brandon_j: I see, thanks pragmatism!
[00:32:45] pragmatism: Totally! Free free to PM if you need specific help @brandon_j
[00:33:57] creature: has joined #RubyOnRails
[00:33:57] creature: has joined #RubyOnRails
[00:34:09] rickmasta: has joined #RubyOnRails
[00:35:29] rickmasta: has joined #RubyOnRails
[00:35:45] tribals: I'm completely discouraged... I'm trying to use gem 'rspec-rails', and i realized that there is NO way to use it WITHOUT db. For example, i want to write simple view test. And so, may you ask? `rake rspec` bootstraps test db EVERY time i run it. I tried to `require` parts of 'rspec-rails' separately, again, for views only (for example). But everything in 'rspec-rails' tied to db logic SO HARD...
[00:37:03] tribals: so, how??? how i do that? how to use 'rspec-rails' WITHOUT db?
[00:37:23] djbkd: has joined #RubyOnRails
[00:38:17] nettoweb: has joined #RubyOnRails
[00:42:32] tego101: has joined #RubyOnRails
[00:44:07] sdwrage: has joined #RubyOnRails
[00:44:34] rickmasta: has joined #RubyOnRails
[00:45:10] pragmatism: tribals Are you using Rails?
[00:45:23] pragmatism: Why not just use Rspec instead of rspec-rails
[00:45:28] pragmatism: aaaand they're gone.
[00:46:12] pragmatism: I hope they figured it out.
[00:53:29] rickmasta: has joined #RubyOnRails
[00:54:33] srinidhi: has joined #RubyOnRails
[00:55:08] emachnic: has joined #RubyOnRails
[00:55:45] hahuang65: has joined #RubyOnRails
[00:59:49] Oliphaunte: has joined #RubyOnRails
[01:03:20] jtong: has joined #RubyOnRails
[01:03:32] jhack: question, why does my User show page already provide the user object without me defining it?
[01:03:40] hahuang65: has joined #RubyOnRails
[01:03:52] jhack: I can do user.full_name etc without even specifying user = User.find(..) in my controller
[01:03:56] Radar: jhack: !code
[01:03:56] helpa: jhack: 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.
[01:04:41] jhack: @user or user not defined in show route, but show route gets User object, why?
[01:04:46] Radar: jhack: See above.
[01:05:08] jhack: okay thanks
[01:08:28] moeabdol: has joined #RubyOnRails
[01:10:30] weaksauce: has joined #RubyOnRails
[01:10:51] superlou: has joined #RubyOnRails
[01:13:47] YourManCJ: has joined #RubyOnRails
[01:14:33] YourManCJ: I followed this tutorial(https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma) and changed all the paramaters but capistrano is pulling my local user when trying to deploy. any ideas?
[01:15:12] rickmasta: has joined #RubyOnRails
[01:15:59] sevenseacat: has joined #RubyOnRails
[01:17:45] saturn_knight: has joined #RubyOnRails
[01:19:55] YourManCJ: cap is pulling the correct ipaddress but it is not using the correct user
[01:20:33] saturn_knight: has joined #RubyOnRails
[01:24:47] saturn_knight: has left #RubyOnRails: ()
[01:26:40] saturn_knight_: has joined #RubyOnRails
[01:26:47] adam12: yourmancj: can you gist your config/deploy.rb ? remove any sensitive info first tho.
[01:27:56] zave: has joined #RubyOnRails
[01:28:54] d0nn1e: has joined #RubyOnRails
[01:31:50] Oliphaunte: has joined #RubyOnRails
[01:32:04] iajrz: has joined #RubyOnRails
[01:32:20] YourManCJ: sorry it took so long
[01:32:21] YourManCJ: https://gist.github.com/anonymous/13f662ab3c6db36285001a46a50e5344
[01:32:26] YourManCJ: i am bad at things
[01:32:27] Darkman738: has joined #RubyOnRails
[01:33:00] Darkman738: Assuming you are here as well Radar?
[01:33:01] pawnbox: has joined #RubyOnRails
[01:33:04] YourManCJ: whenever I go to deploy it tries to push to the remote server with my local username at the remote ip address
[01:33:05] Radar: darkman738: Of course.
[01:33:15] Radar: yourmancj: Did you set :user, "someotheruser" somewhere?
[01:33:22] Radar: https://gist.github.com/anonymous/13f662ab3c6db36285001a46a50e5344#file-deploy-rb-L6
[01:33:31] Radar: I don't know what could be wrong.
[01:33:33] YourManCJ: yes, it is in the deploy.rb
[01:33:52] Darkman738: Glancing at your example I've seen similar before, but I'm not using a DB for my app at all.
[01:34:01] Darkman738: So I don't have a model to work off of
[01:34:36] YourManCJ: something is off where it is not getting the user but it is getting the ip address
[01:34:36] Darkman738: I'm on my phone so I admit I haven't dissected it just yet, but I think I'm correct in my assumption
[01:35:49] adam12: yourmancj: You need to enable ssh options. Line 21.
[01:36:08] adam12: yourmancj: if you don't need forward agent or are not using private keys modify the line.
[01:37:10] YourManCJ: holy hell! thank you so muchg
[01:37:15] YourManCJ: I would not have caught that
[01:37:22] YourManCJ: now it is pulling the correct username
[01:38:01] diegoviola: this seems kinda tricky... let's say I want to add phone numbers to the Devise registration, do I need to customize devise controllers or extend it?
[01:40:22] diegoviola: https://github.com/plataformatec/devise#configuring-controllers
[01:43:57] sevenseacat: https://github.com/plataformatec/devise#strong-parameters
[01:44:31] Darkman738: has joined #RubyOnRails
[01:47:36] Darkman738: has joined #RubyOnRails
[01:49:23] emachnic: has joined #RubyOnRails
[01:49:47] crystal77: has joined #RubyOnRails
[01:50:38] diegoviola: thanks sevenseacat
[01:52:25] YourManCJ: when deployhing my remote user, 'deploy' cannot create directories in the /var/www/..... even though that user has sudo permissions
[01:52:32] YourManCJ: what is the best way to fix this?
[01:54:38] Radar: sudo permissions != ability to create dir
[01:55:16] YourManCJ: yeah, what is the group that I need to add my user to in order to allow making of dirs in /var?
[01:55:33] test: has joined #RubyOnRails
[01:55:38] test: nice to memt
[01:56:49] adam12: yourmancj: The tutorial you followed uses a folder in your users home dir. Any reason why your diverging?
[01:57:27] Spami: has joined #RubyOnRails
[01:57:40] YourManCJ: I am not trying to diverge, following the tutorial, when I deploy cap it errors there saying that deploy does not have permission to make a dir in /var/www
[01:57:56] diegoviola: ls -ld /var/www should show you the group for that specific directory
[01:57:59] adam12: yourmancj: Ah. Your config has your deploy_to setting commented out.
[01:58:14] Markhor1991: has joined #RubyOnRails
[01:58:21] adam12: yourmancj: And I believe Capistrano historically deferred to /var/www.
[01:58:45] YourManCJ: ok, I thought it had something to do with the config.rb. the tutorial has all of those options commented out
[01:59:41] adam12: Nope. They are uncommented. Maybe something to do with your copy/paste?
[02:00:07] YourManCJ: that will do it
[02:00:14] Darkman738: so I'll try to re-explain here with a bit more detail. I'm trying to setup a view that hides unnecessary forms, however I'm not using a database to have the controls driven by a model (or at least a DB backed one). the contents of a value (keys are used to label the selection) will determine the forms exposed. I have setup a helper model with accessors to boolean fields that represent the contents of the values, but I'm not s
[02:00:20] YourManCJ: also I cannot read so that is an issue
[02:00:31] subsonik: has joined #RubyOnRails
[02:00:36] Darkman738: to link that exposed model to the view in a meaningful way
[02:01:16] adam12: darkman738: Can you share some code? It's hard to picture without.
[02:02:10] mrkhlm: has joined #RubyOnRails
[02:02:12] Darkman738: all I really have is the hash and a view that loads the keys as the dropdown contents
[02:02:44] adam12: darkman738: Share anyways.
[02:04:00] jtong: has joined #RubyOnRails
[02:09:14] moeabdol: has joined #RubyOnRails
[02:10:48] Darkman738: https://gist.github.com/anonymous/2ed177762f6a753132731f4f83714c41
[02:11:13] Darkman738: is the gist of it
[02:11:22] adam12: darkman738: So the dropdown will toggle the visibility of the other text fields?
[02:11:28] adam12: depending on which one was chosen?
[02:11:42] Darkman738: based on if %{social} is present in the value etc
[02:11:54] Darkman738: it will show the social option
[02:12:10] adam12: You'll likely need Javascript unless you are OK resubmitting back to this same URL ...
[02:12:24] adam12: What is `do_something` actually? Is this some sort of verification process?
[02:12:52] Darkman738: I'm ok with that, I'm just not sure how to get anything useful back to js to have it hide the forms
[02:13:17] jkwood: It does something, obviously.
[02:13:21] Darkman738: not it's not validation, it's a worker process
[02:13:35] Darkman738: string manipulation mostly
[02:13:39] jkwood: As proper naming standards dictate.
[02:14:32] Darkman738: just a mockup while I'm trying to learn
[02:15:00] SteenJobs: has joined #RubyOnRails
[02:15:06] adam12: darkman738: Well, I'd probably handle this with JS. Render them all, hide them with CSS. On change of select, show/hide appropriate form element.
[02:15:34] adam12: darkman738: Are you passing the values of @contents to String#%?
[02:15:41] duncannz: has joined #RubyOnRails
[02:15:44] Darkman738: right, that much I've worked out, but what I can't figure out is how to get the information back to the form to do that.
[02:16:08] Darkman738: I'm only sending the keys not the values of the hash (I want to keep that hidden)
[02:16:33] adam12: I see that now.
[02:17:40] xall: has joined #RubyOnRails
[02:18:59] PotatoChipz: has joined #RubyOnRails
[02:20:05] adam12: darkman738: I'm not saying this is the _right_ approach, but might work to keep you moving: https://gist.github.com/adam12/6d7174e9b90e6a8307b52f0e7f89151b
[02:20:27] nettoweb: has joined #RubyOnRails
[02:20:56] adam12: Basically, doing string comparison like I am is brittle. You should be referencing the same value in the same spot, and 'Choice 1' doesn't correlate to 'Account Code' right now.
[02:21:02] SteenJobs: has joined #RubyOnRails
[02:21:20] adam12: You could do it with JavaScript - not Rails specific.
[02:21:39] adam12: And this is assuming that you can resubmit the form back to itself, which you can with the example in the Gist, but more complicated forms likely not.
[02:22:33] joshoutoshi: has joined #RubyOnRails
[02:22:37] roamingdog: has joined #RubyOnRails
[02:24:48] joshoutoshi: ignore me, just testing
[02:28:08] Darkman738: thanks guys, I appreciate it, just having a difficult time wrapping my head around it
[02:28:28] adam12: darkman738: sometimes it helps talking it out
[02:28:57] Darkman738: can I get js to pull info from the controller at all?
[02:29:16] Darkman738: I can push the requirements that way based on the value contents
[02:29:50] adam12: You'd have to stick the value you want into the view somewhere.
[02:30:02] adam12: data attribute on an element, meta tag, script tag, etc.
[02:30:14] sypheren: has joined #RubyOnRails
[02:30:20] adam12: but you could just get the value from the select tag in this case.
[02:30:46] Darkman738: that could be ok, I've got a model helper that contains boolean values of each property
[02:31:14] xall: has joined #RubyOnRails
[02:31:33] Darkman738: there are a growing number of keys but only a few (predictable) fields
[02:32:32] adam12: I'll have to bbiaf. Baby fussing.
[02:32:46] SteenJobs: has joined #RubyOnRails
[02:32:55] Darkman738: I'll be back on tomorrow most likely
[02:33:00] Darkman738: see if sleep brings any ideas
[02:35:51] _Tariq: has joined #RubyOnRails
[02:40:21] SteenJobs: has joined #RubyOnRails
[02:41:56] _Tariq: has joined #RubyOnRails
[02:44:24] _Tariq: has joined #RubyOnRails
[02:44:37] DoctorMonocular: has joined #RubyOnRails
[02:45:08] crystal77: has joined #RubyOnRails
[02:50:48] YourManCJ: how do I configure the secert base key on the production server?
[02:50:59] triptec: has joined #RubyOnRails
[02:51:15] alfiemax: yourmancj, set it in your secrets.yml
[02:51:37] YourManCJ: how though? rake on local, write in secerts.yml, then git commit?
[02:51:56] alfiemax: nop, never commit your secrets.yml
[02:52:08] YourManCJ: so what is the best way to get it to the server?
[02:52:20] alfiemax: rake on local or where ever, ssh into server and set it manually
[03:00:14] jetpackjoe: has joined #RubyOnRails
[03:00:37] PotatoChipz: has joined #RubyOnRails
[03:05:55] FrankD: has joined #RubyOnRails
[03:06:00] nettoweb: has joined #RubyOnRails
[03:07:38] FrankD: Hey, can anyone tell me how to accept nested parameters in Rails? params.require(:conv_job).permit(:Name, :StyleImage_id, :ContentImage_id, Options: optParams, :CreatedBy) <-- is not working (optParams is an array of strings for the sub-parameters) as I'd hoped
[03:08:37] alfiemax: then it should be optParams: []
[03:08:46] alfiemax: and as the last param in your list
[03:09:53] alfiemax: and would advice you to follow the naming conventions of using snake case for your attributes
[03:11:34] skiz: has joined #RubyOnRails
[03:13:38] FrankD: i like to vary case
[03:14:07] FrankD: and optParams is set, I just changed it to {:Options => optParams} and it seems to be working ok
[03:14:42] jetpackj1: has joined #RubyOnRails
[03:16:33] YourManCJ: I keep getting
[03:16:40] YourManCJ: An unhandled lowlevel error occurred. The application logs may have details.
[03:17:06] YourManCJ: I checked the logs and the only thing it shows is the requests I have sent the server
[03:17:49] AmiMoench: has joined #RubyOnRails
[03:17:56] YourManCJ: the only 2 logs are nginx.access and nginx.error. error is blank and access is just showing get requests from my pc
[03:20:57] k3rn31: has joined #RubyOnRails
[03:21:36] joowh85: has joined #RubyOnRails
[03:22:58] xlegoman: has joined #RubyOnRails
[03:24:05] braincras: has joined #RubyOnRails
[03:24:58] crystal77: has joined #RubyOnRails
[03:31:27] Leepoff: has joined #RubyOnRails
[03:31:50] xall: has joined #RubyOnRails
[03:32:19] northfurr: has joined #RubyOnRails
[03:32:45] mikecmpbll: has joined #RubyOnRails
[03:35:00] pawnbox: has joined #RubyOnRails
[03:35:48] specialblend_: has joined #RubyOnRails
[03:37:40] emachnic: has joined #RubyOnRails
[03:38:13] AmiMoench: has joined #RubyOnRails
[03:39:43] bklane: has joined #RubyOnRails
[03:42:09] dezull: has joined #RubyOnRails
[03:43:10] diegoaguilar: has joined #RubyOnRails
[03:45:08] specialblend_: hey do you think it’s a good idea to use a DRB daemon to connect to an MQTT broker to publish to a topic, since it’ll just maintain 1 long connection vs connecting each time an event from the server happens and pushing to a topic.
[03:46:13] sevenseacat: ACTION blinks
[03:46:16] sevenseacat: wrong channel?
[03:46:31] Radar: I'm guessing http://ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html
[03:46:36] northfurr: has joined #RubyOnRails
[03:46:40] Radar: and http://mqtt.org/
[03:47:08] ebbflowgo: has left #RubyOnRails: ()
[03:47:17] pragmatism: Although I'm more of an Elixir person these days :P
[03:47:24] Leepoff: has joined #RubyOnRails
[03:47:28] pragmatism: specialblend_ how about AMQP?
[03:47:46] YourManCJ: does anyone have a tutorial on setting up secret keybases in production? I am having a hell of a time
[03:47:53] pragmatism: Better adapter support and AFAIK it uses persistent connections.
[03:49:00] dezull_: has joined #RubyOnRails
[03:49:06] sevenseacat: yourmancj: set an ENV variable, read it in secrets.yml ?
[03:49:15] specialblend_: pragmatism: Ugh, there are so many different types of pub/sub setups
[03:49:24] pragmatism: specialblend_ no joke.
[03:49:34] YourManCJ: I am trying that but I cannot get it to work
[03:49:43] specialblend_: pragmatism: I see that looks better for short-term queueing
[03:49:56] specialblend_: or quick queueing or w/e
[03:50:02] YourManCJ: I set the env var, have the secrets.yml read it
[03:50:21] specialblend_: pragmatism: I basically have all the MQTT stuff setup and working nicely though haha
[03:50:25] sevenseacat: yourmancj: so whats the problem?
[03:50:27] pragmatism: We've had it in prod for about a year. No complaints so far, except from juniors who don't understand the translations states :P
[03:50:40] pragmatism: specialblend_ yeah, that looks really cool. Very light-weight
[03:50:52] YourManCJ: I keep getting the error when I got to the ip from a browser "An unhandled lowlevel error occurred. The application logs may have details."
[03:51:06] pragmatism: What did the logs say?
[03:51:09] YourManCJ: I check the log and the puma.access.log complains about missing secret_key_base
[03:51:29] pragmatism: Check your secrets.yml, and make sure you've uncommented and changed out the key
[03:51:55] specialblend_: pragmatism: ya, no production use yet but it’s quick on localhost lol. My question is more on the daemon side of things. I’m thinking it’s best to run 1 process connected to the broker which I can keepalive and send commands to push
[03:52:09] YourManCJ: it is uncommented and is reading from the env var
[03:52:15] sevenseacat: yourmancj: can you gist your secrets.yml?
[03:52:35] pragmatism: yourmancj and in case it's not obvious, sanitize it first :)
[03:52:42] specialblend_: instead of a request coming in and I connect, push, disconnect. Sounds like it might not scale well since pub/sub is meant more for long connections
[03:52:52] sevenseacat: well there shouldnt be anything worth sanitizing in there, which is kind of the point
[03:52:53] Ropeney: has joined #RubyOnRails
[03:52:55] pragmatism: Also, echo the env vars to make sure they're set from the perspective of the app user.
[03:53:03] pragmatism: sevenseacat You're right, but one never knows.
[03:53:25] pragmatism: specialblend_ at least the sub side.
[03:53:32] specialblend_: Let me rephrase, does anybody still use DRB?
[03:53:34] pragmatism: the publisher can connect at will.
[03:53:47] pragmatism: Not in production.
[03:53:53] pragmatism: Me and mine, any way
[03:54:41] YourManCJ: https://gist.github.com/anonymous/7c2c70e616ead7121a93937033048622
[03:55:28] specialblend_: pragmatism: hmm ok if there’s no problem connecting, publishing and disconnecting I guess that’s easier than setting up and monitoring a daemon
[03:55:37] PotatoChipz: has joined #RubyOnRails
[03:55:45] specialblend_: guess I can try it and benchmark the broker to see
[03:56:07] sevenseacat: yourmancj: and you're 100% positive you've set ENV["SECRET_KEY_BASE"], and its being read by the app (ie. if you open a rails console you can see that data) and you restarted your server after setting it?
[03:57:23] pragmatism: specialblend_ run the experiment, report back?
[03:57:28] moeabdol: has joined #RubyOnRails
[03:57:47] specialblend_: pragmatism: ya let me set something up and see what happens
[03:58:04] yardenbar: has joined #RubyOnRails
[03:58:07] YourManCJ: hold upo, all my stuff broke. am fixing
[03:59:01] Oliphaunte: has joined #RubyOnRails
[04:01:48] SteenJobs: has joined #RubyOnRails
[04:04:43] rafaelfranca: has joined #RubyOnRails
[04:05:10] jtong: has joined #RubyOnRails
[04:11:46] User458764: has joined #RubyOnRails
[04:12:11] djbkd: has joined #RubyOnRails
[04:19:12] northfurr: has joined #RubyOnRails
[04:25:47] Hyuk: has joined #RubyOnRails
[04:26:07] k3rn31: has joined #RubyOnRails
[04:27:11] alfiemax: has joined #RubyOnRails
[04:28:35] moei: has joined #RubyOnRails
[04:28:38] jetpackjoe: has joined #RubyOnRails
[04:32:13] seaworthy: has joined #RubyOnRails
[04:33:22] pawnbox: has joined #RubyOnRails
[04:36:27] SteenJobs: has joined #RubyOnRails
[04:36:36] DoctorMonocular: has joined #RubyOnRails
[04:37:27] mikecmpbll: has joined #RubyOnRails
[04:41:12] YourManCJ: thank you so much for your help guys
[04:41:17] YourManCJ: Its done and everything is working
[04:41:20] yaewa: has joined #RubyOnRails
[04:41:50] YourManCJ: I think I would have given up on this project and just quite if I had not had your help. I really cannot tell you how much help you have been
[04:42:12] YourManCJ: It is time for me to sign off and sleep. thanks guys
[04:43:24] sevenseacat: we're not all guys here, but you're welcome.
[04:44:09] kp666: has joined #RubyOnRails
[04:45:36] kp666: has joined #RubyOnRails
[04:45:52] xall: has joined #RubyOnRails
[04:45:54] spellbook: has joined #RubyOnRails
[04:45:59] specialblend_: pragmatism: hmm this might be a bit tricky to benchmark with a tool since I’m using both mqtt and websockets.
[04:46:09] specialblend_: for a real scenario
[04:49:03] YourManCJ: has left #RubyOnRails: ()
[04:49:15] spellbook: hi everyone. i've been having an issue for a few hours and was hoping someone could help. i have an app that i made that works fine locally but fails when deployed on heroku. the stack trace isn't helping.
[04:49:50] spellbook: it reads lists my params hash then on the next line: NoMethodError (undefined method `[]' for nil:NilClass):
[04:50:09] specialblend_: pragmatism: seems to run a lot of quick publish connections then disconnect fine though so I think I’ll just go that route and monitor more in production. Local results on my Mac quad core intel with about 3GB effective memory right now performed this - Result : broker=tcp://, clients=10, totalCount=99232, duration=1298ms, throughput=76449.92messages/sec
[04:50:38] sevenseacat: spellbook: got some code/logs for us to see, so we can see whats happening?
[04:50:48] pragmatism: specialblend_ Thanks for running that!
[04:52:50] User458764: has joined #RubyOnRails
[04:53:58] spellbook: yes. https://gist.githubusercontent.com/anonymous/2b5084a3ca631e23bd35e3a7b2feed99/raw/832cc209b8d2bf17eaaee42df412dc2a414031ce/gistfile1.txt
[04:54:06] alfiemax: has joined #RubyOnRails
[04:54:49] nettoweb: has joined #RubyOnRails
[04:55:20] urbanmonk: has joined #RubyOnRails
[04:56:16] Oliphaunte: has joined #RubyOnRails
[04:56:31] lightt: has joined #RubyOnRails
[04:58:07] pawnbox: has joined #RubyOnRails
[04:59:58] DoctorMonocular: has joined #RubyOnRails
[05:06:31] rafaelfranca: has joined #RubyOnRails
[05:06:43] sevenseacat: spellbook: so whats on line 5 of your api/weather_controller.rb ?
[05:06:47] jeffrabovsky: has joined #RubyOnRails
[05:08:29] spellbook: sevenseacat: @weather = Weather.new(params['query'])
[05:09:08] sevenseacat: spellbook: so what does the initialize method of your Weather class look like? :)
[05:09:23] sevenseacat: I hope you havent defined an initialize method on an AR object
[05:09:28] sevenseacat: that can only end badly
[05:10:48] spellbook: but my weather class doesn't inherit from AR
[05:11:09] sevenseacat: okay, so whats in the initialize method of the Weather class? :)
[05:13:00] spellbook: sevenseacat: it looks like this: https://gist.github.com/anonymous/866f7c7d6570c0630225c952cccebc9d
[05:13:38] spellbook: i just use it to pull data from an api and then parse it
[05:13:54] jeffrabovsky: I'm having a hard time getting conditional validations to work at all: http://pastebin.com/EXQGhvp8
[05:13:55] sevenseacat: so the error appears to be on line 10 of that class - are you sure `cast` is always non-nil?
[05:14:26] jeffrabovsky: any ideas what I'm doing wrong?
[05:16:09] spellbook: sevenseacat: yes. i'm pulling the latitude and longitude coordinates from google maps, so those are valid.
[05:16:23] sevenseacat: thats not what I asked
[05:16:48] sevenseacat: does ForecastIO.forecast *always* return something you cal call ['currently'] on?
[05:18:56] spellbook: sevenseacat: yes.
[05:19:22] sevenseacat: I think this is incorrect
[05:19:40] spellbook: sevenseacat: it always returns a big json object. one of the keys being currently
[05:21:29] cleopatra: has joined #RubyOnRails
[05:21:36] sevenseacat: now I know that's not correct. inspect `cast` and see what it is :)
[05:23:06] sevenseacat: https://github.com/darkskyapp/forecast-ruby/blob/master/lib/forecast_io.rb#L23-L27 if the response is not a success, you will get nil back
[05:24:34] sevenseacat: so what circumstances might the response not be a success? is the API key set correctly?
[05:26:05] emachnic: has joined #RubyOnRails
[05:28:22] phrozen77_: has joined #RubyOnRails
[05:32:09] spellbook: sevenseacat: a bad url would cause it to fail. i'm sure i'm setting everything correctly. i set the ForecastIO.api_key before setting cast
[05:32:20] sevenseacat: and what did you set it to? :)
[05:32:39] spellbook: ENV["ForecastIO_KEY"]
[05:32:52] sevenseacat: I can see that, but what is that?
[05:33:19] spellbook: a hashed key assigned by the site
[05:33:30] sevenseacat: is it? did you verify that in the controller?
[05:33:43] djbkd: has joined #RubyOnRails
[05:34:03] djbkd: has joined #RubyOnRails
[05:34:33] spellbook: in the controller? i stepped through the code in the console
[05:34:58] sevenseacat: okay, and when you got to that line, was the key set correctly?
[05:36:18] sevenseacat: and was cast still nil?
[05:37:46] yardenbar: has joined #RubyOnRails
[05:38:25] sevenseacat: then I suggest stepping through the call to ForecastIO.forecast and seeing what is with the invalid response
[05:38:36] sevenseacat: why it is invalid
[05:39:52] User458764: has joined #RubyOnRails
[05:40:07] swap_a_b: has joined #RubyOnRails
[05:41:05] moei: has joined #RubyOnRails
[05:42:50] Niham: has joined #RubyOnRails
[05:43:14] rafaelfranca: has joined #RubyOnRails
[05:45:31] moeabdol: has joined #RubyOnRails
[05:51:36] aganov: has joined #RubyOnRails
[05:54:27] triptec: has joined #RubyOnRails
[05:57:54] spellbook: sevenseacat: i got it! thank you so much. it was my environment.
[05:58:16] _underscore_: has joined #RubyOnRails
[05:59:45] sandelius: has joined #RubyOnRails
[06:07:00] jtong: has joined #RubyOnRails
[06:11:08] Omen: has joined #RubyOnRails
[06:12:43] pawnbox: has joined #RubyOnRails
[06:13:40] lightt: has joined #RubyOnRails
[06:13:40] bob: has joined #RubyOnRails
[06:15:11] Guest94997: how does this work?
[06:16:41] justrohu: has joined #RubyOnRails
[06:17:56] sevenseacat: "this" meaning...?
[06:18:39] null__: I assume bob means IRC
[06:18:59] null__: Guest94997: it seems to be working just fine. you can type /nick <nick> to change your name
[06:19:08] Guest94997: I apologize, reading the rules now. Quite new to rails/programming in general.
[06:20:09] Dimik: has joined #RubyOnRails
[06:20:16] apotry: has joined #RubyOnRails
[06:20:43] patrick_star: has joined #RubyOnRails
[06:21:38] speakingcode: has joined #RubyOnRails
[06:23:05] yfeldblum: has joined #RubyOnRails
[06:23:32] emilkarl: has joined #RubyOnRails
[06:26:07] Niham: has joined #RubyOnRails
[06:30:20] adac: has joined #RubyOnRails
[06:30:38] agit0: has joined #RubyOnRails
[06:31:18] swap_a_b: has left #RubyOnRails: ()
[06:31:40] ur5us: has joined #RubyOnRails
[06:35:01] moeabdol: has joined #RubyOnRails
[06:36:40] conta: has joined #RubyOnRails
[06:38:54] ur5us: has joined #RubyOnRails
[06:41:23] AmiMoench: has joined #RubyOnRails
[06:42:54] nettoweb: has joined #RubyOnRails
[06:43:56] Hyuk: has joined #RubyOnRails
[06:44:24] roamingdog: has joined #RubyOnRails
[06:44:26] Oliphaunte: has joined #RubyOnRails
[06:44:35] dionysus69: has joined #RubyOnRails
[06:44:53] Axy: has joined #RubyOnRails
[06:45:01] AnoHito_: has joined #RubyOnRails
[06:45:01] yfeldblum: has joined #RubyOnRails
[06:45:34] Tempesta_: has joined #RubyOnRails
[06:45:45] enkristoffer: has joined #RubyOnRails
[06:46:24] Radar_: has joined #RubyOnRails
[06:47:38] nwkr: has joined #RubyOnRails
[06:48:33] Karpah: has joined #RubyOnRails
[06:49:09] The_Kingdutch: has joined #RubyOnRails
[06:49:13] Jenzo: has joined #RubyOnRails
[06:49:22] boshhead_: has joined #RubyOnRails
[06:49:43] PaulePan1er: has joined #RubyOnRails
[06:49:53] kanzure_: has joined #RubyOnRails
[06:50:09] kallisti6: has joined #RubyOnRails
[06:50:13] chrisarc1nd: has joined #RubyOnRails
[06:50:28] artto: has joined #RubyOnRails
[06:50:45] uxp_: has joined #RubyOnRails
[06:50:46] wmoxam_: has joined #RubyOnRails
[06:50:54] DefV_: has joined #RubyOnRails
[06:51:05] pontiki_: has joined #RubyOnRails
[06:51:14] Skelz0r: has joined #RubyOnRails
[06:53:37] Psy-Q_: has joined #RubyOnRails
[06:54:33] bodie__: has joined #RubyOnRails
[06:54:43] lord4163_: has joined #RubyOnRails
[06:55:08] jpterry_: has joined #RubyOnRails
[06:55:10] havenn: has joined #RubyOnRails
[06:55:10] havenn: has joined #RubyOnRails
[06:55:10] Ankhers_: has joined #RubyOnRails
[06:55:17] arBmind: has joined #RubyOnRails
[06:55:40] DanKnox_: has joined #RubyOnRails
[06:56:11] IcyDragon: has joined #RubyOnRails
[06:56:30] samuelkadolph1: has joined #RubyOnRails
[06:56:45] Talltree_: has joined #RubyOnRails
[06:56:46] AmiMoench: has joined #RubyOnRails
[06:57:25] RedDwarf: has joined #RubyOnRails
[06:59:22] jkwood_: has joined #RubyOnRails
[06:59:33] conta: has joined #RubyOnRails
[06:59:41] joevandy1: has joined #RubyOnRails
[07:01:09] Radar: has joined #RubyOnRails
[07:01:21] Radar: I restart my computer and Freenode goes down
[07:01:24] Radar: TIL: my computer is a Freenode IRC server
[07:02:10] Silex^^: has joined #RubyOnRails
[07:04:25] comrad: has joined #RubyOnRails
[07:04:56] ur5us: has joined #RubyOnRails
[07:05:01] apeiros: Radar: stop restarting your computer then!
[07:05:06] Radar: apeiros: neg
[07:06:03] Radar: I will determine when this computer is restarted and the manner in which it is restarted.
[07:06:21] Radar: pg isn't coming back up after a reboot. Well that's a shame.
[07:06:49] nettoweb: has joined #RubyOnRails
[07:07:18] mikecmpbll: has joined #RubyOnRails
[07:09:56] Pazician: has joined #RubyOnRails
[07:12:31] darutoko: has joined #RubyOnRails
[07:12:31] xall: has joined #RubyOnRails
[07:12:38] Macaveli: has joined #RubyOnRails
[07:14:08] futilegames: has joined #RubyOnRails
[07:14:15] arBmind: has joined #RubyOnRails
[07:14:39] emachnic: has joined #RubyOnRails
[07:14:46] Aherin: has joined #RubyOnRails
[07:15:25] neanderslob: has joined #RubyOnRails
[07:16:04] solars: has joined #RubyOnRails
[07:16:19] emilkarl: has joined #RubyOnRails
[07:17:57] roamingdog: has joined #RubyOnRails
[07:18:15] ensyde: has joined #RubyOnRails
[07:18:17] artto: has joined #RubyOnRails
[07:19:43] EXCHGR: has joined #RubyOnRails
[07:21:59] AntiSpamMeta: has joined #RubyOnRails
[07:30:32] pLaToOn: has joined #RubyOnRails
[07:31:41] Psy-Q: has joined #RubyOnRails
[07:32:25] pLaToOn: I need file upload for my app, what would you recommend? paperclip or carrierwave?
[07:33:23] Ropeney: carrierwave, if no further questions arise for why :D
[07:34:11] deur-: carrierwave includes several kitchen sinks, ie. it's very feature packed
[07:34:23] deur-: paperclip, as i've always understood, is more lightweight
[07:34:30] deur-: though i've never used the latter
[07:34:50] apotry: has joined #RubyOnRails
[07:35:55] gingray: has joined #RubyOnRails
[07:36:00] deur-: they both get the job done i'm sure
[07:36:37] ksmutthu: has joined #RubyOnRails
[07:39:10] harfangk: has joined #RubyOnRails
[07:39:39] artto: has joined #RubyOnRails
[07:39:49] OverSpeed301: has joined #RubyOnRails
[07:40:18] ksmutthu_: has joined #RubyOnRails
[07:41:01] conta: guys, so I have `validates :total_price, numericality: { greater_than_or_equal_to: Proc.new { |c| c.customer.minimal_order_price}}`. total_price is set via before_save, but it doesn't get called if I use save!
[07:41:10] conta: what am I doing wrong?
[07:42:09] universa1: conta: are you sure you can supply a block to greater_tahn_or_equal_to ?
[07:42:46] pLaToOn: I need a simple file upload for a rails api deur-
[07:42:51] pLaToOn: for documents, images
[07:42:52] conta: universa1: yeah, I am getting error from that validation when I use save!
[07:42:58] pLaToOn: no rails views, api only
[07:42:59] universa1: conta: whoa...
[07:43:09] universa1: conta: !code -- error, ...
[07:43:09] helpa: conta: 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.
[07:43:33] universa1: conta: we are no magicians, we can't magically know what happens on your computer...
[07:43:44] Ropeney: I dont think validations are called if you do it in before_save
[07:44:02] conta: gimme sec
[07:44:10] Ropeney: conta: http://guides.rubyonrails.org/active_record_callbacks.html#available-callbacks
[07:44:31] universa1: Ropeney: good point, worth checking the call order for callbacks@conta ;)
[07:44:46] deur-: pLaToOn: if you need multiple versions for those images, carrierwave probably will be better
[07:46:15] sevenseacat: validations are run before before_save callbacks
[07:46:20] OverSpeed301: Hello ! I have a specific page on my website that consumes more than 400Mb of RAM when the page is loaded for the 1st time :|
[07:46:31] Kedare: has joined #RubyOnRails
[07:46:47] universa1: cool, cool, cool
[07:47:01] OverSpeed301: This page loads a lot of javascript (+/- 10) but I think it's not the problem, 400Mb to load one page O.o
[07:47:22] universa1: OverSpeed301: 400mb on the server? on the client?
[07:47:42] antgel: has joined #RubyOnRails
[07:47:48] OverSpeed301: universa1 : on the server (sorry didn't explained it)
[07:47:50] conta: so Ropeney, validations run before before_save?
[07:48:15] universa1: OverSpeed301: so js is nerver evaluated... dev mode? prod mode?
[07:48:18] conta: I see, now the error makes sense
[07:48:21] pLaToOn: it seems like base64 encoding is easier with carrierwave
[07:49:15] OverSpeed301: universa1: same in dev and prod mode, maybe dev mode consumes more RAM but in dev mode it's around 400Mb maybe
[07:49:16] ngw: has joined #RubyOnRails
[07:49:43] universa1: OverSpeed301: so if it happens in prod mode, it got zero to do with js, because it is precompiled.
[07:49:51] universa1: OverSpeed301: !code
[07:49:51] helpa: OverSpeed301: 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.
[07:51:46] alfiemax: how can i set custom validation error messages? when i set message: "Custom message" the error message is shown as "Field Custom Message" when model.errors.full_messages is called
[07:51:58] alfiemax: i would like it to be just "Custom Message"
[07:52:05] universa1: alfiemax: shown where?
[07:52:46] alfiemax: universa1, when calling like this : model.errors.full_messages
[07:53:06] srinidhi: has joined #RubyOnRails
[07:53:12] Spami: has joined #RubyOnRails
[07:53:33] alfiemax: the full message is getting build as FieldName + message
[07:53:36] universa1: alfiemax: http://api.rubyonrails.org/classes/ActiveModel/Errors.html#method-i-full_message
[07:53:47] universa1: look at the source
[07:54:54] fox_mulder_cp: has joined #RubyOnRails
[07:55:35] alfiemax: ok, got it, the default format is: "%{attribute} %{message}"
[07:55:48] emachnic: has joined #RubyOnRails
[07:55:54] alfiemax: is it possible to cahnge that?
[07:56:58] lxsameer: has joined #RubyOnRails
[07:57:51] ksmutthu: has joined #RubyOnRails
[07:59:33] skroon: should the device secret key and device pepper, be outside of the repository? or isn't it too harmfull to have in the repo?
[08:00:23] roamingdog: alfiemax: second hit on google for 'rails customize full_messages': http://stackoverflow.com/questions/28985474/customise-activemodel-full-messages
[08:03:31] DTZUBDUB: has joined #RubyOnRails
[08:04:02] Charles_CV: has joined #RubyOnRails
[08:04:48] adre: has joined #RubyOnRails
[08:05:50] fermonkus: has joined #RubyOnRails
[08:05:57] jsrn: has joined #RubyOnRails
[08:06:40] Ergo: has joined #RubyOnRails
[08:08:36] jtong: has joined #RubyOnRails
[08:08:44] yfeldblum: has joined #RubyOnRails
[08:10:26] artto_: has joined #RubyOnRails
[08:10:44] OverSpeed301: universa1: here it is (http://pastebin.com/NWPDTsLH), the code is old and dirty, Assets Pipeline is desactivated ATM. I cleaned useless stuff like body or navbar which is only pure HTML
[08:11:35] mikecmpbll: has joined #RubyOnRails
[08:11:52] OverSpeed301: universa1: http://pastie.org/private/p1ftmhqlp5thf3m3qsfbvw :-)
[08:12:55] OverSpeed301: But if I activate assets pipeline & assets precompiling, it will use a lot of RAM on startup, and it will crash the Heroku server before serving any content
[08:13:29] universa1: then precompile locally?
[08:14:09] universa1: why are you loading jquery in the body, when it looks like you're using turbolinks...
[08:14:32] universa1: OverSpeed301: !assets
[08:14:32] helpa: OverSpeed301: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[08:14:51] OverSpeed301: To be honest, I don't really know... I think assets are loaded in RAM when a request needs it, because the first page always loads longer than all others.
[08:15:02] emilkarl: has joined #RubyOnRails
[08:15:21] universa1: OverSpeed301: well, it precompiles the assets on the first request.
[08:15:29] universa1: if you have not precompiled them
[08:16:26] universa1: and on heroku you have 15minutes to precompile stuff, i doubt that you run into that time limit.
[08:16:27] OverSpeed301: So when all these assets are fully loaded in RAM, the RAM usage begins to drop and all pages are OK
[08:17:06] OverSpeed301: Oh, really? Never seen that, when Heroku server is starting, I didn't see any log lines about precompiling
[08:17:11] universa1: OverSpeed301: https://devcenter.heroku.com/articles/rails-asset-pipeline
[08:17:32] User458764: has joined #RubyOnRails
[08:17:33] snowy: has joined #RubyOnRails
[08:17:59] sevenseacat: when using heroku you should precompile as part of the deploy
[08:18:16] pawnbox_: has joined #RubyOnRails
[08:27:10] arBmind: has joined #RubyOnRails
[08:32:39] Ergo^: has joined #RubyOnRails
[08:32:40] Oliphaunte: has joined #RubyOnRails
[08:35:39] dionysus69: has joined #RubyOnRails
[08:40:33] haaj: has joined #RubyOnRails
[08:42:04] alfiemax: roamingdog, yeah, i am aware of that. but doing that it would mean overriding the default format for all validation error messages
[08:42:15] alfiemax: that won't be good
[08:42:28] alfiemax: since only a few has custom error messages
[08:43:26] harfangk: has joined #RubyOnRails
[08:43:30] alfiemax: i was looking for something to override specific model fields
[08:44:26] mikecmpbll: has joined #RubyOnRails
[08:46:08] roamingdog: alfiemax: stick this at top of a model class? https://gist.github.com/chrislerum/539c2a512e4a83579298cfa89b53f277
[08:46:23] roamingdog: but it'll affect all fields for that model of course
[08:46:52] roamingdog: alfiemax: but you could limit it to certain attributes there i suppose
[08:48:01] roamingdog: alfiemax: ah sorry, not thinking, it gets loaded for all models :(
[08:49:47] alfiemax: found a very old gem that does this
[08:49:48] alfiemax: https://rubygems.org/gems/custom_error_message/versions/1.1.1
[08:50:03] Didac: has joined #RubyOnRails
[08:50:22] roamingdog: alfiemax: updated gist, might help https://gist.github.com/chrislerum/539c2a512e4a83579298cfa89b53f277
[08:51:30] kitsuneyo: has joined #RubyOnRails
[08:51:51] jenrzzz: has joined #RubyOnRails
[08:52:29] roamingdog: kitsuneyo: ohaiyogozaimas!
[08:53:13] kitsuneyo: おはよう roamingdog :)
[08:54:36] kitsuneyo: i'm using capybara for an integration test. i want to check if a page has a certain string of content, so i followed the readme and used page.has_content?('string'). but i guess this is wrong, since the test passes no matter what i substitute for 'string.' i'm just using the standard rails test, not rspec
[08:54:42] kitsuneyo: what is the right way to do it?
[08:55:22] roamingdog: kitsuneyo: maybe syntax? expect(page).to have_content 'string' ?
[08:55:39] kitsuneyo: i'll try that but i got the impression it's for rspec
[08:58:39] roamingdog: sorry, didn't notice you said not rspec
[09:02:01] kitsuneyo: i think it's assert_text('string')
[09:02:58] edwinvdgraaf: has joined #RubyOnRails
[09:03:56] edwinvdgraaf: has joined #RubyOnRails
[09:04:09] pawnbox: has joined #RubyOnRails
[09:04:38] kitsuneyo: yep, that works
[09:09:52] Markie: has joined #RubyOnRails
[09:12:18] artto: has joined #RubyOnRails
[09:13:15] blackhuey: has joined #RubyOnRails
[09:15:28] gingray: has joined #RubyOnRails
[09:18:10] artto_: has joined #RubyOnRails
[09:18:57] edwinvdg_: has joined #RubyOnRails
[09:20:17] artto: has joined #RubyOnRails
[09:22:02] alfiemax: has joined #RubyOnRails
[09:23:13] fox_mulder_cp: need help with refactor code - i have a some doubled code for get/post requests via api to docker amd powerdns daemons, and i need move this code from activejob task file into external script to include it
[09:23:18] fox_mulder_cp: where i can place it
[09:24:12] workmad3: has joined #RubyOnRails
[09:24:14] fox_mulder_cp: and touch it from this new script with url, method type, json and api key
[09:26:21] artto_: has joined #RubyOnRails
[09:27:07] Oliphaunte: has joined #RubyOnRails
[09:27:11] edwinvdgraaf: has joined #RubyOnRails
[09:27:52] fox_mulder_cp: app_root/lib or another dir?
[09:30:04] tvw: has joined #RubyOnRails
[09:31:26] marr: has joined #RubyOnRails
[09:32:33] mikecmpbll: has joined #RubyOnRails
[09:39:51] edwinvdg_: has joined #RubyOnRails
[09:48:03] tvw: has joined #RubyOnRails
[09:50:30] edwinvdgraaf: has joined #RubyOnRails
[09:54:08] oystersauce8: has joined #RubyOnRails
[09:56:00] mdw: has joined #RubyOnRails
[09:59:32] moeabdol: has joined #RubyOnRails
[10:09:04] SteenJobs: has joined #RubyOnRails
[10:10:07] jtong: has joined #RubyOnRails
[10:10:10] quazimodo: has joined #RubyOnRails
[10:10:15] artto: has joined #RubyOnRails
[10:14:09] haaj: has joined #RubyOnRails
[10:15:54] Tempesta: has joined #RubyOnRails
[10:19:47] k3rn31: has joined #RubyOnRails
[10:21:06] Niham: has joined #RubyOnRails
[10:21:16] Oliphaunte: has joined #RubyOnRails
[10:28:00] allcentury: has joined #RubyOnRails
[10:28:06] AimlessRAven: has joined #RubyOnRails
[10:28:33] hiddenloop: has left #RubyOnRails: ()
[10:30:18] AimlessRAven: https://gist.github.com/anonymous/4746d8695aab2512ad480448b4afad08
[10:30:24] AimlessRAven: someone knows why i have this error
[10:30:33] universa1: what is this error? what are you doing?
[10:30:53] universa1: don't just post gist links.
[10:31:26] universa1: AimlessRaven: !gist-usage
[10:31:26] helpa: AimlessRaven: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[10:31:52] fox_mulder_cp: AimlessRaven: http://stackoverflow.com/questions/28804532/undefined-local-variable-or-method-current-user-using-devise-rails-3-2
[10:32:07] andywww: has joined #RubyOnRails
[10:32:21] fox_mulder_cp: AimlessRaven: read devise gem doc properly
[10:32:22] srinidhi: has joined #RubyOnRails
[10:32:35] fox_mulder_cp: and instructions when install it
[10:32:47] emilkarl: has joined #RubyOnRails
[10:33:01] universa1: if he is using devise ;)
[10:33:37] Circuit8: has joined #RubyOnRails
[10:33:44] AimlessRAven: fox_mulder_cp: i dont use devise
[10:34:50] fox_mulder_cp: AimlessRaven: why u write your own bike'?
[10:35:08] universa1: there is nothing wrong with not using devise.
[10:35:23] universa1: AimlessRaven: if you're not using devise, you have to define your own current_user method.
[10:37:41] AimlessRAven: universa1: tnx
[10:38:22] DoubleMalt: has joined #RubyOnRails
[10:38:27] universa1: or adopt how the ability is created. you could also overwrite the current_ability method (iirc)
[10:39:55] fermonkus: has joined #RubyOnRails
[10:40:05] emilkarl_: has joined #RubyOnRails
[10:42:47] umdstu: has joined #RubyOnRails
[10:45:46] AimlessRAven: universa1: yeah i create method and things work
[10:45:57] AimlessRAven: but now i have another problem
[10:46:19] AimlessRAven: i push link = link_to "Remove", admin_admin_path(admin), :method => :delete, class: 'btn btn-danger btn-sm', confirm: 'Are you sure?'
[10:46:27] AimlessRAven: and this link search for show action .. why
[10:46:34] AimlessRAven: i use :method delete for m destroy action
[10:46:51] sebstrax: has joined #RubyOnRails
[10:46:54] rodfersou: has joined #RubyOnRails
[10:47:18] universa1: AimlessRaven: js disabled? look at the generated html...
[10:47:56] AzaToth: has joined #RubyOnRails
[10:48:14] roamingdog: has joined #RubyOnRails
[10:49:14] AimlessRAven: http://imgur.com/GJFo3sT
[10:49:18] AimlessRAven: here is my generate html button
[10:49:59] ferr1: has joined #RubyOnRails
[10:50:21] moei: has joined #RubyOnRails
[10:50:50] universa1: do you get the confirm popup?
[10:51:17] TheShaun: has joined #RubyOnRails
[10:51:17] universa1: then you broke your js...
[10:51:25] universa1: are you not loading the rails-ujs stuff?
[10:51:42] AimlessRAven: maybe yeah.. this is the problem
[10:51:58] AimlessRAven: if i install bootstrap and qjuery-rails
[10:52:02] AimlessRAven: is it fix this
[10:52:17] universa1: why did you drop the default one from rails?
[10:52:22] universa1: bootstrap has nothing to do with it.
[10:53:22] AimlessRAven: my boss comment js stuff in layout :D
[10:53:37] AimlessRAven: and all they i try to find solution :D
[10:55:18] boogeyman: has joined #RubyOnRails
[10:55:26] ferr1: https://gist.github.com/Fercell/e7f7437b631165d87e7ee1fb210e288d Why counter_cache uses the size method and it gives the negative value?
[10:56:55] jottr: has joined #RubyOnRails
[10:57:17] artto: has joined #RubyOnRails
[10:57:44] edwinvdg_: has joined #RubyOnRails
[10:58:03] ksmutthu: has joined #RubyOnRails
[11:00:11] GodFather: has joined #RubyOnRails
[11:00:40] ensyde: has joined #RubyOnRails
[11:04:17] mdw: has joined #RubyOnRails
[11:12:41] GorillaApe: has joined #RubyOnRails
[11:12:52] GorillaApe: I had a new record
[11:13:10] GorillaApe: and when set record.blah! it saved it
[11:13:16] GorillaApe: blah is enum
[11:13:29] Macaveli: has joined #RubyOnRails
[11:14:14] nettoweb: has joined #RubyOnRails
[11:14:25] jord-n: has joined #RubyOnRails
[11:15:32] Oliphaunte: has joined #RubyOnRails
[11:17:56] AlexJakeGreen: has joined #RubyOnRails
[11:18:14] bruce_lee: has joined #RubyOnRails
[11:20:25] jmignault: has joined #RubyOnRails
[11:20:39] mdw: has joined #RubyOnRails
[11:21:44] mdw: has joined #RubyOnRails
[11:21:55] jhass: is there a question?
[11:22:36] sevenseacat: apparently not
[11:23:00] ferr1: https://gist.github.com/Fercell/e7f7437b631165d87e7ee1fb210e288d Any ideas why size gives negative value?
[11:24:28] ensyde: has joined #RubyOnRails
[11:25:22] sandelius: has joined #RubyOnRails
[11:25:52] Hyuk: has joined #RubyOnRails
[11:26:57] mello: has joined #RubyOnRails
[11:29:56] john: has joined #RubyOnRails
[11:33:34] shinnya: has joined #RubyOnRails
[11:36:45] k3rn31: has joined #RubyOnRails
[11:38:06] AimlessRAven: can i reference model field to another model
[11:40:45] ensyde__: has joined #RubyOnRails
[11:42:56] ldnunes: has joined #RubyOnRails
[11:43:41] AimlessRAven: https://gist.github.com/anonymous/6eac2b43691744f044dd5656e2b84894
[11:43:50] AimlessRAven: what this mean author: reference to admin..
[11:44:48] AimlessRAven: universa1: do you know
[11:50:30] sevenseacat: AimlessRaven: http://guides.rubyonrails.org/getting_started.html#adding-a-second-model
[11:52:33] edwinvdgraaf: has joined #RubyOnRails
[11:53:10] King_Rex: has joined #RubyOnRails
[11:53:15] AimlessRAven: sevenseacat: how this field would be looks like on rails g mode Post
[11:53:27] AimlessRAven: author:admin:references ?
[11:53:30] sevenseacat: AimlessRaven: read a bit and try some stuff out.
[11:53:44] sevenseacat: AimlessRaven: you've been here long enough to not need to be spoonfed.
[11:57:22] mdw: has joined #RubyOnRails
[11:58:20] mdw: has joined #RubyOnRails
[11:58:55] User458764: has joined #RubyOnRails
[12:00:49] AimlessRAven: sevenseacat: i mean how only this field would be reference to admin
[12:01:04] yopp: has joined #RubyOnRails
[12:01:16] sevenseacat: AimlessRaven: if you have questions about the task you've been given, please ask the person that gave it to you.
[12:01:24] yopp: Hey. What the proper way to set parent model in nested resource?
[12:01:25] artto: has joined #RubyOnRails
[12:01:38] yopp: I mean style wise
[12:01:40] pawnbox: has joined #RubyOnRails
[12:01:44] sevenseacat: yopp: I would normally build the child model through the parent association
[12:01:54] AimlessRAven: sevenseacat: yeah but he is gone and cannot use cell phone right now ..
[12:02:06] yopp: sevenseacat, I mean in the nested controller
[12:02:08] yopp: == resource
[12:02:18] sevenseacat: yopp: funny, so do i
[12:02:30] yopp: resources :articles { resources :comments }
[12:02:40] sevenseacat: yes, i know what a nested resource is.
[12:02:44] yopp: say we have comments on a bunch of things, like :videos and stuff
[12:03:08] yopp: so inside the comments controller, I need to load parent resource
[12:03:21] yopp: right now I have ugly if params.key? ... branch
[12:03:23] sevenseacat: okay, loading and setting are two different things
[12:03:29] sevenseacat: use the association on the child
[12:03:43] sevenseacat: I assume it would be polymorphic
[12:05:30] yopp: Um, maybe I'm not clear on what I want
[12:05:32] yopp: I have this: https://yopp.in/TAM
[12:05:45] helpa: yopp: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[12:06:04] yopp: And I'd like to find the less ugly way to do the same, that is considered the community-approved style. that's it
[12:06:21] yopp: sevenseacat, what's wrong with screenshot?
[12:06:36] sevenseacat: why are you sharing code in a screenshot?
[12:06:43] sevenseacat: share it in a gist
[12:08:38] yopp: okay, you are bore, but here your gist: https://gist.github.com/y8/b25eafff406847ac279c9fa3ae552d07
[12:10:29] yopp: no problemo mate 🤗
[12:10:38] sevenseacat: now, what is the purpose of that code? why are you setting all kinds of collections, and why don't they match? ie. reader_id and user_id
[12:10:43] sevenseacat: *why don't the params match
[12:11:30] jtong: has joined #RubyOnRails
[12:11:53] sevenseacat: I find it unusual to have different instance variables set depending on input - it means you'll have to do all of the same conditionals in the view as well
[12:14:26] AntiSpamMeta: has joined #RubyOnRails
[12:14:26] yopp: Um, yeah, good catch about :reader_id
[12:14:31] voidDotClass: has joined #RubyOnRails
[12:16:46] yopp: anyway, even if it will be @parent = <model_query> it's still the same
[12:17:04] edwinvdgraaf: has joined #RubyOnRails
[12:17:05] yopp: (I've updated the gist btw)
[12:17:09] sevenseacat: so back to the first question. what's the purpose?
[12:17:26] snowy: has joined #RubyOnRails
[12:17:54] sergio_101: has joined #RubyOnRails
[12:18:32] yopp: sevenseacat, that's not important, so let's think we have code like this: https://gist.github.com/y8/b25eafff406847ac279c9fa3ae552d07
[12:19:03] diegoviola: has joined #RubyOnRails
[12:19:09] sevenseacat: sorry, I can't help you write better code unless i know what it's trying to achieve.
[12:19:21] sevenseacat: good luck and all!
[12:19:58] yopp: uh. whatever. thanks anyway
[12:22:51] Niham: has joined #RubyOnRails
[12:24:58] jeffrabovsky: has joined #RubyOnRails
[12:25:42] diegoviola: so I'm trying to add this custom field to devise, but it's not showing up... I tried calling resource.phone_numbers.build in the view itself but that just feels wrong... https://gist.github.com/diegoviola/6d2f8706163dd632376b6eebdafd2a52#file-new-html-erb-L25-L28
[12:26:14] diegoviola: not sure if there is a better way
[12:27:28] kitsuneyo: has joined #RubyOnRails
[12:28:37] kitsuneyo: if you have a select input that doesn't submit, but sets a param value that triggers a javascript action, what do you need to put in the form tag? does it even need a form tag?
[12:29:00] AimlessRAven: okey, how to make model field to use admin_id
[12:29:07] AimlessRAven: for example author: "admin_id"
[12:29:11] AimlessRAven: i n my schema
[12:30:57] adac: has joined #RubyOnRails
[12:32:08] agit0: has joined #RubyOnRails
[12:32:40] futilegames: has joined #RubyOnRails
[12:32:49] Detch: has joined #RubyOnRails
[12:35:16] voidDotClass: has joined #RubyOnRails
[12:35:27] diegoviola: should I add phone_numbers.build within a model and call that from the view?
[12:35:28] Gkj8899: has left #RubyOnRails: ("Be back later...")
[12:37:22] AimlessRAven: how to create model field reference to admin
[12:37:33] AimlessRAven: not all model only one filed
[12:39:48] jokke: i'm having some trouble with reform: i'm trying to build a fairly complex form (2 levels of associations, both one to many). I defined `collection :modules, form: ModuleForm` and in ModuleForm `collection :sensors, form: SensorForm`. I use f.fields_for :modules in my template but i get the error undefined method `persisted?' for #<Array:0x007f2e085bc858>
[12:40:21] pontiki_: kitsuneyo: there's probably a more rails-y way to do this, but in the situation you're talking about, i'd not bother with a form at all, and do it all client-side in JS
[12:40:51] kitsuneyo: pontiki_, maybe a good idea, but i'm using select_tag on its own
[12:40:55] peterppp: has joined #RubyOnRails
[12:40:58] pontiki_: that's fine
[12:41:06] kitsuneyo: still writing it, hopefully it works
[12:41:06] AimlessRAven: how to generate model field author who accept admin_id ..
[12:41:08] pontiki_: i meant handling the select on change action
[12:41:39] pontiki_: kitsuneyo: the select_tag in the view is just setting out the HTML at that point, which is a perfectly good thing
[12:41:52] kitsuneyo: ah, the change on select is handled in js yeah, i followed this guide to good effect: https://kernelgarden.wordpress.com/2014/02/26/dynamic-select-boxes-in-rails-4/
[12:42:08] kitsuneyo: thanks pontiki_
[12:42:57] AimlessRAven: universa1: here?
[12:44:01] pontiki_: kitsuneyo: that article seems a bit different than what you described, but if it helped you figure out what you needed ++
[12:44:01] pawnbox: has joined #RubyOnRails
[12:44:25] kitsuneyo: yeah it is, i used it for another form and now trying to adapt it for this
[12:45:07] universa1: AimlessRaven: !associations
[12:45:07] helpa: AimlessRaven: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[12:46:19] rbr: has joined #RubyOnRails
[12:46:33] AimlessRAven: universa1: i wanna add reference only to this field
[12:46:35] AimlessRAven: not to all model
[12:46:57] AimlessRAven: mm w8 ill show you
[12:47:24] AimlessRAven: universa1: https://gist.github.com/anonymous/f0ec1a22796268663a75f8b1d1d0cfac
[12:47:26] wd40s: has joined #RubyOnRails
[12:47:29] AimlessRAven: author: reference to admin
[12:47:32] AimlessRAven: how to create this field
[12:47:51] universa1: AimlessRaven: associations guide -> belongs_to association!
[12:47:56] AimlessRAven: my author field need to accept post author - admin
[12:48:18] universa1: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to - also this
[12:48:29] AimlessRAven: universa1: yeah but is this make all model reference to admin
[12:48:31] AimlessRAven: not only this field
[12:48:41] jokke: the weirdest part: if i _dont_ use form: ... but define the nested properties in a block it works...
[12:48:51] jokke: any ideas what might be going wrong?
[12:50:05] universa1: AimlessRaven: i don't know what you're trying to say. you might use the wrong words to express what you're trying to do, therefore i suggest you read the associations guide(!)
[12:50:24] peterppp: I have a model A that has_many B, and when the user edits an A object, then he sees a textarea in which all associated B's are listed, and can add/remove them as he pleases
[12:50:34] peterppp: is there an elegant way to accomplish this?
[12:50:49] sk0r: has joined #RubyOnRails
[12:50:59] universa1: peterppp: why do you list associated objects in a textarea?!
[12:51:56] peterppp: universa1, it's a dictionary app, and I want the user to provide a list of lemmata or key words for an entry
[12:52:00] AimlessRAven: universa1: i know association guide
[12:52:05] AimlessRAven: but the problem is i cannot understand
[12:52:10] AimlessRAven: https://gist.github.com/anonymous/f0ec1a22796268663a75f8b1d1d0cfac
[12:52:11] universa1: AimlessRaven: read it again!
[12:52:19] AimlessRAven: author: reference to admin
[12:52:22] AimlessRAven: what this mean
[12:52:30] universa1: AimlessRaven: how should we know? you wrote it?
[12:52:33] AimlessRAven: i understand only this field to accept admin_id
[12:52:39] universa1: AimlessRaven: reference -> belongs_to ...
[12:53:02] AimlessRAven: ok but when i create my post model.. what type need to add in my author field
[12:53:11] AimlessRAven: to accept admin_id
[12:53:14] universa1: AimlessRaven: read the docs and guide for belongs_to!
[12:53:25] pontiki_: AimlessRaven: it really sounds like you need to work through an entire tutorial
[12:53:37] pontiki_: rails tutorial is still free online
[12:54:04] pontiki_: even the getting started guide discusses references, belongs_to, and such
[12:54:20] universa1: okay... ...gone...
[12:54:27] pontiki_: if you really do not understand what "reference to admin" means, you do *not* understand associations
[12:54:46] pontiki_: so work through the tutorials until you do
[12:54:48] universa1: peterppp: so something like a "tag" list
[12:55:18] universa1: pontiki_: he's gone ;) i think he wanted someone to spoonfeed him, but he has been around long enough to figure it out on his own...
[12:55:20] fermonkus: has joined #RubyOnRails
[12:55:30] peterppp: peterppp, yeah
[12:55:36] peterppp: universa1, yeah..
[12:55:40] pontiki_: ah, so; i've got joins/parts/quits/nicks ignored
[12:56:53] artto: has joined #RubyOnRails
[13:00:42] Niham: has joined #RubyOnRails
[13:01:04] flopsec: has joined #RubyOnRails
[13:01:32] snowy: has joined #RubyOnRails
[13:03:31] Oliphaunte: has joined #RubyOnRails
[13:03:42] pawnbox: has joined #RubyOnRails
[13:04:17] zel: has joined #RubyOnRails
[13:05:21] User458764: has joined #RubyOnRails
[13:06:08] pLaToOn: has joined #RubyOnRails
[13:06:15] mixnblend: has joined #RubyOnRails
[13:07:33] mixnblend: has joined #RubyOnRails
[13:07:36] universa1: peterppp: ok, for this you should find plenty of examples online :-) select2/selectize(?) might be helpful in that case, tooo
[13:11:23] peterppp: universa1, thanks!
[13:12:39] thesubr00t: has joined #RubyOnRails
[13:14:02] thesubr00t: I have an app in production andI want to change all my tables primary_key to uuid. How can I achieve this without losing any data?
[13:14:55] jokke: no one? :/
[13:15:04] thesubr00t: I already enabled postgreSQL extension & set application generator to use uuid for future tables. How can I change the old tables?
[13:15:25] sevenseacat: thesubr00t: oh good luck
[13:15:27] aegis3121: has joined #RubyOnRails
[13:16:08] thesubr00t: sevenseacat, Is it that hard? :D
[13:16:39] sevenseacat: it's not something I've ever heard of people doing
[13:17:15] sergio_101: has joined #RubyOnRails
[13:17:25] thesubr00t: sevenseacat, It's easy to start using uuid for primary_keys, my only concern is about my old tables/data
[13:23:22] mosx: has joined #RubyOnRails
[13:24:41] emachnic: has joined #RubyOnRails
[13:26:13] wd40s: has joined #RubyOnRails
[13:26:37] pontiki_: thesubr00t: it's about as difficult as it sounds
[13:27:06] pontiki_: changing production data is frought with dangers, but it's not impossible
[13:28:07] thesubr00t: pontiki_, sure! I am looking for some best practices and advices
[13:28:21] pontiki_: your best approach is to set up a parallel system to make the conversions, and cut over when you're sure everything is working
[13:28:44] crameth: has joined #RubyOnRails
[13:28:59] pontiki_: the most difficult point is stopping changes in the current production system, making the final conversions, and then bringing up the new system
[13:29:12] pontiki_: in all of this, your conversions *must* be idempotent
[13:29:34] pontiki_: my best advice right now is to study this *deeply*
[13:29:46] pontiki_: take it off-line and work things out
[13:30:01] insanedreamer_: has joined #RubyOnRails
[13:30:06] thesubr00t: pontiki_, I'll do that. Thank you :)
[13:30:12] pontiki_: and be ready to roll *back* if anything blows up despite all your best efforts
[13:31:11] pontiki_: my stronger suggestion is to *not* use the uuid as the primary key in a mixed fashion like you've got now, but add it as a field and index
[13:31:46] pontiki_: and even at that, only use the uuid on publicly exposed elements
[13:33:13] pontiki_: i'm all for using uuid on an app starting from scratch, it's the change-over that's the squeemish stuff
[13:35:13] thesubr00t: pontiki_, True. I think that will be complicated because I am using jsonapi-resource to serve my API, and it insist that the ORM uses the uuid as default if I need to change the finder key
[13:36:10] thesubr00t: pontiki_, That's why I think to change the id type to uuid
[13:38:44] pontiki_: thesubr00t: i obviously don't know your situation, or who uses your app, or what the effects of your app breaking would be; that's all up to you. i will just say think about the wider consequences of choosing a particular technology that requires you to change production data schema
[13:39:02] pontiki_: i don't really have anything else to add
[13:39:28] Oliphaunte: has joined #RubyOnRails
[13:39:43] thesubr00t: pontiki_, Thank you for your suggestions, they are helpful :)
[13:39:58] pontiki_: best of, thesubr00t
[13:40:52] artto: has joined #RubyOnRails
[13:40:52] User458764: has joined #RubyOnRails
[13:42:02] allcentury: has joined #RubyOnRails
[13:43:40] alexandernst: what is myarr.try('[]', 'foobar') doing?
[13:44:03] mikecmpb_: has joined #RubyOnRails
[13:44:40] jxs_: has joined #RubyOnRails
[13:44:46] edwinvdgraaf: has joined #RubyOnRails
[13:45:44] harfangk: has joined #RubyOnRails
[13:46:07] dblessing: has joined #RubyOnRails
[13:46:32] peterppp: should I add an index to a join table (for habtm)?
[13:47:53] macsteps: has joined #RubyOnRails
[13:47:53] eljimmy: has joined #RubyOnRails
[13:51:36] terrabl: has joined #RubyOnRails
[13:51:42] _underscore_: peterppp: You should index both the _ids in the habtm
[13:52:07] _underscore_: add_index :tables, [:tablea_id, :tableb_id]
[13:52:10] _underscore_: something like that
[13:52:17] terrabl: Hello, So I have a long list of checkboxes and would like to make it so the checkboxes are stored in a JSON array as objects? Is there a way to do this?
[13:52:20] peterppp: ah, not individually though?
[13:52:36] terrabl: At the moment I am storing them as comma seperated strings.
[13:52:55] _underscore_: If its MySQL it can only use one index to speed up the query on that table. So both items need to be in that single index.
[13:53:44] _underscore_: (It took me more years than I care to admit and a really really really slow DB to learn that bit)
[13:54:02] diegoviola: has joined #RubyOnRails
[13:55:02] alfiemax: has joined #RubyOnRails
[13:58:23] peterppp: terrabl, what do you want to do with the JSON afterwards?
[13:58:39] insanedreamer: has joined #RubyOnRails
[13:58:52] terrabl: I would like to send the JSON off to an API afterwards
[13:58:59] _underscore_: Now I have a question regarding the habtm. Does the AR query always look for both id's? (Will a single index with both id's work) Or is it possible to that AR will query using just one of the ids?
[13:59:09] terrabl: And then that API will store the rails form JSON in its own database
[14:00:30] jmignault: has joined #RubyOnRails
[14:00:39] peterppp: so is it like this: the user fills out the form with the checkboxes, it's sent to the server, stored in the db, and at some point a request comes in and JSON is returned?
[14:02:43] terrabl: Honestly I really just care about the JSON that is related to the form that the user filled out
[14:02:57] braincrash: has joined #RubyOnRails
[14:03:22] peterppp: is the JSON generated by the client or the server?
[14:03:57] _underscore_: _underscore_ to answer your own question, a habtm using though does use both ids: SELECT `As`.* FROM `As` INNER JOIN `As_Bbs` ON `As`.`id` = `As_Bs`.`A_id` WHERE `As_Bs`.`B_id` = 1
[14:04:54] k3rn31: has joined #RubyOnRails
[14:05:00] terrabl: I think the JSON would be created by the client when they hit submit with the values being the info they put in the text boxes and such
[14:05:16] peterppp: so it's got nothing to do with rails?
[14:05:51] terrabl: Not really, just using rails as a front end atm
[14:06:06] f3ttX]: has joined #RubyOnRails
[14:10:03] yellow5: has joined #RubyOnRails
[14:10:13] diegoviola: has joined #RubyOnRails
[14:12:32] adac: has joined #RubyOnRails
[14:12:44] rafaelfranca: has joined #RubyOnRails
[14:13:08] jtong: has joined #RubyOnRails
[14:13:37] User458764: has joined #RubyOnRails
[14:13:54] brazenbraden: has joined #RubyOnRails
[14:15:05] brazenbraden: hey folks. little question here, wondering how to pass a block to a method. (i know this is a common thing but i'm not fully getting it). I have an example of what i would like to do here: https://gist.github.com/brazenbraden/d88cfb6c78c48c88a8590e55c9a1ae64
[14:15:13] JamieD: has joined #RubyOnRails
[14:16:29] fryguy: BrazenBraden: map is already a function that takes a block
[14:16:51] brazenbraden: yea i know, but i would like to pass the whole thing to another function
[14:18:04] fryguy: what whole thing
[14:18:36] pawnbox: has joined #RubyOnRails
[14:18:48] brazenbraden: the map call inside the all function. so, when i call all(), it will in turn call the return_stuff function, passing in the contents of the all function
[14:19:09] braincrash: has joined #RubyOnRails
[14:19:31] fryguy: that's probably possible to do, but it will be an infinite loop, so I don't think that's what you want to do
[14:19:32] udiudi: has joined #RubyOnRails
[14:20:12] brazenbraden: let me update the gist with what i mean. one sec
[14:21:18] brazenbraden: updated... that sorta concept.
[14:21:40] fryguy: BrazenBraden: ok, map returns an array, not a block
[14:21:42] Oliphaunte: has joined #RubyOnRails
[14:22:09] brazenbraden: yea, so in this case, what would end up being returned by return_something() would be that array
[14:22:39] fryguy: ok, and where is the block coming from
[14:23:21] brazenbraden: let me add an extra example. one sec
[14:23:38] snowy: has joined #RubyOnRails
[14:24:26] JamieD: has joined #RubyOnRails
[14:26:11] brazenbraden: ok, does that sorta make more sense?
[14:26:21] Oliphaunte: has joined #RubyOnRails
[14:27:35] fryguy: BrazenBraden: nope
[14:27:49] fryguy: maybe make a real example or something
[14:28:51] brazenbraden: ive added the actual repository class.
[14:29:35] rubyonrails972: has joined #RubyOnRails
[14:30:03] fryguy: ok, and what exactly do you want to do
[14:31:42] brazenbraden: some methods need to work with the @@records but after they done their work, the @@records must be set to nil. Now, I can do that in each method that needs that (for example, all(), first(), last() etc) but wouuld be nice to extract that out and just pass along the work that needs to be done.
[14:33:04] edwinvdgraaf: has joined #RubyOnRails
[14:34:00] edwinvdg_: has joined #RubyOnRails
[14:34:16] snowy: has joined #RubyOnRails
[14:34:57] flashpoint9: has joined #RubyOnRails
[14:35:42] brazenbraden: ive updated my base repo class with what i would need to do to have it work
[14:36:31] adavia: has joined #RubyOnRails
[14:37:16] sypheren: has joined #RubyOnRails
[14:43:52] rubyonrails743: has joined #RubyOnRails
[14:43:55] brazenbraden: has joined #RubyOnRails
[14:43:56] rubyonrails743: https://gist.github.com/anonymous/2a0963ee66673ba7803bfa9a56c2859c
[14:44:01] rubyonrails743: can someone take a look?
[14:44:04] brazenbraden: back.. internet died
[14:44:15] brazenbraden: did i miss anything?
[14:44:40] pawnbox: has joined #RubyOnRails
[14:45:22] universa1: rubyonrails743: i looked at it, it is a link to gist.github.com.
[14:46:28] rubyonrails743: yep i listed all the codes there in case you might wanna take a look
[14:47:08] pawnbox: has joined #RubyOnRails
[14:47:09] universa1: rubyonrails743: describe your problem in plain english words in the channel.
[14:47:45] universa1: rubyonrails743: !gist-usage
[14:47:45] helpa: rubyonrails743: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[14:48:47] rubyonrails743: assuming you've seen the code, the problem is that every time I click on "glyphicon-remove" it redirects me to the "show" method in CommentsController instead of deleting the comment
[14:49:18] universa1: rubyonrails743: so look at the controller, your rails log and see what happens.
[14:50:49] rubyonrails743: yep i did look at the controller but i can't figure out what the problem is
[14:50:52] rubyonrails743: https://gist.github.com/anonymous/0c2a173749822077d1992556c43cde1b
[14:50:57] rubyonrails743: here's the comments controller
[14:52:12] rubyonrails743: and sorry, i'm new here. wasn't aware of the gist markdown, but i'll keep that in mind for future posts!
[14:52:16] universa1: https://gist.github.com/anonymous/0c2a173749822077d1992556c43cde1b#file-comments_controller-rb-L6
[14:53:07] universa1: rubyonrails743: so what is in the log if you click on the delete link?
[14:54:28] JakFrist: has joined #RubyOnRails
[14:54:56] JakFrist: has left #RubyOnRails: ()
[14:55:12] rubyonrails743: yes, redirect to root_path <-- that's what i'm wanting it to do. but instead it keeps redirecting to show
[14:55:18] rubyonrails743: ehrm.... how do i see the log?
[15:00:05] pontiki_: rubyonrails743: look at the folders in your application
[15:00:56] prithaj: has joined #RubyOnRails
[15:01:05] tfitts: has joined #RubyOnRails
[15:01:52] pawnbox: has joined #RubyOnRails
[15:02:00] rubyonrails743: @universal here's the log -- https://gist.github.com/anonymous/50005783a6ec3bb97e6e62ce38bcf424
[15:06:32] aegis3121: has joined #RubyOnRails
[15:06:41] jamo: has joined #RubyOnRails
[15:07:58] disgrntld: has joined #RubyOnRails
[15:09:28] GodFather: has joined #RubyOnRails
[15:09:29] soahccc: Hey guys, I need a sanity check... "requires Ruby version ~> 2.1" should work with 2.3 right? its up to 2.9 or am I mistaken?
[15:09:49] kaspergr1bbe: has joined #RubyOnRails
[15:10:37] diegoaguilar: has joined #RubyOnRails
[15:10:42] tbuehlmann: that's >= 2.1 and < 3.0, so: yes, 2.3 should work
[15:10:43] Plas: has joined #RubyOnRails
[15:10:45] mayamai: has joined #RubyOnRails
[15:11:01] FastJack: has joined #RubyOnRails
[15:11:04] thesubr00t: has joined #RubyOnRails
[15:11:15] Junaos: has joined #RubyOnRails
[15:11:32] yopp: has joined #RubyOnRails
[15:11:45] KnownSy0: has joined #RubyOnRails
[15:12:10] flopsec: has joined #RubyOnRails
[15:12:18] agent_white: has joined #RubyOnRails
[15:12:25] soahccc: tbuehlmann: hmm I think it's trolling me :( https://gist.github.com/2called-chaos/5a4d4d24c9e1dcc51825ab68c59b5453
[15:12:56] emachnic: has joined #RubyOnRails
[15:13:17] AntiSpamMeta: has joined #RubyOnRails
[15:13:56] soahccc: tbuehlmann: I mean after the manual install bundler goes through but that was odd
[15:14:53] peterppp: with shallow nested resources the form generated by the scaffolder no longer works, does anyone know how to deal with this?
[15:15:27] darkxploit: has joined #RubyOnRails
[15:16:32] mixnblend: has joined #RubyOnRails
[15:17:10] artto: has joined #RubyOnRails
[15:19:10] Leepoff: has joined #RubyOnRails
[15:19:14] diegoaguilar: has joined #RubyOnRails
[15:19:22] rafaelfranca: has joined #RubyOnRails
[15:19:23] rafaelfranca: has joined #RubyOnRails
[15:19:51] roamingdog: has joined #RubyOnRails
[15:24:08] flashpoint9: has joined #RubyOnRails
[15:24:18] universa1: peterppp: change the code? ;)
[15:24:19] mixnblend: has joined #RubyOnRails
[15:24:47] peterppp: universa1, I changed it and it works, awesome
[15:27:01] JulienITARD: has joined #RubyOnRails
[15:28:25] siaw23: has joined #RubyOnRails
[15:28:43] siaw23: i’ve been stuck on this for 2 seemingly simple thing. any help? http://stackoverflow.com/questions/37931514/shoulda-matchers-not-recognized-by-rspec
[15:29:09] ftj: has joined #RubyOnRails
[15:29:41] nettoweb: has joined #RubyOnRails
[15:30:54] universa1: siaw23: https://github.com/thoughtbot/shoulda-matchers#rspec -- do you have this somewhere?!
[15:31:17] siaw23: yes i have the should-matchers gem
[15:31:25] siaw23: and the config in my rails_helper
[15:31:31] universa1: siaw23: !gist
[15:31:31] helpa: siaw23: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:31:42] universa1: your stackoverflow does not have it!
[15:31:45] mib_0ye: has joined #RubyOnRails
[15:33:41] zave: has joined #RubyOnRails
[15:33:56] siaw23: universa1: this is how everything looks at my end: https://gist.github.com/siaw23/b1392078ab35728a3d636adae3547651
[15:35:02] nettoweb: has joined #RubyOnRails
[15:35:14] universa1: siaw23: spec + error trace!
[15:36:10] arBmind: has joined #RubyOnRails
[15:37:30] kitsuneyo: has joined #RubyOnRails
[15:38:07] siaw23: universa1: yeap just a sec
[15:38:32] weckl: has joined #RubyOnRails
[15:39:43] emachnic: has joined #RubyOnRails
[15:40:11] adre: has joined #RubyOnRails
[15:40:51] Leepoff: has joined #RubyOnRails
[15:42:22] polishdub: has joined #RubyOnRails
[15:45:33] jetpackjoe: has joined #RubyOnRails
[15:47:36] triptec: has joined #RubyOnRails
[15:48:11] VeryBewitching: has joined #RubyOnRails
[15:48:33] adre: has joined #RubyOnRails
[15:49:23] roamingdog: has joined #RubyOnRails
[15:52:20] macsteps: has joined #RubyOnRails
[15:54:14] bklane: has joined #RubyOnRails
[15:54:22] davidw: has joined #RubyOnRails
[15:55:17] siaw23: universa1: i update the gist: https://gist.github.com/siaw23/b1392078ab35728a3d636adae3547651
[15:55:22] siaw23: test takes some time
[15:57:49] cleopatra: has joined #RubyOnRails
[16:01:05] fmcgeough: has joined #RubyOnRails
[16:02:26] zeknox: what gem are you guys leveraging for client side validations? Something that looks at model validations and translates to client side would be great, integration with bootstrap, even better
[16:05:18] snowy: has joined #RubyOnRails
[16:07:38] universa1: siaw23: reduce your problem side. run only a single model spec, and don't load the examples from a shared group
[16:07:45] universa1: zeknox: did you try google? ;)
[16:09:02] zeknox: universa1: sure, i found a number of gems, just wanted to get real world feedback from some experts here
[16:09:51] universa1: zeknox: well, since the requirements are mostly different for each case, it is hard to give general advice... ...therefore we usually not do that ;)
[16:10:14] zeknox: i gave the requirements in my initial inquiry
[16:13:57] snowy: has joined #RubyOnRails
[16:14:06] [Butch]: has joined #RubyOnRails
[16:15:46] k3rn31: has joined #RubyOnRails
[16:16:34] harfangk: has joined #RubyOnRails
[16:16:55] mixnblend: has joined #RubyOnRails
[16:17:48] siaw23: universa1: i believe this is how to run a single spec “rspec spec/models/dmca_spec.rb” but it starts running ALL specs
[16:21:32] universa1: zeknox: o0.
[16:25:17] becomexist: has joined #RubyOnRails
[16:28:56] quazimodo: has joined #RubyOnRails
[16:31:24] adam|: has joined #RubyOnRails
[16:32:13] norc: has joined #RubyOnRails
[16:32:50] roamingdog: has joined #RubyOnRails
[16:33:25] Elinos: has joined #RubyOnRails
[16:33:48] arBmind: has joined #RubyOnRails
[16:36:20] dionysus69: has joined #RubyOnRails
[16:37:26] ksmutthu: has joined #RubyOnRails
[16:39:14] moeabdol: has joined #RubyOnRails
[16:40:37] xall: has joined #RubyOnRails
[16:40:50] dionysus69: has joined #RubyOnRails
[16:41:24] Cache_Money: has joined #RubyOnRails
[16:44:08] Leepoff: has joined #RubyOnRails
[16:45:37] manfrin: has joined #RubyOnRails
[16:46:24] oystersauce8: has joined #RubyOnRails
[16:47:19] cnk: has joined #RubyOnRails
[16:50:36] banister: has joined #RubyOnRails
[16:53:55] User458764: has joined #RubyOnRails
[16:54:17] SteenJobs: has joined #RubyOnRails
[16:54:58] safetypin: has joined #RubyOnRails
[17:02:12] xpl0iter: has joined #RubyOnRails
[17:02:50] macsteps: has joined #RubyOnRails
[17:03:00] roamingdog: has joined #RubyOnRails
[17:03:14] yellow5: has joined #RubyOnRails
[17:05:07] alfiemax: has joined #RubyOnRails
[17:05:09] aegis3121: has joined #RubyOnRails
[17:05:18] centrx: has joined #RubyOnRails
[17:05:30] xpl0iter: Hi, I am trying to add payment gateway to my application. So the button has js associated with it. I have to update the js to include the amount in it. The problem is I have slider which determins the amount. So how do I go on about this?
[17:05:58] alfiemax: xpl0iter, some more js
[17:06:13] emachnic: has joined #RubyOnRails
[17:07:40] joesavage: has joined #RubyOnRails
[17:07:49] zmd: has joined #RubyOnRails
[17:09:04] oystersauce8: has joined #RubyOnRails
[17:10:52] jowiar: has joined #RubyOnRails
[17:11:39] whathappens: has joined #RubyOnRails
[17:11:50] zmd: has joined #RubyOnRails
[17:11:53] xpl0iter: alfiemax, sorry, what?
[17:12:03] Aherin: has joined #RubyOnRails
[17:12:08] dmz: has joined #RubyOnRails
[17:12:18] xpl0iter: Should I be sending the js from server using Ajax?
[17:12:19] JakFrist: has joined #RubyOnRails
[17:13:27] joesavage: Is there any way to access an asset path from inside an initializer? I was previously using "ActiveSupport.on_load(:after_initialize) do ... ActionController::Base.helpers.asset_path", but this no longer appears to work in the latest version of Rails (I just get the path without the hash back)
[17:13:40] poerror: has joined #RubyOnRails
[17:13:54] adam|: joesavage: use case?
[17:14:52] SteenJobs: has joined #RubyOnRails
[17:15:00] adam12: xpl0iter: Before submitting, use JS to get the value that the slider is currently set to.
[17:15:53] poerror: Hi guys, how can I expose method from engine to app?
[17:15:58] cleopatras: has joined #RubyOnRails
[17:16:22] joesavage: adam|: I have this big hash map constant that I need to access in various places throughout my application which links particular strings to related asset paths. Now that I think about it though, I could probably just store the raw string in the hash map and then call asset_path when I need it
[17:16:56] Oliphaunte: has joined #RubyOnRails
[17:16:57] Leepoff: has joined #RubyOnRails
[17:17:50] adam12: joesavage: That would likely be best. I don't think you need to pre-generate it.
[17:19:39] diegoaguilar: has joined #RubyOnRails
[17:19:40] d5sx43: has joined #RubyOnRails
[17:19:54] pLaToOn: has joined #RubyOnRails
[17:20:40] Leepoff: has joined #RubyOnRails
[17:21:03] FCser: has joined #RubyOnRails
[17:21:21] emachnic: has joined #RubyOnRails
[17:21:51] euphoria: has left #RubyOnRails: ()
[17:24:12] euphoriaa: has joined #RubyOnRails
[17:25:23] euphoria-: has joined #RubyOnRails
[17:25:48] jmignault: has joined #RubyOnRails
[17:26:14] djbkd: has joined #RubyOnRails
[17:27:35] safetypin: has joined #RubyOnRails
[17:28:12] dionysus69: I have admin panel exposed, I am using devise. Can I ban IP after lets say 50 trials in order to avoid brute force attack? does devise have such a functionality?
[17:30:25] zel: has joined #RubyOnRails
[17:33:06] hahuang65: has joined #RubyOnRails
[17:33:10] jtong: has joined #RubyOnRails
[17:33:19] Talltree_: does someone have experience deploying rails 5.0rc1 with capistrano?
[17:33:35] dionysus69: yep minimalist deploy though
[17:33:41] Talltree_: it seems to fail running the bundler commands really often...
[17:33:57] dionysus69: ye mine fails to run bundler too
[17:34:03] dionysus69: I dont know if its because of rails 5
[17:34:10] dionysus69: same happens on rails 4 tbh
[17:34:11] Talltree_: can i skip it somehow?
[17:34:23] dionysus69: dunno mine skips it by itself
[17:34:23] Talltree_: i ran the command manualy, and it works fine
[17:34:43] JakFrist: has joined #RubyOnRails
[17:34:44] dionysus69: paste your gemfile with capistrano lines
[17:35:45] Talltree_: which files to you mean?
[17:35:47] Talltree_: just the gemfile?
[17:37:36] dionysus69: ye start with gemfile
[17:38:07] dionysus69: ok just checked mine. I have this in my gemfile but mostly it doesnt run gem 'capistrano-bundler'
[17:38:29] dionysus69: if yours gets an error, just remove the gem 'capistrano-bundler' from gemfile
[17:38:39] dionysus69: you would still have to do bundle manually though
[17:39:13] dionysus69: never bothered to fix it so can't help with that
[17:39:30] Talltree_: still runs bundler install
[17:40:16] xpl0iter: Hi guys, is there anyway I can render a partial based on an ajax post reply?
[17:40:51] flopsec: has joined #RubyOnRails
[17:41:01] xpl0iter: So I am posting a value using ajax and then does some ops in the db. Now if it replies, I have to render a partial. Can that be done?
[17:42:43] poerror: has joined #RubyOnRails
[17:43:08] veloutin: xpl0iter: can't you just return the rendered partial in the ajax response?
[17:43:25] d0nn1e: has joined #RubyOnRails
[17:44:03] oystersauce8: has joined #RubyOnRails
[17:44:04] User458764: has joined #RubyOnRails
[17:45:05] cnk: xpl0iter: what veloutin said
[17:45:09] Talltree_: dionysus69, it still runs the bundler install command Oo
[17:45:24] Dimik: has joined #RubyOnRails
[17:45:28] cnk: you can't render a rails partial in the JS layer - which is where you are after the AJAX reply happens
[17:45:43] cnk: you need to render server side, and then send the html in the AJAX response
[17:45:53] cnk: assuming you want to reuse your parital
[17:47:12] jowiar: has joined #RubyOnRails
[17:51:14] emachnic: has joined #RubyOnRails
[17:51:26] Cervajz: has joined #RubyOnRails
[17:54:04] dionysus69: Talltree_: ok then let it fail, just do the bundle manually, or you mean other stuff fail as well. I think my capistrano setup doesnt run db:migrate either
[17:54:58] dcunit3d: has joined #RubyOnRails
[17:55:34] macsteps: has joined #RubyOnRails
[17:55:43] Talltree_: the bundle doesnt fail manualy
[17:55:46] Talltree_: i looked at the log
[17:56:00] Talltree_: and it works perfectly fine if i run in on the server dionysus69
[17:56:16] Talltree_: as soon as i run cap deploy production it fails with
[17:56:20] dcunit3d: hey i've got a quick CSS question with Jekyll (i know, it's not Rails) https://imgur.com/Dpwir3h
[17:56:27] dcunit3d: description is in a gist: https://gist.github.com/dcunited001/3f065ffbe008ddc6e340152edc7923c1
[17:56:32] dcunit3d: basically, i want the h4 text within <p><h4/><img/></p> to left justify with the image
[17:58:36] Talltree_: dionysus69,
[17:58:36] Cervajz: has joined #RubyOnRails
[17:58:37] Talltree_: http://pastie.org/10886819
[17:58:42] Leepoff: has joined #RubyOnRails
[17:58:52] dcunit3d: nvm i think i can set the <h4> margins to inherit the sibling <img> margins
[17:59:38] triptec: has joined #RubyOnRails
[17:59:50] Talltree_: https://i.imgur.com/RaBYP59.png
[18:00:05] jetpackjoe: has joined #RubyOnRails
[18:01:10] yardenbar: has joined #RubyOnRails
[18:02:29] kitsuneyo: has joined #RubyOnRails
[18:03:44] roamingdog: has joined #RubyOnRails
[18:03:46] dionysus69: so did you install that gem manually?
[18:03:54] dionysus69: maybe that was the problem from the beginning
[18:04:27] Talltree_: why whould that be the problem
[18:04:30] Talltree_: that doesnt make sense
[18:04:42] dionysus69: did you install the gem though? manually?
[18:04:46] Elinos: has joined #RubyOnRails
[18:05:01] dionysus69: those kind of errors are possible even in development mode
[18:05:16] Talltree_: yes, and also ran the original command in the cache of cop
[18:05:23] Talltree_: cd /home/deploy/apps/d2ladder/releases/20160622195721 && /usr/bin/env bundle install --path /home/deploy/apps/d2ladder/shared/bundle --without development test --deployment --quiet
[18:05:27] Talltree_: doesnt fail on the server
[18:05:33] rubyonrails887: has joined #RubyOnRails
[18:05:37] Talltree_: but fails if i use cop
[18:05:43] moei: has joined #RubyOnRails
[18:06:08] dionysus69: hmm dunno, try googling, I am not familiar with capistrano that much
[18:06:28] dionysus69: maybe someone who knows better can help you if you really want bundler to work with cap
[18:06:28] Talltree_: googling turns up nothing, i wouldnt speak here if google turned it up
[18:06:54] rubyonrails887: so i have a navbar placed in the layout file so that it appears on all pages. but now i want it appear in all pages EXCEPT /users/sign_in and /users/sign_up. how would i do that?
[18:07:25] Talltree_: rubyonrails887, you could use an if...
[18:07:38] triptec: has joined #RubyOnRails
[18:07:40] Talltree_: if 'current path = X then Y else Z
[18:07:42] desnudopenguino: I have "validates_inclusion_of :rating, in: 1..5, message: "Rating not between 1-5", but it throws the validation message even when it is correct
[18:07:49] Talltree_: not actual ruby syntax tho ;)
[18:08:32] Talltree_: rubyonrails887, http://apidock.com/rails/ActionView/Helpers/UrlHelper/current_page%3F
[18:11:12] dionysus69: has joined #RubyOnRails
[18:12:01] kitsuneyo: has joined #RubyOnRails
[18:12:15] qejk: has joined #RubyOnRails
[18:14:43] djbkd: has joined #RubyOnRails
[18:16:20] mordof: has joined #RubyOnRails
[18:16:29] jm3: has joined #RubyOnRails
[18:17:34] mordof: I have a name field in a model.. is there an active record thing where I can ensure that it gets a .strip (remove left and right whitespace) before saving to the database? or should i use a before_save callback for that?
[18:17:49] mordof: hmmm or maybe a custom setter...
[18:18:19] Leepoff: has joined #RubyOnRails
[18:19:12] dstarh: has joined #RubyOnRails
[18:19:59] roamingdog: has joined #RubyOnRails
[18:20:22] dcunit3d: mordof you can use one of the active record callbacks. or yes, a custom setter would work too
[18:21:02] dcunit3d: that should happen first on the client side, but the server can also run strip
[18:21:25] Elinos: has joined #RubyOnRails
[18:21:32] mordof: dcunit3d: for sure - we've got multiple points where we can make stuff with though so I'm trying to make it model-heavy in certain scenarios
[18:21:57] mordof: hmmm custom setter is probably best bet just so it happens right away.
[18:22:11] mordof: dcunit3d: thanks
[18:23:14] dcunit3d: mordof i conuc r
[18:23:37] Talltree_: i think that may be a problem with gemsets i'm having
[18:24:01] Talltree_: how can i reset all gems i have locally and on the server? like complete enviroment clean
[18:24:17] dcunit3d: i think emoticons for the ratings would be weird
[18:24:22] dcunit3d: woops wrong chan
[18:25:45] mostlybadfly: has joined #RubyOnRails
[18:26:02] desnudopenguino: is there something with validates_inclusion_of validation for numbers coming from radio buttons that causes an issue?
[18:26:10] definiv: has joined #RubyOnRails
[18:31:16] desnudopenguino: I've tried "validates_inclusion_of :rating, in: 1..5" with no luck
[18:31:21] sandelius: has joined #RubyOnRails
[18:31:57] mordof: desnudopenguino: depending on what format you're sending it to the rails server, it's possible it might be strings
[18:32:03] mordof: in which case the integer range wouldn't match
[18:32:36] adam12: It should match if rating is an integer field in DB
[18:32:41] adam12: I believe it's typecast before validation.
[18:33:12] mordof: good to know :)
[18:33:14] arup_r: has joined #RubyOnRails
[18:34:11] adam12: desnudopenguino: What kind of field is rating in the database? and is your model backed by ActiveRecord::Base?
[18:35:42] desnudopenguino: rating is an int(11) in th database and the model is "class PhotoRating < ActiveRecord::Base" so I would assume it is backed by it
[18:36:11] desnudopenguino: I'm using radio buttons instead of a number input field
[18:36:28] desnudopenguino: if that makes a difference
[18:36:32] gingray: has joined #RubyOnRails
[18:36:44] safetypin: has joined #RubyOnRails
[18:37:16] adam12: Can you wrap 1..5 in brackets?
[18:37:16] mordof: the only difference in how it gets sent would be your content type (either custom in the form tag) or if the form was submitted with an ajax call. but as adam12 also pointed out, even if it's a string it shouldn't matter
[18:37:25] |2321: has joined #RubyOnRails
[18:37:34] adam12: It likely won't have any effect but just curious.
[18:37:38] xaviergmail: has joined #RubyOnRails
[18:38:51] jowiar: has joined #RubyOnRails
[18:39:11] desnudopenguino: same thing is happening
[18:39:14] oystersauce8: has joined #RubyOnRails
[18:39:48] yfeldblum: has joined #RubyOnRails
[18:39:52] adam12: Is the validation not erroring out?
[18:40:13] desnudopenguino: I just threw in a presence validation, and apparently the model isn't picking up the info from the form?
[18:40:17] Leepoff: has joined #RubyOnRails
[18:40:24] DoctorMonocular: has joined #RubyOnRails
[18:40:36] adam12: desnudopenguino: Gist the controller, model, and form if possible.
[18:40:38] desnudopenguino: If I remove the validations, it works, and creates the photo_rating in the db no problem though
[18:41:44] mordof: has left #RubyOnRails: ()
[18:41:48] diegoviola: has joined #RubyOnRails
[18:44:19] duderonomy: has joined #RubyOnRails
[18:44:36] norc: desnudopenguino, models dont 'pick info from the form'
[18:44:55] norc: desnudopenguino, models have available whatever you give to them (usually the controller or perhaps a service module)
[18:47:00] _djbkd: has joined #RubyOnRails
[18:47:09] kitsuneyo: has joined #RubyOnRails
[18:47:31] N1njturt1e: has joined #RubyOnRails
[18:47:59] maucar: has joined #RubyOnRails
[18:48:34] desnudopenguino: adam12: https://gist.github.com/desnudopenguino/dfddecd6f20648eb3609c416f3686ebe
[18:48:51] jenrzzz: has joined #RubyOnRails
[18:48:51] jenrzzz: has joined #RubyOnRails
[18:48:57] desnudopenguino: the rate action is the one I am using
[18:49:11] desnudopenguino: I'm probably doing something fundamentally stupid
[18:49:14] dcunit3d: oste i got this to work with a negative margin: https://jsfiddle.net/bpn1sg82/
[18:50:22] desnudopenguino: norc: thanks for the clarification
[18:50:58] adam12: desnudopenguino: `photo_rating_params` likely has to reference `photo_rating` somewhere. `params[:photo_rating].permit(:id, :photo_id, :user_id, :rating)`
[18:51:13] adam12: desnudopenguino: Assuming that the form is submitting the params namespaces to `photo_rating`, which I assume it is.
[18:52:26] desnudopenguino: so add the [:photo_rating] to the line for the photo_rating_params?
[18:52:34] adam12: desnudopenguino: You'll also likely run into problems where you override `rating` to 0, since you get a new object back everytime you call `photo_rating_params`. I'd grab the params, then do the update.
[18:52:55] adam12: desnudopenguino: Yes, or `require(:photo_rating)`. I'll let you decide which is more appropriate for your use case.
[18:53:28] desnudopenguino: it was broken with require(:photo_rating) before
[18:53:44] desnudopenguino: i'm probably doing something wrong with the whole railsy form stuff
[18:53:50] adam12: desnudopenguino: Maybe that's not the name of the param? You'd have to check your rails server.
[18:54:09] adam12: The form looks like it would submit as `photo_rating`.
[18:54:42] adam12: desnudopenguino: Also, instead of updating the param `rating` to 0 if nil, do it after you build the new rating. Same as how you assign user_id.
[18:54:47] desnudopenguino: yeah, the post data is photo_rating[rating]
[18:55:02] jtong_: has joined #RubyOnRails
[18:55:26] adam12: desnudopenguino: And on top of that, your params are likely too verbose. You don't need to permit user id or photo id. Likely not id either.
[18:55:35] Leepoff: has joined #RubyOnRails
[18:55:49] adam12: Try using just the square bracket notation and not require for now. params[:photo_rating].permit(:rating)
[18:55:49] desnudopenguino: yeah, those were just there from scaffolding
[18:57:46] desnudopenguino: tried and got "undefined method `permit' for nill:NilClass..."
[18:57:58] desnudopenguino: with params[:photo_rating].permit(:rating)
[18:59:39] _0xd: has joined #RubyOnRails
[18:59:43] lupine: params.permit(photo_rating: :rating) might work
[18:59:45] lupine: it's been a whle
[19:00:07] adam12: The other way should be working. What's the log entry in the server console say? The params that are submitted.
[19:02:15] adam12: desnudopenguino: Just out of curiosity, comment out the `if photo_rating_params[:rating].nil?` block.
[19:02:51] User458764: has joined #RubyOnRails
[19:03:01] desnudopenguino: adam12: removed that logic block, it is irrelevant since I have it check if the field is present AND if it is within the correct range
[19:03:16] rbennacer: has joined #RubyOnRails
[19:03:27] flashpoint9: has joined #RubyOnRails
[19:03:32] adam12: The code should work. I'm curious how the params are coming from the client. Maybe under a different name?
[19:03:32] kimegede: has joined #RubyOnRails
[19:03:47] adam12: It's a namespaced route, so I would wonder?
[19:04:06] dionysus69: has anyone ever sent paperclip uploaded image url with the json api ? if yes please can you give me some code so I can adapt?
[19:04:31] jtong: has joined #RubyOnRails
[19:04:59] desnudopenguino: for the params I get: "Parameters: {"utf8"... , "photo_rating"=>{"rating"=>"3"}, "commit"=>"Create photo rating", "album_id"=>"7", "id"=>"6"}
[19:06:19] adam12: Which is correct for your params call...
[19:07:12] jtong: has joined #RubyOnRails
[19:09:12] jetpackjoe: has joined #RubyOnRails
[19:10:02] Cervajz: has joined #RubyOnRails
[19:13:04] desnudopenguino: I remember why it was breaking with params.require(:photo_rating). It was because the photo_rating param wasn't being passed because the radio buttons not being checked didn't send anything.
[19:13:52] rbennacer: Any recommendation for a rating gem?
[19:14:14] adam12: desnudopenguino: That will do it! You might want collection_radio_buttons instead, as it generates a hidden field for that scenario.
[19:15:30] desnudopenguino: I'll swap that and report back
[19:16:00] jowiar: has joined #RubyOnRails
[19:16:21] adam12: You'll need to finess it a bit, as it expects a collection of objects, not primitives. You can use :to_i as both value and label options.
[19:16:40] adam12: or :to_s as well, probably.
[19:17:24] aegis3121: has joined #RubyOnRails
[19:18:23] desnudopenguino: cool, that's just what i was googling lol
[19:18:45] desnudopenguino: I remember looking at collection_radio_buttons for this before, but forgot about casting, so I was having trouble. lol
[19:19:51] moeabdol: has joined #RubyOnRails
[19:20:42] agit0: has joined #RubyOnRails
[19:20:48] jtong: has joined #RubyOnRails
[19:21:19] FrankD: https://gist.github.com/fdimitri/1d1636cd32a2b7a2fec543a614050785
[19:21:30] FrankD: any idea why this would happen? It's writing the SQL select incorrectly
[19:21:37] FrankD: for a has_many through relationship
[19:22:25] FrankD: ^ excerpt error from 'show' uses select_image_id instead of StyleImage_id as per the schema
[19:22:33] FrankD: er style_image_id instead of StyleImage_id
[19:22:59] context: cause it dont work the way you think it does
[19:23:00] adam12: Rails likes to do things with camel cased values.
[19:23:20] context: fix your schema
[19:23:37] context: or start adding :primary_key and :foreign_key everywhere
[19:23:50] drale2k: when you have a User and a Upload model and you want to send out a mail to users when a file was uploaded; do you call it a UserMail or a UploadMailer ?
[19:24:03] drale2k: UserMailer*
[19:24:09] context: call it whatever you want
[19:24:15] jtong: has joined #RubyOnRails
[19:24:30] context: CowsTasteGoodMailer
[19:24:55] AmiMoench: has joined #RubyOnRails
[19:24:56] drale2k: mind blown
[19:25:09] soroot: has joined #RubyOnRails
[19:25:12] context: TheBossesDaughterIsCuteMailer
[19:25:24] drale2k: thought there was some convention though
[19:25:33] drale2k: i <3 conventions
[19:25:36] adam12: Not for mailers, other than them ending in 'Mailer'.
[19:25:43] adam12: Which might not even be the case, tbh. Hah.
[19:26:03] context: conventions only go... so far
[19:26:06] adam12: Some people stick everything in one mailer (ie. 'NotificationsMailer'). Some people prefer a more granular approach.
[19:26:11] desnudopenguino: adam12: alright stupid question of the day I have collection_radio_buttons(:photo_rating, :rating, 1..5, <what goes here>,<and here>) ? using the to_s or to_i methods?
[19:26:58] adam12: desnudopenguino: f.collection_radio_buttons(:rating, (1..5), :to_i, :to_s)
[19:27:15] FrankD: has_many works, but has_many x through y doesnt? thats crap :p
[19:27:38] adam12: FrankD: You likely want to change your naming of associations and tables to snake case, lest you want a ton of problems down the road.
[19:27:52] yardenbar: has joined #RubyOnRails
[19:28:07] FrankD: adam12, will do but for the moment
[19:28:13] FrankD: what would I add to get it to select correctly?
[19:28:24] context: :primary_key and :foreign_key
[19:28:27] roamingdog: has joined #RubyOnRails
[19:28:54] FrankD: dont suppose you could example me? :p
[19:28:59] binaryplease: has joined #RubyOnRails
[19:29:00] soroot: does anyone know how to do translations of the errors messages in active model?
[19:29:19] FrankD: for has_many/belongs_to I understand it, but I don't really get how to write it with has_many through
[19:29:41] adam12: SoRoot: config/locales/<your locale>.yml
[19:29:57] jtong: has joined #RubyOnRails
[19:29:57] adam12: SoRoot: The key would be probably under <your_locale>->active_record->errors->something.
[19:30:37] Leepoff: has joined #RubyOnRails
[19:30:55] binaryplease: adam12: I think he doesnt have activerecord, just activemodel
[19:30:55] adam12: SoRoot: https://gist.github.com/adam12/fb8795cf7e39e61eb2b37c636f1beef4
[19:31:06] adam12: binaryplease: Oh. Good catch :)
[19:31:12] greengriminal: has joined #RubyOnRails
[19:31:15] context: frankd: you need to do it on all 3 models
[19:31:53] roamingdog: has joined #RubyOnRails
[19:32:01] context: frankd: err the join model
[19:32:03] flashpoint9: has joined #RubyOnRails
[19:32:05] context: read the docs for has_many
[19:32:08] context: ::: Options for :class_name, :primary_key and :foreign_key are ignored, as the association uses the source reflection.
[19:32:41] soroot: adam12: does that also work for active model???
[19:32:48] adam12: SoRoot: Sorry - no idea :\
[19:33:02] greengriminal: Hi all, is there a way in which you can run a callback on a parent before the child associations are saved. Given a scenario whereby I have parent has_many :children. I'd like to have callback that would run in parent to ensure that the id of "parent" is set on the child.
[19:33:09] desnudopenguino: I am back to param missing/empty photo_rating.
[19:33:32] adam12: greengriminal: Is it required? Normally that's handled for you.
[19:33:32] context: greengriminal: validates :parent_id, presence: true
[19:33:43] context: greengriminal: parent.children.{create|new}
[19:33:47] greengriminal: thats correct.
[19:33:51] context: create the children through the parent and you are fine.
[19:34:00] greengriminal: yah thats what i've done.
[19:34:05] context: then you are fine.
[19:34:07] adam12: desnudopenguino: Can you update your gist? What you have should work.
[19:34:24] context: greengriminal: parent cannot have a child with a parent_id that is nil. it would not be its child...
[19:34:29] artto: has joined #RubyOnRails
[19:38:00] desnudopenguino: adam12: it's updated
[19:38:09] adam12: desnudopenguino: link me again.
[19:38:24] dionysus69: what are the "?" and the number for in this url at the end? 000/000/001/original/1.png?1466624232 (this is url of paperclip uploaded file
[19:38:53] desnudopenguino: https://gist.github.com/desnudopenguino/dfddecd6f20648eb3609c416f3686ebe
[19:39:31] adam12: desnudopenguino: What's the error? something about nil?
[19:39:39] desnudopenguino: dionysus69: the ?number are rail's versioning for assets, I believe
[19:40:03] cnk: dionysus69: that is the asset pipeline adding a cache busting parameter so that new versions of files will get loaded even though the expire time in the http headers is fairly long
[19:40:36] lightt: has joined #RubyOnRails
[19:41:01] spilth: has joined #RubyOnRails
[19:41:10] dionysus69: ok my problem now is following. I am serving these urls in api to ember app. how can I synchronize rails asset fingerprints with ember? or I just turn of all fingerprinting for the assets that are served via api?
[19:42:07] FrankD: whew good googly moogly
[19:42:13] FrankD: atleast that worked for now
[19:42:17] roamingdog: has joined #RubyOnRails
[19:43:03] desnudopenguino: adam12: if I select a radiobutton, it still gives the validation error, without checking any of the buttons, I get "param is missing or the value is empty: photo_rating"
[19:43:16] desnudopenguino: this is driving me nuts
[19:43:28] adam12: desnudopenguino: Can you screenshare? TeamViewer or something. I will lookie for ya.
[19:46:23] diegoviola: I want to add a class for some code that I need to call on a controller, just a PORO... but not sure if I should add it under /lib or somewhere else... any suggestions?
[19:46:45] tbuehlmann: diegoviola: I tend to use app/services
[19:47:47] jowiar: has joined #RubyOnRails
[19:47:59] diegoviola: tbuehlmann: will the files in there be autoloaded or I need to do some magic?
[19:48:10] adam12: Autoreloaded.
[19:48:25] adam12: But you will likely have to restart your app server after you make the new folder in app/
[19:49:24] chrisbolton: has joined #RubyOnRails
[19:49:37] greengriminal: thanks context
[19:52:03] chrisbolton: I have an OmniAuth initializer which is configured when it’s loaded based on the client. If the client is not found I want to raise an error and redirect them to an /auth/failure path. Can anyone point me to some resource or help me figure this out. I’ve combed through the wiki with no luck. 
[19:52:04] pwnd_nsfw`: https://gist.github.com/anonymous/6521d71df85908aac7ed48bc969665d6
[19:52:07] pwnd_nsfw`: I don't understand :(
[19:52:24] roamingdog: has joined #RubyOnRails
[19:52:33] djbkd: has joined #RubyOnRails
[19:52:40] adam12: chrisbolton: Can you gist some code where you're doing the lookup of the client?
[19:53:11] adam12: pwnd_nsfw`: What's your path? `echo $PATH`
[19:53:34] pwnd_nsfw`: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
[19:53:41] pwnd_nsfw`: even when I source though
[19:53:53] pwnd_nsfw`: It's as if it just output all that jaz
[19:54:20] pwnd_nsfw`: I suppose I have to use /src/local/rvm
[19:54:24] pwnd_nsfw`: ACTION shrugs
[19:54:35] adam12: How about `exec $SHELL -l -i`
[19:54:42] adam12: I don't use RVM so I'm just spitballing here.
[19:54:59] adam12: Rather, after the `exec` line, try rvm again.
[19:55:18] jmignault: has joined #RubyOnRails
[19:56:31] pwnd_nsfw`: It just installed in a different directory
[19:56:33] pwnd_nsfw`: than I'm used to
[19:57:29] diegoviola: uninitialized constant Message
[19:57:37] diegoviola: just put it under app/services
[19:57:38] chrisbolton: adam12: https://gist.github.com/cbolton-sge/b20a4ed6052efd2da849d902556f3f11
[19:57:40] whathappens: has joined #RubyOnRails
[19:57:42] adam12: pwnd_nsfw`: Yeah - for root install I guess it chooses /usr/local/rvm
[19:57:49] pwnd_nsfw`: Probably because I'm using root user instead of user created during installation of os
[19:58:47] pwnd_nsfw`: Thanks for your help though
[19:59:11] adam12: chrisbolton: A bit hard to follow, but I'd likely raise the exception you want, and then use a rescue_from that does the redirect. http://apidock.com/rails/ActiveSupport/Rescuable/ClassMethods/rescue_from
[19:59:36] adam12: diegoviola: app/services/message.rb includes `class Message`?
[20:00:53] adam12: diegoviola: Possible it's an error in your class? can you gist app/services/message.rb?
[20:01:54] roamingdog: has joined #RubyOnRails
[20:02:47] diegoviola: adam12: it's nothing for now: https://gist.github.com/diegoviola/b6009979378c4ebae2a8c70584b71d33
[20:03:56] diegoviola: adam12: should I make a private method in my controller that calls this class?
[20:04:10] adam12: diegoviola: Where did `Message` come from?
[20:04:24] diegoviola: adam12: renamed Message to SmsService
[20:05:55] adam12: diegoviola: Where do you call the class?
[20:06:45] dmz: has joined #RubyOnRails
[20:06:50] diegoviola: adam12: I got it to work now
[20:07:08] zmd: has joined #RubyOnRails
[20:07:23] diegoviola: adam12: #create method in one of my controllers...
[20:07:30] adam12: diegoviola: If it's working you should be all good.
[20:07:47] diegoviola: yeah, thanks :)
[20:08:10] srinidhi: has joined #RubyOnRails
[20:17:59] Coldblackice: has joined #RubyOnRails
[20:18:03] gambl0re: has joined #RubyOnRails
[20:18:04] gambl0re: has joined #RubyOnRails
[20:21:50] arBmind: has joined #RubyOnRails
[20:22:13] soroot: has joined #RubyOnRails
[20:23:01] eljimmy: has joined #RubyOnRails
[20:24:32] macsteps: has joined #RubyOnRails
[20:25:45] gambl0re: has joined #RubyOnRails
[20:25:45] gambl0re: has joined #RubyOnRails
[20:27:26] macsteps: has joined #RubyOnRails
[20:29:10] gambl0re: has joined #RubyOnRails
[20:34:28] triptec: has joined #RubyOnRails
[20:34:30] Elinos: has joined #RubyOnRails
[20:34:42] gambl0re: has joined #RubyOnRails
[20:35:30] pawnbox: has joined #RubyOnRails
[20:35:48] FactoryGirlHelp_: has joined #RubyOnRails
[20:36:02] FactoryGirlHelp_: Do I use this chat for factorygirl questions
[20:38:37] peterppp: FactoryGirlHelp_, I did so in the past and didn't get beaten up, so..
[20:39:09] null__: thoughtbot's blog also provides some additional info -- but it can be pretty outdated depending on the artiicle
[20:39:10] peterppp: and that even though my question was dumb
[20:40:15] FactoryGirlHelp_: I have made a scope on my model. and I'm now trying to test that scope. The scope is joins(:name).distinct
[20:40:19] FactoryGirlHelp_: That model has_many names
[20:40:42] FactoryGirlHelp_: and in my test I have scope_without_names and scope_with_names
[20:40:51] jayc0b0: has joined #RubyOnRails
[20:40:52] FactoryGirlHelp_: oops, model with_names and model without names
[20:41:10] FactoryGirlHelp_: ugh, Idk how to explain this without context
[20:42:07] jtong: has joined #RubyOnRails
[20:42:08] FactoryGirlHelp_: ok with rspec I have let(:model_with_names) { create(:model, with_name) }
[20:42:22] rodfersou: has joined #RubyOnRails
[20:42:22] FactoryGirlHelp_: let(:model_without_names) { create(:model) }
[20:42:29] FactoryGirlHelp_: I'm trying to get the model with names to work and idk how
[20:42:57] jtong: has joined #RubyOnRails
[20:43:11] choke: has joined #RubyOnRails
[20:43:12] nachoman: has joined #RubyOnRails
[20:44:12] FactoryGirlHelp_: I'm pretty much trying to assign an association with my model for testing, and compare it with one that doesn't have that association
[20:44:54] jayc0b0: Oops. Wrong channel. But hello anyway. :)
[20:45:30] choke: can anyone think of a reason that currentuser.somerelatedmodel.new(model_params) would give me an argument error saying it's expecting 0 arguments?
[20:47:09] fox_mulder_cp: choke: devise current_user or your oown?
[20:47:29] choke: devise current_user fox_mulder_cp
[20:47:38] fox_mulder_cp: may be bla.bla.build(model_params)
[20:47:47] fox_mulder_cp: choke: wait, i grep my code
[20:48:08] adam12: choke: #build is indeed what you want.
[20:48:19] adam12: choke: as fox_mulder_cp said.
[20:48:34] choke: adam12 k i'll try it and rspec and see what it does... weird thing is it works for one test, but not the very next one.
[20:48:52] adam12: choke: That is odd, for sure.
[20:48:58] choke: same issue.. let me gist up my request specs and my code
[20:49:45] fox_mulder_cp: https://gist.github.com/foxmuldercp/47d5c7d24afe8051e4b933f460a8075d
[20:50:37] fox_mulder_cp: adam12: choke my sample located here
[20:51:30] fox_mulder_cp: when user register, this code create associated with this user new client instance
[20:56:12] whathappens: has joined #RubyOnRails
[20:57:41] choke: my register is working fine, this is another part... i think i got everything in my gist here: https://gist.github.com/jblac/1ae25e02aaa515c7964f44579edf4438
[20:57:59] choke: the picture upload works fine, appears to be my video upload that fails
[20:59:12] dnewkerk: has joined #RubyOnRails
[21:00:57] SteenJobs: has joined #RubyOnRails
[21:00:58] reaVer: has joined #RubyOnRails
[21:01:21] adam12: choke: What's the exact error? There's a bunch going on here.
[21:02:05] workmad3: has joined #RubyOnRails
[21:02:34] choke: adam12 sorry aboutt that, just added the rspec error output
[21:04:55] adam12: choke: I suspect your implementation is right, but carrierwave is busted somewhere. Perhaps in the video thumbnailing module.
[21:06:18] adam12: choke: Does it work outside of rspec?
[21:07:04] choke: same error outside of rspec
[21:08:10] glasz_: has joined #RubyOnRails
[21:08:30] diegoaguilar: has joined #RubyOnRails
[21:09:51] nettoweb: has joined #RubyOnRails
[21:10:10] choke: just commented out all the thumbnailer -- it is in fact that... making the thumbnail urls return blank strings makes the test pass
[21:11:22] choke: possible that it's a rails5 incompatibility -- of course carrierwave-video-thumbnailer also appears to be dead in development.
[21:12:57] pwnd_nsfw`: When I run bundle exec cap production deploy on my Droplet, it hangs at "01 mkdir -p /tmp/canvasc_cut/" for what feels like 45 seconds, then spews out about ssh timeouts. https://gist.github.com/SirUncleCid/90a1d34fd839dd26f1a9e742dda0f2e4
[21:13:35] meoblast001: has joined #RubyOnRails
[21:14:19] SteenJobs: hey, has anyone built a stripe connect flow?
[21:14:31] SteenJobs: i’m curious how you build the flow to accomodate the initial account creation, and then the subsequent verification, from an architecture/design perspective (and a bit of UX too)
[21:14:42] pwnd_nsfw`: The error isn't clear to me. But some things I was looking into is... my project is in a private repo, I took suggested measures to fix that, but nothing has changed
[21:14:43] SteenJobs: basically how to structure the two step information collection
[21:16:38] `0ctayn: hello. maybe a dumb question but: i am not able to connect to my rails server. when i go to http://devjoevm:3000 it says "The server at devjoevm is taking too long to respond" in firefox. if i open CMD and type "ping devjoevm" i get an ip address (, and if i type it goes to the server and connects correctly. devjoevm is a vm in hyper-v
[21:16:44] havenwood: https://github.com/rails/rails/releases/tag/v5.0.0.rc2
[21:16:58] `0ctayn: the question is how can i connect with devjoevm:3000 successfully
[21:17:50] blackmesa: has joined #RubyOnRails
[21:19:05] dnewkerk: I have a standard Rails resource with some general attributes on its new/edit form, but would like to add a separate page with a form for other specialized attributes of the same model, some of which need validations (but should not be validated on the new/edit form)… what technique is best to accomplish something like this?
[21:19:10] pwnd_nsfw`: `0ctayn, when you run your server
[21:19:16] pwnd_nsfw`: rails s -b
[21:19:55] adam12: pwnd_nsfw`: It's a weird error. `ssh` connects just fine from command line?
[21:20:27] pwnd_nsfw`: adam12, from the droplet or from my local
[21:20:39] adam12: pwnd_nsfw`: Assuming droplet is at
[21:21:04] adam12: `0ctayn: I don't know about Firefox, but Chrome maintains it's own DNS cache, which could have a stale value.
[21:21:16] adam12: `0ctayn: I'd likely start there.
[21:21:24] fox_mulder_cp: adam12: ssh ip -p port, as i know, but man :)
[21:21:36] adam12: fox_mulder_cp: Right.
[21:21:46] choke: well, adam12 i fixed it haha
[21:21:48] `0ctayn: thanks, pwnd_nsfw`. that fixed the issue.
[21:21:57] adam12: choke: Solution?
[21:22:01] pwnd_nsfw`: adam12, droplet is at a diffent IP
[21:22:10] adam12: pwnd_nsfw`: What's that IP? repo?
[21:22:37] choke: change "version thumbnail:" to "version thumb:" and change the reference everywhere else.. i suppose it has something to do with the "process thumbnail: " line
[21:22:55] adam12: choke: Good find.
[21:23:37] pwnd_nsfw`:, git@github.com:CanvasCut/canvascut_site.git
[21:24:12] jtong_: has joined #RubyOnRails
[21:25:29] adam12: pwnd_nsfw`: I'd wonder where that 23.23 IP is coming from...
[21:26:13] pwnd_nsfw`: Right, good thinking
[21:27:09] pwnd_nsfw`: The app currently sits on heroku
[21:27:16] pwnd_nsfw`: But... the code shouldn't be doing anything to reference it
[21:27:29] adam12: It uses the hostname from production.rb
[21:27:31] adam12: server 'www.xxx'
[21:27:38] adam12: Which I am assuming is what it's resolving.
[21:27:41] SteenJobs: why would one prefer using a struct instead of a class when writing a service?
[21:28:34] Hobogrammer: has joined #RubyOnRails
[21:28:37] voidDotClass: has joined #RubyOnRails
[21:28:52] pawnbox: has joined #RubyOnRails
[21:29:09] ksmutthu: has joined #RubyOnRails
[21:29:29] adam12: SteenJobs: In general, if you just want a simple object with a few fields and no logic, a struct fits the bill. If you want logic, custom getters/setters, write a class.
[21:29:34] adam12: SteenJobs: Don't think it matters if it's a service or not.
[21:30:19] SteenJobs: adam12: right - merely curious if organizing logic in a service by nature tends to work well with a struct
[21:30:51] solars: has joined #RubyOnRails
[21:31:47] mdw: has joined #RubyOnRails
[21:32:31] adam12: SteenJobs: IMHO, no. You likely want a class.
[21:33:10] SteenJobs: adam12: ok cool. found what looks like a really well written example of implementing stripe connect, and the managed account service uses a struct so thought i’d ask out of curiosity
[21:33:20] adam12: SteenJobs: Can you link me?
[21:33:27] adam12: SteenJobs: Maybe we're on different pages here.
[21:33:44] SteenJobs: it’s worth looking at anyway
[21:33:45] mdw: has joined #RubyOnRails
[21:33:47] SteenJobs: what page are you on?
[21:33:49] SteenJobs: https://github.com/rfunduk/rails-stripe-connect-example/blob/8e866d3c1ed16a52c74c874e310313bbebf07cf5/app/services/stripe_managed.rb
[21:34:05] adam12: Interesting.
[21:34:12] SteenJobs: yea that’s what i thought too haha
[21:34:23] adam12: This screams class to me.
[21:34:32] SteenJobs: the code is too clean and organized for it to not have been deliberate
[21:34:38] SteenJobs: which is why i was like hmm…
[21:34:56] adam12: Well, all they saved is the initialize method and the creation of an accessor
[21:35:26] SteenJobs: and only kind of. the initialize method is really just passed to Struct.new
[21:35:29] djbkd: has joined #RubyOnRails
[21:35:41] mdw: has joined #RubyOnRails
[21:36:00] adam12: If you created an instance of this, I wonder what the inspect of it would be
[21:36:29] adam12: Personally, I think this is an abuse of Struct... but who knows?
[21:36:32] Elinos: has joined #RubyOnRails
[21:37:23] mdw: has joined #RubyOnRails
[21:37:36] SteenJobs: i’m reading through the whole code base now ha, should make implementing this easier
[21:37:46] SteenJobs: well “whole”, it’s not so big
[21:37:56] ur5us: has joined #RubyOnRails
[21:38:13] SteenJobs: but if there were arrows pointing it would help :D
[21:38:38] lightt: has joined #RubyOnRails
[21:39:49] JamesGames: has joined #RubyOnRails
[21:41:11] mdw: has joined #RubyOnRails
[21:43:16] rubyonrailed: has joined #RubyOnRails
[21:43:20] lightt: has joined #RubyOnRails
[21:44:56] GodFather: has joined #RubyOnRails
[21:45:12] greengriminal: has joined #RubyOnRails
[21:45:27] rubyonrailed: Is there anyone that can help me with this? I setup devise and am posting to the sign_in path from rspec and keep getting this error 'You need to sign in or sign up before continuing.' heres a gist https://gist.github.com/anonymous/4e560f0cdf397e193db3b9280afdace5
[21:46:49] JamesGames: has joined #RubyOnRails
[21:47:39] mdw: has joined #RubyOnRails
[21:49:09] jmignault: has joined #RubyOnRails
[21:49:24] tfitts: anyone in here do anything with a shopify store and use their api gem?
[21:49:57] adam12: rubyonrailed: Not familiar with Warden but I'd assume we need to know what auth_options contains.
[21:50:44] macsteps: has joined #RubyOnRails
[21:51:20] rbennacer: adam12: Is there anyway i can download the source of the gems i am using in my rails app, so i can run binding.pry or byebug on it?
[21:51:23] Darmani: has joined #RubyOnRails
[21:51:43] rubyonrailed: adam12: I left a comment with the results of auth_option
[21:51:51] cnk: you already have that source - where bundler installed it
[21:51:52] adam12: rbennacer: Clone to a local path, and use the `path` option in your Gemfile to use your local copy. Debug away!
[21:52:09] JamesGames: hello? I am trying to change an instance variable in my users/show.html.erb called @room to another room in the Rooms database, rails is fighting me every step of the way. this is day 3
[21:52:10] jtong: has joined #RubyOnRails
[21:52:16] rbennacer: adam12: thanks
[21:52:20] adam12: rbennacer: They are installed _somewhere_ if you want to muck with the ones already installed. `bundle show gemname` perhaps?
[21:52:34] adam12: rbennacer: You likely have to restart your app server when you edit the files, since they are only loaded once and not autoreloaded.
[21:52:40] cnk: JamesGames: show code
[21:52:43] adam12: JamesGames: Share some code please.
[21:53:49] JamesGames: I'm pretty sure that this is a newbie question. I have a users show.html.erb that displays room attributes like: <%=@room.greeting%> and <%=@room.main_text%>.
[21:53:57] Darmani: Hello everyone ^^
[21:54:16] rbennacer: adam12: thank you
[21:54:43] JamesGames: has joined #RubyOnRails
[21:55:08] JamesGames: you's still there. i messed up there
[21:55:23] flashpoint9: has joined #RubyOnRails
[21:55:39] adam12: JamesGames: Don't paste code in here. Use gist.github.com or another code sharing site.
[21:56:35] adam12: rubyonrailed: I would assume you have to pass the strategy for auth into warden.authenticate! .. again, not familiar with warden.
[21:56:35] JamesGames: anyway it is just <%= @room.attribute%> in the html.erb
[21:57:10] adam12: JamesGames: Can you gist the controller that is rendering this html? That's where the instance variable is being set.
[21:57:53] SteenJobs: adam12: turns out the dude who wrote that repo i sent you was a support engineer at stripe
[21:58:07] JamesGames: i dunno how to gist. the controller is : def navigation(params:name)
[21:58:07] JamesGames: @user.room_name = Room.find_by_name(params:name)
[21:58:31] adam12: Your not assigning the @room instance variable there.
[21:58:45] adam12: SteenJobs: Hmm? Maybe he knows something I don't.
[21:59:08] rubyonrailed: adam12: Thanks
[21:59:20] JamesGames: so what u think?
[21:59:22] SteenJobs: adam12: who knows. but at least it’s comforting to know the dude that wrote that code knew what he was doing with stripe
[21:59:30] emachnic: has joined #RubyOnRails
[21:59:39] adam12: rubyonrailed: Out of curiousity, can you remove the `self.` from line 4?
[22:00:01] adam12: JamesGames: I think you're not assigning @room in that controller.
[22:00:25] rubyonrailed: adam12: Nope, that returns nil
[22:00:30] zave: has joined #RubyOnRails
[22:00:31] adam12: rubyonrailed: Or maybe share the entire SessionsController?
[22:00:45] adam12: Maybe it's a Warden/Devise thing that I am not familiar with.
[22:00:50] macsteps: has joined #RubyOnRails
[22:01:42] adam12: JamesGames: Go to gist.github.com. Copy and paste your entire controller into the box, create the gist, share the link here.
[22:01:51] JamesGames: has joined #RubyOnRails
[22:01:57] rubyonrailed: adam12: The rest of the controller is inheriting from devise. https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb
[22:01:58] adam12: JamesGames: Go to gist.github.com. Copy and paste your entire controller into the box, create the gist, share the link here.
[22:02:06] adam12: rubyonrailed: Ah, my bad :)
[22:03:11] jetpackjoe: has joined #RubyOnRails
[22:04:30] JamesGames: gist:2158fb4fd7c40a370c32c536561376e7
[22:04:30] JamesGames: Created 11 seconds ago
[22:04:30] JamesGames: gist:2158fb4fd7c40a370c32c536561376e7
[22:04:30] JamesGames: Created 11 seconds ago
[22:04:47] JamesGames: twice, but u get the gist, hahahahah
[22:05:20] mdw: has joined #RubyOnRails
[22:05:23] JamesGames: how would u set this up?
[22:06:24] adam12: JamesGames: Where is `navigation` called from?
[22:07:30] adam12: Update the gist with it
[22:07:38] adam12: Or make a new one please.
[22:07:56] JamesGames: gist:f34bc4a8913fba08e937dd3cd5ef362c
[22:07:56] JamesGames: Created 10 seconds ago
[22:08:26] adam12: That's still not making any sense.
[22:08:50] JamesGames: I don't get it either
[22:09:22] adam12: JamesGames: Actually I kinda see the pieces coming together.
[22:09:31] JamesGames: the helper is called in the view <%= navigation_helper("The Marsh") %> # the Marsh is a room
[22:09:46] adam12: JamesGames: OK. What's your URL in your browser look like when you visit that page?
[22:10:04] JamesGames: heroku or local?
[22:10:16] adam12: Doesn't matter. They would be the same. I don't care about the hostname
[22:10:19] adam12: Also, gist your routes.rb
[22:11:10] voidDotClass: has joined #RubyOnRails
[22:11:16] JamesGames: https://the_app_in_question.herokuapp.com/users/3
[22:11:18] Spami: has joined #RubyOnRails
[22:11:23] adam12: That's when you click the link?
[22:11:30] adam12: No `The Marsh`?
[22:11:44] workmad3: has joined #RubyOnRails
[22:12:25] macsteps: has joined #RubyOnRails
[22:12:29] JamesGames: umm. the marsh does'nt load. im stuck in the other room. the code doesn't work yet
[22:12:43] Oliphaunte: has joined #RubyOnRails
[22:12:44] JamesGames: can u see my problem
[22:12:49] mosx: has joined #RubyOnRails
[22:12:59] adam12: JamesGames: Create a gist with your routes.rb file.
[22:13:22] JamesGames: the routes is get 'users/navigation'
[22:13:38] JamesGames: i have a feeling its wrong
[22:13:39] adam12: Is it inside a resources block? ie. resources :users do get 'users/navigation' ?
[22:14:28] adam12: What file is your <%= @room %> code in? show.html?
[22:14:45] JamesGames: yes /users/show.html.erb
[22:14:46] Sashimi: has joined #RubyOnRails
[22:15:00] adam12: https://gist.github.com/adam12/5cd28f69bfcafe66477804e950e1abc2
[22:15:21] JamesGames: is that a link 4 me?
[22:15:22] adam12: I modified your navigation helper, and your navigation action in the controller.
[22:15:24] adam12: JamesGames: yes.
[22:15:40] JamesGames: ok hang on I try it
[22:15:48] adam12: lines 2 & 3 in first section of code, 64-67 in second.
[22:15:56] adam12: I gotta jet. Hopefully it gets you on the right path.
[22:18:52] sneakers: has joined #RubyOnRails
[22:18:54] JamesGames: thanks. i try it now. u leaving?
[22:19:11] SteenJobs: has joined #RubyOnRails
[22:21:39] Pharaoh2: has joined #RubyOnRails
[22:22:58] DoctorMonocular: has joined #RubyOnRails
[22:24:08] macsteps: has joined #RubyOnRails
[22:24:26] jmignault: has joined #RubyOnRails
[22:25:50] macsteps: has joined #RubyOnRails
[22:31:09] whathappens: has joined #RubyOnRails
[22:31:52] caudill: has joined #RubyOnRails
[22:34:35] JamesGames: hey adam12 . i'm getting nomethoderror
[22:34:38] JamesGames: undefined method `users_navigation_path' for #<#<Class:0x007f1e00dc47c0>:
[22:34:58] JamesGames: this something to do with routes.rb?
[22:36:40] JamesGames: has joined #RubyOnRails
[22:37:20] Elinos: has joined #RubyOnRails
[22:38:24] User458764: has joined #RubyOnRails
[22:39:55] Cache_Money: has joined #RubyOnRails
[22:41:11] roamingdog: has joined #RubyOnRails
[22:45:22] jowiar: has joined #RubyOnRails
[22:46:13] mikeiniowa: has joined #RubyOnRails
[22:48:14] macsteps: has joined #RubyOnRails
[22:49:54] oystersauce8: has joined #RubyOnRails
[22:51:11] mdw: has joined #RubyOnRails
[22:52:21] mdw: has joined #RubyOnRails
[22:53:00] diegoviola: how can I improve this if else end block for notifications? https://gist.github.com/diegoviola/2c5ab2179833586c9b2599da6d317c9a
[22:53:01] bklane: has joined #RubyOnRails
[22:53:25] Radar: GOOD MORNING
[22:53:30] Radar: JamesGames: show us your routes please
[22:53:36] mdw: has joined #RubyOnRails
[22:54:09] Radar: diegoviola: If you read Rails 4 in Action, you would've seen this: https://github.com/rubysherpas/r4ia_examples/blob/master/ticketee/app/views/layouts/application.html.erb#L74-L78
[22:54:54] diegoviola: Radar: I think I read that before, thanks
[22:55:05] diegoviola: Radar: I'll grab that book, thanks
[22:55:23] mdw: has joined #RubyOnRails
[22:56:39] Darmani: Hey Radar ^.^
[22:57:26] xall: has joined #RubyOnRails
[22:58:39] solars: has joined #RubyOnRails
[23:00:17] Elinos: has joined #RubyOnRails
[23:01:15] triptec: has joined #RubyOnRails
[23:03:55] Darmani: Radar: Bro
[23:04:06] blackmesa: has joined #RubyOnRails
[23:05:02] Radar: Darmani: orB
[23:05:28] Darmani: Radar: Wanna see that t shirt website I'm working on? :D
[23:05:51] Darmani: Radar: behold
[23:05:53] Darmani: https://tshirtshop-mfifth.c9users.io/
[23:06:05] Darmani: Disclaimer: It's not done yet.
[23:06:16] Radar: nice and clean
[23:07:07] jetpackjoe: has joined #RubyOnRails
[23:07:17] rickmasta: has joined #RubyOnRails
[23:08:09] bklane: has joined #RubyOnRails
[23:09:25] jenrzzz: has joined #RubyOnRails
[23:09:25] jenrzzz: has joined #RubyOnRails
[23:11:23] jowiar: has joined #RubyOnRails
[23:11:49] wethu: has joined #RubyOnRails
[23:13:18] lightt: has joined #RubyOnRails
[23:14:55] wd40s: has joined #RubyOnRails
[23:17:46] diegoaguilar: has joined #RubyOnRails
[23:20:24] xall: has joined #RubyOnRails
[23:23:38] diegoaguilar: has joined #RubyOnRails
[23:24:30] baweaver: Anyone used Sidetiq for scheduled jobs? Trying to figure out how it schedules, I think it does one instance of a job for each host.
[23:25:33] dalbuschat: has joined #RubyOnRails
[23:25:46] Radar: baweaver: We're just starting to use it today.
[23:25:58] Radar: I don't know about how it works internally.
[23:26:02] macsteps: has joined #RubyOnRails
[23:26:09] baweaver: It basically just made a huge thrashing potential by scheduling a job per host.
[23:26:12] Cervajz: has joined #RubyOnRails
[23:27:08] jmignault: has joined #RubyOnRails
[23:27:09] baweaver: Trying to make sure that's what it's doing
[23:30:11] Leepoff_: has joined #RubyOnRails
[23:30:23] baweaver: I'll let you know if we find anything else fun
[23:30:41] baweaver: what are you setting concurrency to Radar?
[23:30:52] Radar: baweaver: No idea. Someone else on my team is doing it.
[23:31:04] Radar: it just got mentioned at standup this morning (half hour ago)
[23:32:04] baweaver: and you haven't learned it well enough to solve my problems? You're slipping Radar
[23:32:17] SteenJobs: has joined #RubyOnRails
[23:32:24] sloggerkhan: Is there some kind of bulk find_or_create_by or is looping to make a transaction the best bet?
[23:32:41] baweaver: heh, I'll let you know what I find out on it. Might save you some later grief
[23:32:46] lightt: has joined #RubyOnRails
[23:32:56] Radar: baweaver: yes we should share war stories
[23:33:18] baweaver: I'm actually moving teams today, so not going to be my problem :D
[23:33:29] Honeycomb: has joined #RubyOnRails
[23:33:34] baweaver: SloggerKhan: `where`
[23:33:53] baweaver: find all the records from whatever thing you're trying to sync from
[23:33:58] quazimodo: has joined #RubyOnRails
[23:40:28] Honeycomb: has joined #RubyOnRails
[23:40:51] markfletcher: has joined #RubyOnRails
[23:41:40] roamingdog: has joined #RubyOnRails
[23:42:07] superlou: has joined #RubyOnRails
[23:44:35] upsell5: has joined #RubyOnRails
[23:45:54] AmiMoench: has joined #RubyOnRails
[23:47:15] choke: has joined #RubyOnRails
[23:48:01] emachnic: has joined #RubyOnRails
[23:48:45] allcentury: has joined #RubyOnRails
[23:49:20] dcunit3d: has joined #RubyOnRails
[23:51:13] JamesGames: hello I am having problems with an instance variable in my show.html.erb
[23:52:06] Radar: JamesGames: Show us your code please.
[23:53:11] asheinfeld: has joined #RubyOnRails
[23:53:25] Lytol: has joined #RubyOnRails
[23:54:02] JamesGames: gist:12f5a6edcf6b8b39b7a0e0c4a9063c2d
[23:54:02] JamesGames: Created 11 seconds ago
[23:54:13] Radar: the URL please
[23:54:35] JamesGames: https://gist.github.com/anonymous/12f5a6edcf6b8b39b7a0e0c4a9063c2d
[23:54:38] Darmani: Radar: This guy lmao
[23:54:45] Radar: !gist-usage
[23:54:45] helpa: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[23:54:49] Radar: Darmani: You were like that once, I bet.
[23:54:58] Radar: JamesGames: ^ please update your Gist according to the guidelines listed above.
[23:55:11] Darmani: Radar: So were you xP
[23:55:17] Radar: Darmani: shhh don't tell anyone.
[23:55:35] Darmani: Radar: Lol xD
[23:56:10] Guest89011: has joined #RubyOnRails
[23:56:29] JamesGames: https://gist.github.com/anonymous/9a2c755103c38c165070307dda3e2fd7
[23:56:49] Radar: Close enough. What's the issue, JamesGames?
[23:57:02] srinidhi: has joined #RubyOnRails
[23:58:22] shinnya: has joined #RubyOnRails
[23:58:34] JamesGames: well. I had to reset. but i had a lot of @room.text and @room.description in the erb, but I think i have the helper and the controller working now and the problem is that if I set the @room to a room at the top of the code I cannnot change it with the link_to button
[23:58:48] Radar: JamesGames: Show us the helper and the controller as two separate files in the Gist please.
[23:59:50] JamesGames: https://gist.github.com/anonymous/7dcb8c93f4b8552bf1882f677d8f9833