« Back to channel list

#RubyOnRails - 12 October 2015

« Back 1 day Forward 1 day »
[00:03:47] hnanon: I have: https://gist.github.com/anonymous/f40aebe3c8a4e22cf3bf
[00:03:58] Denarii: has joined #RubyOnRails
[00:04:15] hnanon: the instructor is not being updated, though.
[00:04:22] hnanon: Not throwing any errors.
[00:04:27] losvedir: has joined #RubyOnRails
[00:05:34] nertzy2: has joined #RubyOnRails
[00:06:16] Cervajz: has joined #RubyOnRails
[00:06:36] blackmes1: has joined #RubyOnRails
[00:06:59] bkulbida: has joined #RubyOnRails
[00:07:50] moeabdol: has joined #RubyOnRails
[00:10:12] Guest81258: has left #RubyOnRails: ()
[00:10:30] hnanon: I'm calling it through my update action via: @training_record.update_instructor(current_user, params)
[00:11:07] quazimodo: has joined #RubyOnRails
[00:11:09] rushed: has joined #RubyOnRails
[00:13:37] mices: jhass: sorry was outside
[00:13:47] mices: bilbo-baggins: sorry was outside
[00:13:54] mices: i solved it
[00:14:03] mices: it was nothing just a typo
[00:15:30] smathy: hnanon, setting an attribute doesn't save it.
[00:15:40] hnanon: I forgot to call save!
[00:15:53] hnanon: smathy: Yeah, I just saw that! Thank you.
[00:17:50] SteenJobs: anyone know of a good library for building an analytics dashboard (whose db will be populated with JSON dumps) for purely internal use?
[00:19:43] Aeyrix: SteenJobs: Rails
[00:20:26] SteenJobs: Aeyrix: haha thank you sir, i meant for anything involved in displaying and manipulating the data that i will be parsing from the JSON dumps and populating my db with.
[00:20:42] disl: has joined #RubyOnRails
[00:20:51] Aeyrix: SteenJobs: You can use literally anything
[00:20:59] Aeyrix: your question is super vague
[00:21:42] SteenJobs: basically we have a lot of json data from Parse, for all sorts of different events that occur in our iOS app - for the non tech founders, i want to build a dashboard that will allow them to view and manipulate the data as they wish
[00:21:57] Aeyrix: yeah there's no "library" for that
[00:22:01] Aeyrix: you build it yourself
[00:22:03] SteenJobs: which would pretty much just be a comprehensive sorting panel - sorting by event, user, etc.
[00:22:05] SteenJobs: yea obviously dude
[00:22:40] SteenJobs: i know what a data model is. i???m asking regarding the frontend intensive work. in the same way someone may use ActiveAdmin, god forbid.
[00:25:10] framling: has joined #RubyOnRails
[00:26:59] Radar: +1 for d3
[00:27:18] Radar: Learning curve is basically vertical, but there are tons of examples :)
[00:27:53] SteenJobs: not worried about learning curve. thanks, will check out d3. not so familiar with what???s out there since i???ve been neck deep in mobile for a while.
[00:28:27] SteenJobs: but any other tools that could be useful for building an interface for the other founders to interact with our parse analytics data will be super useful to know about, feel free to drop names and i???ll look into all of them. thanks guys!
[00:28:28] Radar: d3 is what I use for http://logs.ryanbigg.com/p/SteenJobs/activity
[00:29:04] SteenJobs: Radar: ah yes, those days when i set many many records.
[00:29:15] kayloos: has joined #RubyOnRails
[00:29:18] n1lo: has joined #RubyOnRails
[00:29:34] Mia: has joined #RubyOnRails
[00:29:43] Oog: has joined #RubyOnRails
[00:30:12] Aeyrix: Radar: you should make a trophy system
[00:30:16] Aeyrix: most questions per day
[00:30:20] Aeyrix: most lines of text per day
[00:30:24] Aeyrix: and just gamify #rubyonrails
[00:30:30] SteenJobs: tis how i learned how to code, and am forever indebted
[00:30:38] Radar: Both of those things are not something I want to... exactly encourage
[00:30:39] SteenJobs: i found the buzz word i was missing: data visualization.
[00:31:46] SteenJobs: Radar: things good? it???s been a while.
[00:32:18] bkulbida: has joined #RubyOnRails
[00:33:20] superlou: has joined #RubyOnRails
[00:34:47] Radar: things are great
[00:37:02] iamjarvo_: has joined #RubyOnRails
[00:38:07] yfeldblum: has joined #RubyOnRails
[00:39:51] prestorium: has joined #RubyOnRails
[00:40:57] hnanon: Is there a way to only pass updated form attributes in the params?
[00:42:26] hnanon: This whole time I'm working towards a solution under the assumption that a form that's updated will only pass the updates as params.
[00:42:28] one_zero: has joined #RubyOnRails
[00:45:43] yaymukund: has joined #RubyOnRails
[00:46:11] rushed: hnanon: did you review my gist earlier? if you note the use of changed_attributes (which will be available after doing an update on the model using the params) that has the information you're looking for... also when you don't gist your code, noone can point out if you're up a tree like that~
[00:46:14] tubbo: has joined #RubyOnRails
[00:48:00] michael_mbp: has joined #RubyOnRails
[00:48:38] hnanon: rushed: taking a second look at it.
[00:49:01] hnanon: I think I misread it. So there is a changed_attributes rails method?
[00:51:28] rushed: hnanon: I wonder where you could find more details on what "changed_attributes" are as they relate to "rails" maybe somewhere you might put "rails changed_attributes" in and... ah nevermind, that's crazy talk
[00:51:50] hnanon: I'm just thinking aloud.
[00:52:51] jsfan: has joined #RubyOnRails
[00:53:01] saurabh: has joined #RubyOnRails
[00:56:32] Aeyrix: #rubyonrails-soundingboard
[00:57:34] rushed: has joined #RubyOnRails
[01:07:58] smathy: has joined #RubyOnRails
[01:08:33] joshkovach: has joined #RubyOnRails
[01:08:52] hnanon: rushed: In your example, how are you passing current_user?
[01:09:01] hnanon: to the model, I mean.
[01:09:19] bkulbida: has joined #RubyOnRails
[01:09:28] rushed: hnanon: as I mentioned, if you want to do it in the model you probably want to look at the sentient_user & request_store gems
[01:09:31] jessemcgilallen: has joined #RubyOnRails
[01:09:42] rushed: hnanon: alternately you could pass it in from the controller
[01:11:24] hnanon: But isn't updated_attributes only available after an update?
[01:11:39] hnanon: I'm using an after_update callback.
[01:12:05] hnanon: And it's not letting me pass any arguments.
[01:12:26] rushed: hnanon: so unpack what you want to do :)
[01:12:41] rushed: hnanon: you could... update with the params but not save, so then you can make more changes
[01:12:55] rushed: hnanon: or you could look at those gems I've mentioned
[01:13:04] rushed: hnanon: or you could pass the user in :)
[01:13:15] hnanon: rushed: I'm trying to stay away from as many gems as possible for now.
[01:13:35] rushed: hnanon: if you're running a rails app you're already using hundreds, but suit yourself~
[01:13:59] hnanon: I can pass the user in after_update :update_instructor(current_user)?
[01:14:13] rushed: hnanon: where are you writing that code?
[01:14:18] hnanon: In the model.
[01:14:23] rushed: hnanon: does that location know what current_user is?
[01:14:33] hnanon: It does not.
[01:15:02] rushed: hnanon: there ya go :)
[01:15:03] hnanon: Ok, 1 sec.
[01:15:11] rushed: and.... done
[01:15:26] rushed: such a great one... never gets old~
[01:16:20] hnanon: Wait, the controller doesn't allow an after_update callback.
[01:16:42] rushed: hnanon: right, that's a model thing :)
[01:17:01] rushed: hnanon: you might consider one of the other options I mentioned, or using the sentient_user gem if you would like to use the option you're working on
[01:17:26] joshkovach: has joined #RubyOnRails
[01:17:38] rushed: hnanon: or you take a look at one of the active record versioning gems that keeps an entire history of changes to your models over time for you
[01:17:47] rushed: hnanon: but I mean... where is the fun in that right?
[01:21:38] hnanon: rushed: please take a look: https://gist.github.com/anonymous/16773611dad375a3ac50
[01:22:03] doodlehaus: has joined #RubyOnRails
[01:22:04] hnanon: I think that'll make it clear what I'm after, even if it's not the right way of doing it.
[01:24:25] hnanon: self.changed_attributes is empty.
[01:24:43] ishikawa91: why don't you write a current_user.full_name method that returns first_name + ' ' + last_name?
[01:26:03] hnanon: I have that written. Just trying to get the fundamental part working for now.
[01:26:22] towski_: has joined #RubyOnRails
[01:27:36] hnanon: rushed: The docs say I need in include include ActiveModel::Dirty in my model.
[01:28:21] towski_: has joined #RubyOnRails
[01:28:28] Limix: has joined #RubyOnRails
[01:29:10] benlieb: has joined #RubyOnRails
[01:29:27] Motoservo: has joined #RubyOnRails
[01:29:35] hnanon: This line in the controller saves the updates: if @training_record.update(training_record_attributes_params)
[01:30:09] hnanon: I don't want to save them yet.
[01:32:00] garbansos: has joined #RubyOnRails
[01:32:07] rushed: hnanon: assign_attributes is update_attributes w/ out the save
[01:32:08] yfeldblum: has joined #RubyOnRails
[01:32:19] bkulbida: has joined #RubyOnRails
[01:32:54] jun: has joined #RubyOnRails
[01:33:04] hnanon: Ok, I was just looking for something here: http://www.davidverhasselt.com/set-attributes-in-activerecord/
[01:33:20] tubbo: has joined #RubyOnRails
[01:35:48] garbansos: has left #RubyOnRails: ()
[01:37:38] mices: i'm validating a hidden field and the browser complains it can't be blank <%= hidden_field_tag(:country, "United States") %>
[01:38:30] a1fa_: has joined #RubyOnRails
[01:38:47] framlinqp: has joined #RubyOnRails
[01:41:40] hnanon: rushed: Thanks alot for your help.
[01:41:54] hnanon: I finally have a rudimentary solution working.
[01:42:10] benlieb: has joined #RubyOnRails
[01:42:25] htmldrum: has joined #RubyOnRails
[01:45:12] smathy: has joined #RubyOnRails
[01:47:59] Flyy7: has joined #RubyOnRails
[01:48:30] mices: my problem is explained in the comment https://gist.github.com/mices/405123bbbbe24d20caf5
[01:54:15] mices: my browser complains password and country can't be blank even when password and confirm_password are filled in and country is a hidden field, password is actually password_digest in the model
[01:54:51] mices: and password's not even listed in validate in my model
[01:55:06] sevenseacat: thats right, but has_secure_password will validate it.
[01:55:06] Cervajz: has joined #RubyOnRails
[01:55:30] sevenseacat: and your hidden field isnt in the data you're passing to the model.
[01:56:32] ruurd: has joined #RubyOnRails
[01:59:25] bonhoeffer: has joined #RubyOnRails
[01:59:42] glennt: has joined #RubyOnRails
[02:00:01] bonhoeffer: my migrations aren???t showing up in schema.rb ??? what causes that to update?
[02:00:42] rushed: bonhoeffer: migrating
[02:00:59] rushed: bonhoeffer: also, there aren't may situations where you should care about the schema.rb
[02:01:00] bonhoeffer: hmm . . . my migrations aren???t changing the schema
[02:01:34] bonhoeffer: yeah ??? i???m having the PG::UndefinedTable: ERROR: relation "tracks_users" does not exist error and wish i saw it there ??? looking in pgsql directly now
[02:01:57] rushed: bonhoeffer: spoiler alert, you don't have a tracks_users table
[02:02:12] glennt: has joined #RubyOnRails
[02:02:32] bonhoeffer: yes ??? despite a successful migration: ???create_table :tracks_users, id: false do |t|??? . . .
[02:02:50] simplyianm: has joined #RubyOnRails
[02:03:00] bonhoeffer: got: == 20151011231619 CreateTracksUsersJoinTable: migrating ======================= -- create_table(:tracks_users, {:id=>false})
[02:03:14] mices: sevenseacat: but password and confirmed_password are filled in and why isn't the hidden field being passed to the model?
[02:03:24] rushed: bonhoeffer: perhaps you didn't migrate the db you think you did?
[02:03:26] sevenseacat: mices: are they?
[02:03:35] bonhoeffer: rushed: that is my theory
[02:03:38] sevenseacat: mices:check your params and see what yiou're passing to the model.
[02:04:14] rushed: and/or look in the terminal when you make the request
[02:05:07] rushed: all that stuff scrolling by... it's not just pretty blinkenlights to complement your tunes~
[02:05:07] sevenseacat: you've only given us half the information, so we can't tell you *why* things are happening, we can only tell you *what* is happening.
[02:05:16] A124: has joined #RubyOnRails
[02:06:03] bonhoeffer: rushed: public | tracks_users is in the db . . hmm
[02:07:42] Radar: bonhoeffer: If you want help with the issue, we'll need to see the complete output for the error.
[02:07:48] Radar: The error message itself is 1/10th of what is useful
[02:08:03] bonhoeffer: sure ??? it was an ongoing dialogue with rushed
[02:08:33] bonhoeffer: but i think i know my error now ??? i have different databases in different git branches
[02:08:44] bonhoeffer: but the migrations don???t take that into account
[02:09:12] Radar: migrations only run on whatever database is configured at the time
[02:09:19] Radar: migrations do not know about the databases configured on other branches
[02:09:23] Radar: migrations are not God
[02:09:42] rushed: any sutuation where they would need to know something like that would be highly suspicious
[02:09:56] hephaestus_rg: has joined #RubyOnRails
[02:10:12] bonhoeffer: i thought the db stored the last run migration
[02:10:15] ruurd: has joined #RubyOnRails
[02:10:31] Radar: It does. If you're changing databases depending on the branch, it's going to be looking that up in separate locations.
[02:11:02] kalusn: has joined #RubyOnRails
[02:12:15] Kerber0s_: has joined #RubyOnRails
[02:15:42] dopamean_: has joined #RubyOnRails
[02:16:14] mices: sevenseacat: ty i forgot to include them
[02:17:42] nettoweb: has joined #RubyOnRails
[02:17:42] stannard: has joined #RubyOnRails
[02:20:24] i: has joined #RubyOnRails
[02:21:34] mices: sevenseacat: use :password_digest in params.require in the controller?
[02:21:50] sevenseacat: mices: are you submitting password_digest from the form?
[02:22:36] robbyoconnor: has joined #RubyOnRails
[02:22:46] mices: the form was created by the scaffold generater it has password and confirmed_password
[02:22:53] mices: generator
[02:23:02] sevenseacat: why would you permit it if you're not even submitting it?
[02:24:00] ruurd: has joined #RubyOnRails
[02:24:00] mices: it's a hash composed of password and confirmed_password
[02:24:01] bonhoeffer: is it bad practice to load has_many assocations in a Factory?
[02:24:08] mices: i thought it understood
[02:24:13] helpa: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us.
[02:24:31] sevenseacat: mices: understood what?
[02:24:42] sevenseacat: it is code. it does not 'understand' anything. it does what you tell it to do.
[02:24:57] helpa: http://i.imgur.com/tyViD.gif
[02:25:05] bonhoeffer: Radar: not sure if the rule0 is my reference ??? if so, I???m just asking a general question
[02:25:26] mices: that there's only one password field in the model, it's called password_digest and understands that password and confirmed_password get insert into password_digest as a hash value
[02:25:52] sevenseacat: has_secure_password provides that functionality, yes. what does that have to do with the problem?
[02:26:16] Radar: bonhoeffer: We have played this game so many times :(
[02:26:18] sevenseacat: (hint: the answer is 'nothing')
[02:26:20] yfeldblum: has joined #RubyOnRails
[02:26:33] bonhoeffer: Radar: really? I think you have me confused
[02:26:36] Radar: bonhoeffer: Showing code is ALWAYS better than not showing code.
[02:26:40] Radar: I play it a lot.
[02:26:53] Radar: Guaranteed that because you've been here for so long I've played it with you at least a dozen times.
[02:28:52] yfeldblum: has joined #RubyOnRails
[02:30:02] bonhoeffer: well, there is no code to show . . . but I???ll create some to experiment with my question
[02:30:22] yfeldblum: has joined #RubyOnRails
[02:30:42] VeryBewitching: ACTION gives Radar a beer.
[02:30:42] mices: sevenseacat: since i'm using has_secure_password i shouldn't have listed :password_digest in params.require ?
[02:31:01] sevenseacat: [10:21:49] sevenseacat: mices: are you submitting password_digest from the form?
[02:31:09] sevenseacat: [10:23:01] sevenseacat: why would you permit it if you're not even submitting it?
[02:31:11] VeryBewitching: mices: :password, :password_confirmation
[02:31:43] VeryBewitching: Provided :password validates with confirm
[02:32:26] losvedir: has joined #RubyOnRails
[02:32:39] mices: i see, i'm looking at my params.require list backwards
[02:33:00] sevenseacat: it appears so.
[02:33:22] mices: it's not what's in the model it's what i'm accepting from the form
[02:34:26] sevenseacat: thats exactly what the permit list in your controller is for, yes.
[02:34:51] bonhoeffer: is there a way to see your db connection string at runtime?
[02:35:18] Radar: bonhoeffer: "db connection string"? Do you have an example?
[02:36:06] bonhoeffer: no, not for rails (or the pg gem) but I???m imagining there is a dbi or odbc connection that is being used
[02:36:46] bonhoeffer: ActiveRecord::Base.connection.current_database <??? might be what i???m after
[02:40:09] rushed: bonhoeffer: this might be a good time to verify that production dbs are unreachable from your dev machine~
[02:40:29] helpa: http://i.imgur.com/tyViD.gif
[02:40:36] bonhoeffer: interesting . . . good point and they are
[02:41:10] Sam_Gerber: has joined #RubyOnRails
[02:42:51] antn: has joined #RubyOnRails
[02:45:15] disl: has joined #RubyOnRails
[02:45:39] CanTonic: has joined #RubyOnRails
[02:46:01] rickmasta: has joined #RubyOnRails
[02:46:23] antn: has joined #RubyOnRails
[02:46:42] beast: has joined #RubyOnRails
[02:46:56] richipargo: has joined #RubyOnRails
[02:46:58] rickmasta: has joined #RubyOnRails
[02:47:36] rickmasta: has joined #RubyOnRails
[02:50:02] IFrank00: has joined #RubyOnRails
[02:52:42] bruno-: has joined #RubyOnRails
[02:54:12] PhantomSpank: has joined #RubyOnRails
[02:54:22] IFrank00: Hi I have a Div with a button to toggle Hide and show another div under the first one I have it in a rails Block. now on my query script I need to make the ID of each div different. How can I pass the task id on the record to jquery to use it as this ( id="div-#{task.id}") on the div
[02:55:43] mices: sevenseacat: my hidden_field_tag is no good?
[02:55:55] sevenseacat: define 'no good'
[02:56:40] mices: isn't passing the value to the controller
[02:56:54] mices: the field
[02:57:15] pydave6367: has joined #RubyOnRails
[02:57:28] sevenseacat: again, check your logs tosee what data is getting submitted.
[02:59:08] hephaestus_rg: has joined #RubyOnRails
[02:59:23] rushed: IFrank00: http://railscasts.com/episodes/324-passing-data-to-javascript
[02:59:51] IFrank00: rushed, thnk I check it out
[03:01:22] Radar: mices: protip: show an error message when you encounter one if you want help with that error message
[03:05:13] mices: https://gist.github.com/mices/225cb1117a7c6f177d8b
[03:05:37] sevenseacat: see, there's your country field, right at the end
[03:05:39] mices: ":country" is preceeded by a closing }
[03:06:09] sevenseacat: yes, because it's not part of the hash of user data you're submitting
[03:06:18] Radar: mices: show the form again please
[03:07:46] Radar: https://gist.github.com/mices/225cb1117a7c6f177d8b#file-_form-html-erb-L42
[03:07:57] Radar: that should be f.hidden_field :country, "United States"
[03:10:43] glennt: has joined #RubyOnRails
[03:11:04] mices: i should have figured that out myself, sorry
[03:13:27] glennt: has joined #RubyOnRails
[03:13:59] jamto11: has joined #RubyOnRails
[03:14:19] braincrash: has joined #RubyOnRails
[03:14:22] junior: has joined #RubyOnRails
[03:15:01] Radar: First one's free :)
[03:16:12] sdwrage: has joined #RubyOnRails
[03:16:59] Oog: has joined #RubyOnRails
[03:17:31] mices: undefined method `merge' for "United States":String
[03:18:38] Radar: mices: c'mon
[03:19:06] VeryBewitching: ACTION gives Radar another beer.
[03:20:13] towski_: has joined #RubyOnRails
[03:21:02] kalusn: has joined #RubyOnRails
[03:24:06] safety_cut: has joined #RubyOnRails
[03:26:07] jamto11: has joined #RubyOnRails
[03:26:48] VeryBewitching: Beverage.for :adult, type: person.drink_preference
[03:26:53] VeryBewitching: Does that work well?
[03:27:05] junior: has joined #RubyOnRails
[03:27:18] Aeyrix: Fuck I could do with an alcoholic beverage right now.
[03:27:21] Aeyrix: Buying cognac after work.
[03:27:29] benlieb: I have a rails app that I haven't touched for years that has currently started throwing the following error, preventing all purchases. It seems to be coming from Active Merchant trying to connect to Authorize.net. https://gist.github.com/benlieb/e28e6ebd69ffbf3bb239
[03:28:24] benlieb: Does anyone have any ideas on what might be going on? I'm not sure where to start. The SSL cert for the site itself seems fine... could it be that Authorize.net has changed something?
[03:28:45] Aeyrix: >ruby-enterprise-1.8.7
[03:28:46] uranther: has joined #RubyOnRails
[03:29:51] Aeyrix: it's archaic
[03:31:12] VeryBewitching: benlieb: Have you verified the cert being sent by Authorize.net?
[03:31:50] benlieb: VeryBewitching: no. I'm not sure how to do that quite yet
[03:31:53] VeryBewitching: benlieb: Just to be sure it's not a problem at the other end.
[03:32:27] benlieb: still trying to track down how to do that. You know?
[03:32:48] VeryBewitching: benlieb: Connect to the URL the library is connecting to with a web browser and check the CERT. That's probably the first thing I'd try to do just to rule out a bad CERT on their side.
[03:33:32] benlieb: VeryBewitching: that sounds right. Still looking for that url. I wonder if it's buried in Active Merchant
[03:34:57] benlieb: ::AUTH_NET_GATEWAY = ActiveMerchant::Billing::AuthorizeNetCimGateway.new cim_access_info
[03:35:05] benlieb: Looks like maybe buried in there. Ug.
[03:38:09] siddart: has joined #RubyOnRails
[03:38:12] VeryBewitching: benlieb: It may depend on the version of the API in use by whichever version of ActiveMerchant that is.
[03:38:23] VeryBewitching: https://api2.authorize.net/xml/v1/request.api is what's in master on GitHub
[03:40:05] riotjones: has joined #RubyOnRails
[03:40:21] benlieb: Really old AM: activemerchant (1.17.0)
[03:40:51] inoter: has joined #RubyOnRails
[03:41:52] benlieb: VeryBewitching: what am I supposed to see at that url?
[03:42:13] VeryBewitching: The green lock, if you see it in the address bar, click on it.
[03:42:16] benlieb: oh, that's just what is in AM
[03:42:20] VeryBewitching: If it's green it generally means it's OK
[03:43:24] rushed: has joined #RubyOnRails
[03:43:59] Cervajz: has joined #RubyOnRails
[03:44:21] sunya7a: has joined #RubyOnRails
[03:45:31] sunya7a: having trouble initializing a new rails 5 app. I've cloned the rails app from github and tried to run rails new...getting LoadError on config/boot ... but the rails repo has no config folder...anyone run into this?
[03:46:25] VeryBewitching: benlieb: The URI in your version of Active Merchant and the current are different.
[03:46:36] benlieb: VeryBewitching: https://api.authorize.net/xml/v1/request.api
[03:46:40] benlieb: is what I found
[03:47:11] VeryBewitching: benlieb: https://www.omniref.com/ruby/gems/activemerchant/1.17.0/symbols/ActiveMerchant::Billing::AuthorizeNetGateway::API_VERSION
[03:47:15] rushed: sunya7a: rails 5 isn't out yet
[03:47:17] sevenseacat: has joined #RubyOnRails
[03:47:32] benlieb: VeryBewitching: but the ssl cert in the browser seems fine?
[03:47:34] safety_c_: has joined #RubyOnRails
[03:47:47] VeryBewitching: benlieb: For that URI yes.
[03:48:12] VeryBewitching: If you're using ActiveMerchant 1.17.0 then the above is the source where the URI is.
[03:48:19] crdpink2: has joined #RubyOnRails
[03:48:30] sunya7a: rushed: i'm aware...I want to try it out...following this http://wyeworks.com/blog/2015/6/30/how-to-build-a-rails-5-api-only-and-ember-application
[03:48:40] VeryBewitching: benlieb: https://secure.authorize.net/gateway/transact.dll is the URI in your source.
[03:50:06] VeryBewitching: benlieb: There's an API application at that URI it looks like, and the CERT is good, so it's on your side of the fence at this point.
[03:50:39] rushed: sunya7a: if you're just trying to follow allong you might condier trying to checkout a hash from the timeframe the article was written
[03:51:13] rushed: sunya7a: but edge is a moving target so safety not guaranteed~
[03:51:51] sunya7a: rushed: good idea...thanks
[03:56:08] moeabdol: has joined #RubyOnRails
[03:58:21] djbkd: has joined #RubyOnRails
[03:58:34] johnflux: has joined #RubyOnRails
[04:03:41] baweaver: has joined #RubyOnRails
[04:04:27] benlieb: VeryBewitching: Your connection is encrypted using an obsolete cipher suite.
[04:04:29] benlieb: Could this be it?
[04:06:46] benlieb: Aeyrix: that for me?
[04:07:14] l_tonz: has joined #RubyOnRails
[04:07:37] benlieb: That message is shown under cert in chrome
[04:08:30] l_tonz: has joined #RubyOnRails
[04:10:17] benlieb: Aeyrix: VeryBewitching: why would that affect the rails app trying to connect to auth.net?
[04:10:47] rushed: benlieb: it wouldn't
[04:11:12] rushed: benlieb: depending on your installation ruby may or may not be using the same certificate store are your browser
[04:11:21] rushed: benlieb: best method to test would be from the console
[04:11:29] rushed: benlieb: *rails console
[04:12:25] Bilbo-baggons: has joined #RubyOnRails
[04:13:05] iamjarvo_: has joined #RubyOnRails
[04:13:49] jun_: has joined #RubyOnRails
[04:14:05] pawnbox: has joined #RubyOnRails
[04:14:39] pontiki: has joined #RubyOnRails
[04:15:46] Scripore: has joined #RubyOnRails
[04:18:08] baweaver: has joined #RubyOnRails
[04:18:18] jun_: has joined #RubyOnRails
[04:22:42] l_tonz: has joined #RubyOnRails
[04:23:27] benlieb: rushed: it's coming from the attempted connection to authorize.net response = AUTH_NET_GATEWAY::get_customer_profile({:customer_profile_id => cim_profile_id})
[04:23:48] rushed: benlieb: "it's" = ?
[04:24:02] benlieb: the ssl error, sorry
[04:24:13] benlieb: https://gist.github.com/benlieb/e28e6ebd69ffbf3bb239
[04:24:55] benlieb: technically net/http.rb:586:in `connect'
[04:25:12] Aeyrix: alright so
[04:25:15] Aeyrix: i'm not going to give you the answer
[04:25:19] Aeyrix: because it's literally the first damn result
[04:25:20] Aeyrix: on Google
[04:25:27] Aeyrix: with a response marked as correct
[04:25:31] michael_mbp: has joined #RubyOnRails
[04:25:45] jamto11: has joined #RubyOnRails
[04:26:54] Guest49: has joined #RubyOnRails
[04:27:11] benlieb: Aeyrix: I'd be interested in that, but I"m not sure what you searched. I haven't found an easy answer.
[04:27:15] l_tonz: has joined #RubyOnRails
[04:27:18] benlieb: are you referring to this? http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat
[04:28:03] benlieb: loooots of answers there
[04:28:10] benlieb: which one are you referring to?
[04:28:12] Aeyrix: so what you're saying is
[04:28:22] Aeyrix: "can you please help me find the answer because I can't search myself"
[04:28:29] Aeyrix: http://stackoverflow.com/questions/10728436/opensslsslsslerror-ssl-connect-returned-1-errno-0-state-sslv3-read-server-c
[04:28:41] mices: still getting Country can't be blank https://gist.github.com/mices/225cb1117a7c6f177d8b
[04:28:49] Aeyrix: the fact that this is in the first couple of results on Google is kind of disappointing
[04:28:56] Aeyrix: idk how you can do whatever job you do that involves a rails app
[04:28:58] Aeyrix: if you can't even google search
[04:29:09] Aeyrix: god forbid you have to maybe look up something in the rails api docs
[04:29:24] rushed: mices: "i)"=>"12"}, "country"=>"Un" <= see that }
[04:29:35] rushed: mices: I wonder if that's where you want that }
[04:29:58] rushed: mices: it's like { cool party in here } lonely country out here
[04:30:11] benlieb: Aeyrix: of the many answers there, to which are you referring?
[04:30:32] rushed: mices: and didn't someone point out why that was happening due to the construction of your form?
[04:30:39] Aeyrix: benlieb: ... the one with the massive green tick next to it?
[04:30:50] Guest49: has left #RubyOnRails: ()
[04:31:07] benlieb: oops, I meant rushed who was referring to this http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat
[04:31:28] sevenseacat: mices: please update the development.log in that gist
[04:31:46] benlieb: Aeyrix: this app has been running untouched for years, and this error is new
[04:32:28] benlieb: Just because a green check exists for one problem, this doesn't mean is is necessarily a solution for everyone.
[04:32:32] l_tonz: has joined #RubyOnRails
[04:32:43] Aeyrix: But I'm sure you've tried that solution and checked what the solution explains, right?
[04:33:08] Aeyrix: Given the fact that every single time I've seen this error come up in this channel, the solution has been something along those lines, I find it almost astronomically unlikely that you've even looked at that answer.
[04:33:18] Aeyrix: You've probably just seen that it's more than few lines hand-fed to you and tapped out because it's "too hard".
[04:33:43] benlieb: Aeyrix: yes that's what's happened.
[04:33:50] Aeyrix: Respect the time of the people who are in here, taking time out of their day to help assist people and passing on their knowledge. Fucking use Google.
[04:34:11] snarkfest: has joined #RubyOnRails
[04:36:42] mices: sevenseacat: ok check now
[04:37:16] sevenseacat: mices: that doesnt come from that form.
[04:38:17] rushed: mices: hmm
[04:38:24] mices: sevenseacat: look now
[04:39:09] sevenseacat: mices: still doesnt come from that form.
[04:40:08] sunya7a: has joined #RubyOnRails
[04:41:08] riotjones: has joined #RubyOnRails
[04:43:44] l_tonz: has joined #RubyOnRails
[04:45:32] Radar: mices: Close your browser.
[04:45:36] Radar: mices: Then re-open it.
[04:45:55] Aeyrix: >inb4 spring
[04:46:54] moei: has joined #RubyOnRails
[04:46:56] l_tonz: has joined #RubyOnRails
[04:47:28] Radar: It's that mices is probably hitting refresh on the request, rather than refreshing the form and filling it out again
[04:47:49] sunya7a: has joined #RubyOnRails
[04:47:51] sevenseacat: ah didn't even think of that.
[04:48:00] sevenseacat: would explain it.
[04:51:49] l_tonz: has joined #RubyOnRails
[04:52:29] litonico_: has joined #RubyOnRails
[04:53:12] armyriad: has joined #RubyOnRails
[04:53:16] litonico__: has joined #RubyOnRails
[04:54:29] armyriad: has joined #RubyOnRails
[04:55:28] armyriad: has joined #RubyOnRails
[04:55:48] Radar: mices: Fixed?
[04:56:13] armyriad: has joined #RubyOnRails
[04:56:26] litonico__: Hey all! I'm struggling with running a subset of tests in Rails: I'd like to run just, say, the 'test/lib' tests. However, Rails has registered a Rake::TestTask to run EVERYTHING that I can't find or disable-- how do I find this and kill it?
[04:56:48] simplyianm: has joined #RubyOnRails
[04:56:56] arup_r: has joined #RubyOnRails
[04:58:07] sevenseacat: Aeyrix: or that.
[04:58:14] sevenseacat: fucking spring.
[04:58:18] Aeyrix: Every time.
[04:58:29] Radar: litonico__: "rake test test/lib" should do that automatically.
[05:00:43] Radar: ACTION must be sitting in some kind of... time dampening vortex.
[05:00:51] Radar: Could've sworn IRC was quicker than this before.
[05:02:04] Radar: mices: I'm going to assume your house is burning down or you're watching cute cat videos on the 'net instead of replying to me.
[05:02:28] Radar: mices: Is it OK if I take > 10 minutes to reply to your questions?
[05:02:32] litonico__: Radar: thanks! one sec, I'm giving that a shot
[05:02:34] Radar: mices: Please stay quiet if so.
[05:04:58] sevenseacat: glad that got confirmed!
[05:05:27] simplyianm: has joined #RubyOnRails
[05:05:28] litonico__: Radar: it looks like `rake test test/lib` is running controller and model tests as well, I'm afraid...
[05:05:47] Radar: litonico__: Weird. How about bin/rake test test/lib?
[05:06:00] Radar: If that's the case, then http://guides.rubyonrails.org/testing.html#running-tests is wrong :)
[05:06:36] simplyianm: has joined #RubyOnRails
[05:07:39] litonico__: Radar: nope-- still four dots (model, controller, view, lib) rather than one
[05:07:48] Radar: litonico__: Sorry then, I don't know the answer to that one.
[05:07:52] Radar: Looks like the docs are wrong.
[05:07:52] dhjondoh: has joined #RubyOnRails
[05:08:26] litonico__: May be a bit too hacky, but is there a way to modify/unregister the base TestTask?
[05:09:13] litonico__: Radar: (thank you, by the way, for helping rather than just linking me to docs)
[05:10:43] Radar: https://github.com/rails/rails/issues/21935
[05:11:02] chrissonar: has joined #RubyOnRails
[05:11:09] litonico__: awesome, thank you!
[05:12:11] quazimodo: possible to add a class to a wrapper if disabled: true with simple_form's wrapper api
[05:12:31] litonico__: Radar: It works for single files, but not at all for dirs
[05:12:40] Radar: litonico__: oh
[05:13:09] litonico__: Radar: so I guess the docs are *technically* correct, but deeply unhelpful
[05:13:33] Radar: litonico__: looks like it works with `test/models/*`.
[05:14:52] Peteykun: has joined #RubyOnRails
[05:15:46] stardiviner: has joined #RubyOnRails
[05:20:12] lxsameer: has joined #RubyOnRails
[05:20:27] litonico__: Radar: ok, that's roughly what I needed!
[05:27:27] mloy_: Does anybody have any open source Rails projects that I could check out and potentially contribute to?
[05:27:36] mloy_: I'm trying to get more involved in foss
[05:29:28] Radar: mloy_: github.com/radar/forem
[05:29:38] sevenseacat: mloy_: http://www.codetriage.com/
[05:29:38] Radar: https://github.com/solidusio/solidus
[05:29:55] litonico__: mloy_: is there anything that _really annoys you_ about rails? I've found that fixing those things is the easiest way to get started!
[05:32:01] iliketurtles: has joined #RubyOnRails
[05:32:54] Cervajz: has joined #RubyOnRails
[05:33:12] mloy_: Radar, sevenseacat, thanks!
[05:33:38] mloy_: litonico__, well I didn't mean contributing to rails itself but that could be interesting!
[05:34:32] Oog: has joined #RubyOnRails
[05:38:43] arup_r: good morning!
[05:38:49] IFrank00: has joined #RubyOnRails
[05:39:24] Jasaka: has joined #RubyOnRails
[05:39:46] mloy_: arup_r, howdy!
[05:40:00] arup_r: mloy_: nice morning it is.. :D
[05:40:54] pawnbox: has joined #RubyOnRails
[05:40:58] raunicolae: has joined #RubyOnRails
[05:41:03] tagrudev: has joined #RubyOnRails
[05:41:50] MartinElvar: has joined #RubyOnRails
[05:41:51] riotjones: has joined #RubyOnRails
[05:42:36] riotjones: has joined #RubyOnRails
[05:42:37] arup_r: mloy_: Trying to learn CSS ... I am on that now a days.
[05:43:35] riotjones: has joined #RubyOnRails
[05:46:07] tjbiddle: has joined #RubyOnRails
[05:53:53] pawnbox: has joined #RubyOnRails
[05:54:50] DoubleMalt: has joined #RubyOnRails
[05:55:14] dionysus69: has joined #RubyOnRails
[05:55:21] IFrank00: Any help trying to pass a dynamic div id from rails to js to do a hide and show
[05:55:32] pawnbox_: has joined #RubyOnRails
[05:55:50] sevenseacat: [10:59:22] rushed: IFrank00: http://railscasts.com/episodes/324-passing-data-to-javascript
[05:55:57] sevenseacat: that was three hours ago
[05:56:12] mloy_: arup_r, have you tried SCSS? I like working with it a lot more than vanilla CSS
[05:57:02] sevenseacat: using scss without knowing css is like trying to learn rails without knowing rub.... ah, forget it. commence shooting yourself in the foot.
[05:58:08] lukekhamilton: has joined #RubyOnRails
[05:58:34] trautwein: has joined #RubyOnRails
[06:02:47] pydave6367: has joined #RubyOnRails
[06:03:43] Bilbo-baggons: has joined #RubyOnRails
[06:04:42] aganov: has joined #RubyOnRails
[06:06:08] arup_r: mloy_: Yes, I am writing SCSS only. Having a deeper look https://css-tricks.com/snippets/css/a-guide-to-flexbox/
[06:06:24] arup_r: If you know any more good links, let me know :)
[06:06:46] arup_r: It will take time for me I feel... CSS is harder than Ruby for me :D
[06:07:03] IFrank00: sevenseacat, I create a div with data-id and pass my the dynamic id there but im not that good on js so what I have is nothing like this but get error https://gist.github.com/Frank004/2aefbd71ed272f6a2ed5
[06:07:16] pawnbox: has joined #RubyOnRails
[06:07:31] netzfisch: has joined #RubyOnRails
[06:07:38] sevenseacat: IFrank00: I'm not a mindreader. I can't see what error you're getting, or what HTML is causing it.
[06:07:42] baweaver: has joined #RubyOnRails
[06:08:11] sevenseacat: IFrank00: but this $('#button_details').data('id') will return you a string value
[06:08:18] sevenseacat: which you can't set a click handler on
[06:08:39] pawnbox_: has joined #RubyOnRails
[06:08:39] sevenseacat: click handlers go on DOM elements
[06:09:39] arup_r: $('#button_details[data-id='val']').click(.... this way
[06:09:55] dionysus69: how do I test if sass gem got imported correctly? I see bootstrap doesn't work as intended
[06:10:08] arup_r: IFrank00: Your code JS is wrong. sevenseacat is right and said already I see now
[06:11:09] sevenseacat: IFrank00: I'm guessing you're storing another element ID in $('#button_details').data('id') - in which case, you need to look up that DOM element (eg. $("#" + $('#button_details').data('id')))
[06:11:10] arup_r: One more thing. Do you have more than one button with same `ID` ? It seems so. If you have it is not valid, make them CSS `CLASS`.
[06:11:38] rvanlieshout: has joined #RubyOnRails
[06:14:33] IFrank00: sevenseacat, I add the view code and try to explain has best
[06:15:31] michael_mbp: has joined #RubyOnRails
[06:15:55] nya: has joined #RubyOnRails
[06:16:09] sevenseacat: feedback cycles are best when they're *short*.
[06:16:55] IFrank00: arup_r, I got 2 Div one with a button and mother is the info that I need to hide and show the div are in a rails Block getting each record. I was looking for a way to pass a dynamic id so and the get that id dynamic in the js file
[06:19:07] arup_r: IFrank00: You can set the id, when you are rendering the view. Did you do till that?
[06:20:02] IFrank00: https://gist.github.com/Frank004/2aefbd71ed272f6a2ed5
[06:21:58] quazimodo: this Her gem is giving me grief constantly
[06:22:11] Radar: that's nice dear
[06:23:07] herbst: has joined #RubyOnRails
[06:23:26] arup_r: IFrank00: You have different ID to the 2 buttons. That is cool. Why then you need to consider data-id in Jquery ? I am confused.
[06:25:17] IFrank00: arup_r, I dont need the data-id Im just looking for a way to have a dynamic num in the id using the id of the record and the passing it to js
[06:25:44] CheckYourSix: has joined #RubyOnRails
[06:26:11] eGGsha: has joined #RubyOnRails
[06:26:34] IFrank00: arup_r, ill update the code so what i like to do. to see if you can help me I have look for hours on this thank you
[06:26:50] arup_r: ok. I can help you if I understand you..
[06:27:21] arup_r: ACTION thinks if IFrank00 is his client, can fire a quick skype to him.. :D
[06:28:13] arup_r: it seems so easy, but we have communication/understanding issue, which makes it complicated.. lol
[06:29:36] arBmind: has joined #RubyOnRails
[06:30:19] IFrank00: arup_r, https://gist.github.com/Frank004/2aefbd71ed272f6a2ed5
[06:31:05] arup_r: JS don't understand ERB, Bro :(
[06:31:59] arup_r: Can you just write down your requirement ?
[06:32:08] IFrank00: arup_r, yes I know im trying to explain what I need
[06:32:09] arup_r: What you want to achieve ?
[06:32:22] srinidhi: has joined #RubyOnRails
[06:32:37] sdwrage: has joined #RubyOnRails
[06:33:17] arup_r: let me write in the Gist
[06:34:28] arup_r: On button click you want to make an Ajax call ?
[06:34:30] IFrank00: arup_r, Ok I have a rails block each div has a id that is dynamic as you can see know I like to call in js the dynamic id I know js dont do erb I just put it there so you can get what I like to achieve
[06:35:12] pydave6367: has joined #RubyOnRails
[06:36:01] IFrank00: arup_r, is a ajax call will solve my problem Im all ok as is just a simple hide and show div. I dont know why is so hard to find a way :/
[06:36:13] tetraktys: has joined #RubyOnRails
[06:36:14] arup_r: give me a moment.. I am writing there
[06:36:24] IFrank00: arup_r, maybe im over looking it
[06:36:32] IFrank00: arup_r, thank you
[06:36:34] arup_r: I got what you want
[06:38:15] waseem_: has joined #RubyOnRails
[06:38:19] bmalum: has joined #RubyOnRails
[06:40:27] arup_r: IFrank00: check my comment
[06:43:17] speakingcode: has joined #RubyOnRails
[06:44:15] Spami: has joined #RubyOnRails
[06:44:16] Sam_Gerber: has joined #RubyOnRails
[06:45:23] IFrank00: arup_r, ok im testing it
[06:45:36] arup_r: sure.. I hope you got the idea.
[06:45:41] comrad: has joined #RubyOnRails
[06:46:49] sevenseacat: that looks amazingly like what I wrote half an hour ago lol
[06:46:55] sevenseacat: ACTION shrugs
[06:48:37] speakingcode: has joined #RubyOnRails
[06:51:11] artto: has joined #RubyOnRails
[06:51:30] kwd: has joined #RubyOnRails
[06:51:57] jas02: has joined #RubyOnRails
[06:52:05] tvw: has joined #RubyOnRails
[06:54:12] MaDErroR123: has joined #RubyOnRails
[06:56:40] speakingcode: has joined #RubyOnRails
[06:58:00] stardiviner: has joined #RubyOnRails
[07:01:36] IFrank00: sevenseacat, and arup_r thank you for taking time
[07:01:46] Cervajz: has joined #RubyOnRails
[07:01:59] speakingcode: has joined #RubyOnRails
[07:03:40] Cervajz_: has joined #RubyOnRails
[07:04:12] CheckYourSix: has joined #RubyOnRails
[07:04:56] towski_: has joined #RubyOnRails
[07:05:24] CanTonic: has joined #RubyOnRails
[07:06:26] artto: has joined #RubyOnRails
[07:06:38] eGGsha: has joined #RubyOnRails
[07:07:55] kalusn: has joined #RubyOnRails
[07:08:53] mattt: has joined #RubyOnRails
[07:09:44] bmalum: has joined #RubyOnRails
[07:11:12] madebymarkca: has joined #RubyOnRails
[07:12:39] speakingcode: has joined #RubyOnRails
[07:17:11] juhoh: has joined #RubyOnRails
[07:18:19] speakingcode: has joined #RubyOnRails
[07:19:07] dionysus69: has joined #RubyOnRails
[07:21:46] Cervajz: has joined #RubyOnRails
[07:21:54] DEA7TH: has joined #RubyOnRails
[07:22:53] Shoutsid: has joined #RubyOnRails
[07:23:46] speakingcode: has joined #RubyOnRails
[07:26:33] blackmes1: has joined #RubyOnRails
[07:31:30] SteenJobs: has joined #RubyOnRails
[07:31:47] lxsameer: has joined #RubyOnRails
[07:31:49] nfk|laptop: has joined #RubyOnRails
[07:33:49] blackmes1: has joined #RubyOnRails
[07:34:05] dionysus69: has joined #RubyOnRails
[07:35:01] speakingcode: has joined #RubyOnRails
[07:36:27] rubyonrails797: has joined #RubyOnRails
[07:39:34] n008f4g_: has joined #RubyOnRails
[07:40:29] speakingcode: has joined #RubyOnRails
[07:41:23] herbst: has joined #RubyOnRails
[07:42:16] wpp: has joined #RubyOnRails
[07:46:38] honzahovorka: has joined #RubyOnRails
[07:47:06] Ergo: has joined #RubyOnRails
[07:47:16] norc: has joined #RubyOnRails
[07:47:30] norc: Hi. Can someone explain to me this NameError to me? http://pastie.org/10476107
[07:48:02] Linuus: has joined #RubyOnRails
[07:48:19] speakingcode: has joined #RubyOnRails
[07:48:57] sevenseacat: norc: something is generating a wrong constant name. constants in Ruby start with an uppercase letter.
[07:49:28] sevenseacat: that code worked in my app, in rails 4.2.4 and ruby 2.2.2.
[07:49:29] norc: sevenseacat: Thank you, that gave me the answer. I added 'dsl' in smallcase letters as an acronym by accident. :=)
[07:49:42] sevenseacat: that'll do it ;)
[07:50:33] solars: has joined #RubyOnRails
[07:50:56] honzahovorka: has joined #RubyOnRails
[07:51:46] norc: sevenseacat: Somehow I feel a more descriptive error message would be useful there.
[07:52:36] sevenseacat: about the other thing more appropriate would be if 'wrong' was renamed 'invalid'
[07:53:07] sevenseacat: however, googling 'wrong constant name' gives you the problem in about 2.1 seconds
[07:53:19] norc: It could straight up say "Constant name is not uppercase"
[07:53:39] sevenseacat: but thats not the only time the error gets raised
[07:53:44] norc: sevenseacat: Yeah, my brain somehow froze at that point when I saw the error coming from the depths of rails.
[07:53:49] juhoh: has joined #RubyOnRails
[07:54:01] speakingcode: has joined #RubyOnRails
[07:57:00] sunya7a: has joined #RubyOnRails
[07:57:28] robbyoconnor: has joined #RubyOnRails
[07:58:38] alexhartley: has joined #RubyOnRails
[07:58:51] artto: has joined #RubyOnRails
[07:59:24] mark2: has joined #RubyOnRails
[07:59:32] alexhartley: has joined #RubyOnRails
[07:59:54] speakingcode: has joined #RubyOnRails
[08:00:53] pontiki: has joined #RubyOnRails
[08:02:50] jsrn_: has joined #RubyOnRails
[08:03:23] Ropeney: Anyone read `Ruby Performance Optmization by Alexander Dymo` ?
[08:05:22] pawnbox: has joined #RubyOnRails
[08:06:03] G: has joined #RubyOnRails
[08:06:47] SegFaultAX: has joined #RubyOnRails
[08:07:40] shmoon_: has joined #RubyOnRails
[08:08:47] youngbaks: has joined #RubyOnRails
[08:09:14] alexhart_: has joined #RubyOnRails
[08:09:31] Joufflu: has joined #RubyOnRails
[08:12:42] dionysus69: has joined #RubyOnRails
[08:13:11] speakingcode: has joined #RubyOnRails
[08:13:53] alexhartley: has joined #RubyOnRails
[08:14:55] alex88: has joined #RubyOnRails
[08:15:03] darutoko: has joined #RubyOnRails
[08:15:05] alexhart_: has joined #RubyOnRails
[08:15:43] alexhart_: has joined #RubyOnRails
[08:16:56] FailBit: >performant
[08:19:25] lukekhamilton: has joined #RubyOnRails
[08:21:21] Ropeney: FailBit: Have you read it though?
[08:21:54] tbuehlmann: the performance discussion, again? please just don't
[08:22:14] Ropeney: tbuehlmann: that book came up before, or performance in general?
[08:23:49] pawnbox: has joined #RubyOnRails
[08:28:05] Lytol: has joined #RubyOnRails
[08:32:42] Peteykun: has joined #RubyOnRails
[08:33:40] adre: has joined #RubyOnRails
[08:33:49] jaybedubb: has joined #RubyOnRails
[08:35:03] beauby: has joined #RubyOnRails
[08:35:15] roshanavand: has joined #RubyOnRails
[08:35:36] Kerber0s: has joined #RubyOnRails
[08:36:10] jaybedubb: hi.. can anyone help me - how can I check if a helper method exists from within a controller ?
[08:36:34] srinidhi: has joined #RubyOnRails
[08:37:10] arup_r: has joined #RubyOnRails
[08:37:29] rvanlieshout: jaybedubb: why would you only want to check if it exists?
[08:38:21] jaybedubb: i want to check for the existence of "#{x}_wrapper" .. and if it exists pass a block to that, otherwise just yield as normal
[08:38:29] habitullence: has joined #RubyOnRails
[08:38:47] rvanlieshout: ah right. you could try #defined?
[08:39:00] jaybedubb: ok.. lemme try that
[08:39:56] rvanlieshout: #respond_to? is better
[08:41:24] jaybedubb: i tried respond_to? already but that didn't work
[08:41:28] jaybedubb: defined? doesn't seem to work either
[08:42:19] jaybedubb: the issue seems to be if the method is within a controller and exposed as a helper via 'helper_method' then it will work
[08:42:33] jaybedubb: however respond_to? doesn't work if the method is actually defined within a helper itself
[08:42:41] jaybedubb: (even if that helper is actually being included)
[08:42:58] rvanlieshout: that's only because helper methods aren't meant to be called from controllers
[08:43:36] hamster88: has joined #RubyOnRails
[08:43:44] hamster88: Hello everyone :)
[08:44:30] hamster88: Can anyone tell me about a goood wysiwig editor with mardown functionality.. ?
[08:44:43] youngbaks: has joined #RubyOnRails
[08:44:50] rvanlieshout: doesn't wysiwyg conflict with markdown?
[08:45:27] hamster88: rvanlieshout, hmm so what you suggest i shall use for markdown?
[08:45:54] rvanlieshout: either markdown or a wysiwyg?
[08:45:56] hamster88: its a blog so ofcourse one would need a wysiwyg editor.
[08:46:02] rushed: hamster88: the point of markdown is you don't need to use anything special
[08:46:26] rushed: hamster88: you're building a blog in rails? you might consider... not doing that and using one of the existing platforms :)
[08:46:32] hamster88: rushed, agreed but when trying to do the syntax highlighting.. i might need it.
[08:47:13] rvanlieshout: syntax highlighing is something different
[08:47:16] rvanlieshout: it's not wysiwyg
[08:47:47] hamster88: rvanlieshout, right .. but aren't most of the wysiwyg's have syntax highlighting functionality?
[08:48:03] CheckYourSix: has joined #RubyOnRails
[08:48:05] rvanlieshout: wysiwyg is not writing code
[08:48:08] hamster88: like you can pass on a block to highlight the code you wrote.
[08:48:10] rvanlieshout: syntax highlighting is writing code
[08:49:10] hamster88: CKeditor actually did that highlighting stuff
[08:56:16] blackmes1: has joined #RubyOnRails
[08:56:30] Cervajz: has joined #RubyOnRails
[08:59:00] Cervajz__: has joined #RubyOnRails
[08:59:10] arBmind: has joined #RubyOnRails
[09:00:03] honzahovorka: has joined #RubyOnRails
[09:03:06] habitullence: has joined #RubyOnRails
[09:03:18] freezevee: has joined #RubyOnRails
[09:04:01] MartinElvar: has joined #RubyOnRails
[09:07:12] tetraktys: has joined #RubyOnRails
[09:07:28] robbyoconnor: has joined #RubyOnRails
[09:08:51] lucasr: has joined #RubyOnRails
[09:09:51] nfk|laptop: has joined #RubyOnRails
[09:15:20] longinustorwladz: has joined #RubyOnRails
[09:16:57] krisquigley: has joined #RubyOnRails
[09:18:43] xcm: has joined #RubyOnRails
[09:18:47] longinustorwaldz: has joined #RubyOnRails
[09:20:10] alexhartley: has joined #RubyOnRails
[09:20:31] pawnbox: has joined #RubyOnRails
[09:22:08] longinustorwaldz: Hello there everyone! My very first steps with RAILS. Lounched a droplet on DigitalOcena with Ubuntu 14.4 Nginx and Unicorn so it's a fresh install. When I try to follow Rails beginers tutorial I should see some errors like "Template is missing" etc.. But I can only see "We're sorry, but something went wrong.". It looks like production mode but when I type "rake about" I get "Environment development". Maybe the
[09:23:13] triangles2: has joined #RubyOnRails
[09:23:28] Peg-leg: has joined #RubyOnRails
[09:23:33] arup_r: has joined #RubyOnRails
[09:24:55] Scripore: has joined #RubyOnRails
[09:25:12] MaDErroR123: has joined #RubyOnRails
[09:25:14] rvanlieshout: longinustorwaldz: it's common to develop your rails application locally
[09:25:19] rvanlieshout: you don't need a vps for that
[09:25:36] Scripore: has joined #RubyOnRails
[09:26:46] longinustorwaldz: rvanlieshout: yes I konow but that was supposed to be the easy way having 10$ credit which was 2 months of usage...
[09:27:13] longinustorwaldz: is there some configuration option to see the errors via vps?
[09:27:16] rushed: longinustorwaldz: no, the easy way is to develop locally
[09:27:42] rushed: longinustorwaldz: errors are available in the logs in production and local
[09:27:49] uchihaitachi08: has joined #RubyOnRails
[09:28:03] Uptime: has joined #RubyOnRails
[09:28:15] Cervajz: has joined #RubyOnRails
[09:28:23] quazimodo: do we have nice helpers for things like activated_at:datetime
[09:28:42] quazimodo: u.update activated_at: DateTime.now; u.activated?
[09:28:46] quazimodo: anything like this exists?
[09:28:56] rvanlieshout: that's just an attribute assignment
[09:29:02] quazimodo: helper method like u.activated?
[09:29:12] rvanlieshout: u.update actived_at: Datetime.now if u.activated?
[09:29:14] quazimodo: i've seen rails do sneaky fun stuff like that
[09:29:19] rvanlieshout: Time.zone.now
[09:29:37] quazimodo: rvanlieshout: no no, i mean, if activated_at == some time, u.activated returns true
[09:29:42] quazimodo: else u.activated returns false
[09:29:53] quazimodo: i guess no nifty helpers like that exist unless it's a boolean
[09:29:56] arup_r: quazimodo: Rails give such a helper free when use boolean column or Enum stuff
[09:30:05] quazimodo: arup_r: yeah I thought so
[09:30:18] arup_r: but not for the one you are looking for.. :(
[09:30:20] honzahovorka: has joined #RubyOnRails
[09:30:20] rvanlieshout: quazimodo: i really don't understand what you mean
[09:30:25] quazimodo: arup_r: also i forwarded your details, manager says we aren't looking at any offshore workers atm
[09:30:45] rvanlieshout: quazimodo: activated => actived_at.present? or actived_at <= Time.zone.now
[09:33:12] quazimodo: rvanlieshout: it's all cool arup answered it well
[09:33:55] Hates_: has joined #RubyOnRails
[09:34:20] stardiviner: has joined #RubyOnRails
[09:34:35] beauby: has joined #RubyOnRails
[09:36:50] arup_r: quazimodo: See if it fits http://api.rubyonrails.org/classes/ActiveModel/Dirty.html#method-i-changed-3F . But it is not what exactly what you asked. But have a look at it
[09:42:55] Trynemjoel: has joined #RubyOnRails
[09:43:07] jgt: has joined #RubyOnRails
[09:50:01] michael_mbp: has joined #RubyOnRails
[09:50:18] alexhart_: has joined #RubyOnRails
[09:50:39] bonhoeffer: has joined #RubyOnRails
[09:51:41] digitalknk: has joined #RubyOnRails
[09:51:41] MaDErroR123: has joined #RubyOnRails
[09:54:41] alexhartley: has joined #RubyOnRails
[09:56:06] alexhart_: has joined #RubyOnRails
[09:56:45] yfeldblum: has joined #RubyOnRails
[09:57:02] dionysus69: has joined #RubyOnRails
[09:57:40] bonhoeffer: is there a way to update_attributes for child attributes? (i.e. not book.authors.push(author); book.save!) but something like book.update_attributes(authors: [author])?
[09:59:09] arup_r: seems to be work. Did you try ?
[10:00:08] arup_r: ok. Possible if you have http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html in the model
[10:00:36] arup_r: Look at the doc examples. author_attributes=(attributes) and pages_attributes=(attributes).
[10:01:04] arup_r: If I make you confused, re-ask me
[10:01:05] rvanlieshout: bonhoeffer: book.authors << author
[10:01:12] Dreeg: has joined #RubyOnRails
[10:01:17] arup_r: ^^ that is very easy
[10:01:24] arup_r: go with that
[10:01:31] bonhoeffer: rvanlieshout: of course ??? but you have to then save the book
[10:01:40] arup_r: bonhoeffer: No
[10:01:41] pontiki: has joined #RubyOnRails
[10:01:59] bonhoeffer: two lines ??? not much of a problem, but I was curious if there was an existing method
[10:02:35] arup_r: bonhoeffer: You don't need to call if parent is persisted
[10:02:41] arup_r: call .save
[10:02:52] rvanlieshout: that one will save it directly indeed
[10:03:16] bonhoeffer: really? that is a surprise ??? what if you don???t want persistence?
[10:03:19] xcv: has joined #RubyOnRails
[10:03:24] arup_r: Adds one or more objects to the collection by setting their foreign keys to the collection???s primary key. **Note that this operation instantly fires update SQL without waiting for the save or update call on the parent object, unless the parent object is a new record.**
[10:03:38] arup_r: there you go
[10:04:02] bonhoeffer: still learning . . . wow
[10:04:42] rvanlieshout: bonhoeffer: you shouldn't use that method if you don't like it's result :)
[10:06:52] sanjayu: has joined #RubyOnRails
[10:08:07] bonhoeffer: rvanlieshout: is there an option to add without persistence?
[10:12:06] mark2: has joined #RubyOnRails
[10:12:16] marr: has joined #RubyOnRails
[10:12:53] arup_r: bonhoeffer: book.build_authors(...) # it wouldn't save until you can .save
[10:13:30] bonhoeffer: arup_r: thanks!
[10:13:30] arup_r: sorry. book.authors.build(.. )
[10:13:31] stamina: has joined #RubyOnRails
[10:13:42] artto: has joined #RubyOnRails
[10:13:50] MaDErroR123: has joined #RubyOnRails
[10:15:37] stardiviner: has joined #RubyOnRails
[10:15:40] Scripore: has joined #RubyOnRails
[10:16:12] Lytol: has joined #RubyOnRails
[10:18:35] artto: has joined #RubyOnRails
[10:20:19] rickmasta: has joined #RubyOnRails
[10:22:52] MaDErroR123: has joined #RubyOnRails
[10:23:14] FailBit: rails has so much magic
[10:24:18] Radar: all the magics
[10:26:18] FailBit: I'm sorry I can't hear you over rattling noise of this alias_method_chain
[10:26:40] Radar: these puns are really going the distance_of_time_in_words
[10:26:54] Radar: Fun fact: [].forty_two
[10:27:05] FailBit: NoMethodError: undefined method `forty_two' for []:Array
[10:27:27] FailBit: apparently that's an ActiveSupport thing
[10:30:16] norc: has joined #RubyOnRails
[10:30:59] artto: has joined #RubyOnRails
[10:31:44] roshanavand: has joined #RubyOnRails
[10:33:33] allcentury: has joined #RubyOnRails
[10:34:00] norc: Does it make sense to write model specs to test for things that should be enforced by the database (like unique constraints) ?
[10:34:17] jhass: I'd say no
[10:35:18] dstarh: has joined #RubyOnRails
[10:37:21] Scripore: has joined #RubyOnRails
[10:38:25] workmad3: norc: depends on the characteristic of the test and how important the constraint is... for example, I'll sometimes write tests that ensure something like a unique constraint is present in some way (e.g. using shoulda and writing 'expect(user).to validate_uniqueness(:email)' ) but I won't write tests to show that uniqueness is definitely enforced as I'll rely on the database to have checked that more
[10:38:31] workmad3: thoroughly than I can
[10:40:40] herbst: has joined #RubyOnRails
[10:40:59] artto: has joined #RubyOnRails
[10:41:40] norc: workmad3: Ok. That requires specifying those validations in your model as well (which by itself is not so bad to get handy validations on forms) though.
[10:45:10] bonhoeffer: does anyone know if the wicked wizzard gem allows for absolute paths? wizzard_path(:a_specific_step) only works in views, not in controllers
[10:47:06] workmad3: norc: note I wasn't actually saying "This is exactly what you should do", I was merely providing an easily typed example
[10:47:23] testuser123453: has joined #RubyOnRails
[10:48:08] norc: Oh absolutely. :)
[10:49:16] workmad3: norc: but yeah, I'll typically make sure I have both the database uniqeness constraint and a rails-level model validation for the purposes of better feedback in forms, etc. ;)
[10:49:22] alexhartley: has joined #RubyOnRails
[10:50:03] mostlybadfly: has joined #RubyOnRails
[10:51:00] workmad3: norc: and then I'll probably only verify the rails validation is present and not worry about the database-level one (as writing a test to verify that is present is harder and doesn't exactly add much value, apart from in very critical situations... I've never actually had a scenario critical enough where I've felt the need though)
[10:54:37] tetraktys: has joined #RubyOnRails
[10:54:52] RaggedJack: has joined #RubyOnRails
[10:55:52] kalusn: has joined #RubyOnRails
[10:57:32] poikon: has joined #RubyOnRails
[10:58:55] kalusn: has joined #RubyOnRails
[10:59:47] sagarmred: has joined #RubyOnRails
[11:00:27] xcm: has joined #RubyOnRails
[11:02:53] roshanavand: has joined #RubyOnRails
[11:05:41] FailBit: you can call super() in a block passed to define_method()
[11:06:03] workmad3: FailBit: yup, you just can't use 'super'
[11:06:31] FailBit: I always specify all arguments explicitly.
[11:06:34] pwnd_nfsw: I am super, thanks for askinggggg
[11:06:40] FailBit: I have never just written "super"
[11:07:08] workmad3: FailBit: I have a few times... most recently, when I wanted to capture a specific kw argument to modify
[11:07:43] Flyy7: has joined #RubyOnRails
[11:07:54] workmad3: which meant I could do `def foobar(*, kwarg:, **kwargs); kwarg = new_val; super; end`
[11:08:12] FailBit: that's insane
[11:08:32] workmad3: yeah... blame ActiveJob for refusing to serialize date params into jobs :P
[11:09:53] freezevee: Can someone tell me his opinion about this https://www.reddit.com/r/rails/comments/3ofs5a/join_table_with_foreign_keys_to_the_same/ ?
[11:10:19] rvanlieshout: freezevee: the empty page you mean
[11:10:49] workmad3: freezevee: https://www.dropbox.com/s/4cx7pc8pyk9sjcc/Screenshot%202015-10-12%2012.10.42.png?dl=0
[11:11:38] doodlehaus: has joined #RubyOnRails
[11:12:55] dionysus69: has joined #RubyOnRails
[11:12:55] dionysus69: I am trying to use some extension for bootstrap so I also need to remove stock bootstrap file from the gem that I am using, how do I access the "content" of the saas gem?
[11:12:59] wpp: has joined #RubyOnRails
[11:14:04] freezevee: rvanlieshout: https://gist.github.com/chrisvel/0fc7aae240fe5e6820be
[11:14:48] njero: has joined #RubyOnRails
[11:15:26] workmad3: freezevee: belongs_to :profile, class_name: "User"
[11:15:31] workmad3: freezevee: for the second one ;)
[11:15:44] workmad3: freezevee: you don't need to specify the foreign_key on the first one either
[11:15:58] freezevee: workmad3: thanks
[11:15:59] freezevee: workmad3: does this solution make sense ?
[11:16:17] Cork: has joined #RubyOnRails
[11:16:19] FailBit: workmad3: looking at that def in ripper makes a bit more sense
[11:16:27] FailBit: the syntax is fucking wat
[11:16:31] workmad3: FailBit: haha :)
[11:16:59] workmad3: FailBit: would it have been better if I'd done `def foobar(*args, kwarg:, **kwargs)`? :)
[11:17:18] dionysus69: anyone knows how to edit contents of bootstrap saas gem?
[11:17:20] FailBit: not really.
[11:17:22] ircplususer17358: has joined #RubyOnRails
[11:17:23] chills42: has joined #RubyOnRails
[11:17:38] Linuus: has joined #RubyOnRails
[11:17:55] freezevee: rvanlieshout: any ideas ?
[11:17:57] atmosx: has joined #RubyOnRails
[11:18:08] freezevee: workmad3: does the rest of it make sense ?
[11:18:09] rvanlieshout: back in a few min
[11:18:53] johnflux: has joined #RubyOnRails
[11:18:54] workmad3: freezevee: so you basically want to allow a 'master' user to create 'sub users', yeah? a sub-user can (obviously) only be associated with a single 'master' user?
[11:19:11] freezevee: workmad3: true
[11:19:40] workmad3: freezevee: if so, you should just need a `profile_id` in `users`, and then you can do `has_many :profiles, class_name: "User"; belongs_to :user`
[11:20:21] freezevee: workmad3: you mean in order to not create a joint table, right ?
[11:20:29] naftilos76: has joined #RubyOnRails
[11:20:32] freezevee: like one to many in the same table
[11:20:34] workmad3: freezevee: oh, you'd need `belongs_to :user, foreign_key :profile_id` then
[11:20:42] workmad3: freezevee: yeah, you don't need a join for a one-many relationship
[11:20:51] workmad3: freezevee: you only need a join table for a many-many relationship
[11:21:01] pontiki: has joined #RubyOnRails
[11:21:01] freezevee: workmad3: so it doesn't make sense
[11:21:58] MaDErroR123: has joined #RubyOnRails
[11:22:30] workmad3: freezevee: in terms of database relationship modelling, no... you're introducing an entire table and model that is superfluous :)
[11:22:41] stardiviner: has joined #RubyOnRails
[11:23:05] herbst: has joined #RubyOnRails
[11:23:43] workmad3: freezevee: at least, in what you've shown... if you wanted to move some information out of the users table and into something 'profile-specific' then your setup would be ok, although I'd probably still have a 'profile_id' on users then, and an 'owner' on Profil
[11:25:25] freezevee: workmad3: is this what you suggest https://gist.github.com/chrisvel/0fc7aae240fe5e6820be ?
[11:25:41] MaDErroR123: has joined #RubyOnRails
[11:25:43] mojo-joj_: has joined #RubyOnRails
[11:25:50] syath: has joined #RubyOnRails
[11:26:36] freezevee: workmad3: should I use t.references for profile_id ?
[11:27:29] workmad3: freezevee: sure, you could do 'change_table :users do |t| t.references :profile end`
[11:27:59] workmad3: freezevee: I'd also recommend using a `def change` method, so you don't need to write your own `down` migration in that scenario ;) (unless you're stuck on rails 2 or something)
[11:28:24] toy: has joined #RubyOnRails
[11:28:31] freezevee: workmad3: no it's just recommended from some tutorials, I don't know exactly why
[11:28:44] workmad3: freezevee: and, as said, 'belongs_to :user, foreign_key: :profile_id'
[11:29:02] dionysus69: does anyone know working dropdown checkbox menu?
[11:29:35] workmad3: freezevee: probably old tutorials, or tutorials where the author wasn't aware of the automatic reversal of migrations available nowadays
[11:29:47] freezevee: workmad3: thanks for both things
[11:29:49] toy: has left #RubyOnRails: ()
[11:29:52] losvedir: has joined #RubyOnRails
[11:29:54] toy: has joined #RubyOnRails
[11:34:42] DanKnox: has joined #RubyOnRails
[11:34:50] pawnbox: has joined #RubyOnRails
[11:37:48] toy: has left #RubyOnRails: ()
[11:37:48] toy: has joined #RubyOnRails
[11:40:49] srinidhi: has joined #RubyOnRails
[11:41:30] Scripore: has joined #RubyOnRails
[11:41:45] pawnbox: has joined #RubyOnRails
[11:42:54] polycaster: has joined #RubyOnRails
[11:44:16] inoter: has joined #RubyOnRails
[11:44:20] sanjayu: has joined #RubyOnRails
[11:46:04] sanjayu: has joined #RubyOnRails
[11:47:07] polycaster: has joined #RubyOnRails
[11:48:34] yfeldblum: has joined #RubyOnRails
[11:55:21] root: has joined #RubyOnRails
[11:57:32] speakingcode: has joined #RubyOnRails
[11:58:13] srinidhi: has joined #RubyOnRails
[11:59:03] Ergo: has joined #RubyOnRails
[12:01:49] beauby: has joined #RubyOnRails
[12:03:15] Hates__: has joined #RubyOnRails
[12:04:14] Lytol: has joined #RubyOnRails
[12:04:53] dionysus69: something happened to the helper method, it was working until I added ransack code to the controller, now the index view doesn't see a helper method, can anyone guess why?
[12:04:54] dionysus69: https://gist.github.com/webzorg/0f621fb53f2ec72cafc5
[12:06:20] speakingcode: has joined #RubyOnRails
[12:07:55] rapha: has joined #RubyOnRails
[12:08:22] rvanlieshout: dionysus69: where is the error?
[12:08:43] beauby: has joined #RubyOnRails
[12:08:46] rapha: Is there any way I can set config.action_mailer.default_url_options to the site's current host? As I have multiple production deployments it doesn't really make sense to hardcode the host into config/environments/production.rb...
[12:08:48] Pumukel: has joined #RubyOnRails
[12:09:06] dionysus69: rvanlieshout: undefined method `giftbox' for nil:NilClass in the controller, it doesn't see a scope method declared on the model
[12:09:25] rvanlieshout: dionysus69: ah right. strange, but you shouldn't use view helper methods in your controller
[12:09:30] rvanlieshout: so it kinda makes sense it doesn't work
[12:09:51] rvanlieshout: http://api.rubyonrails.org/classes/AbstractController/Helpers/ClassMethods.html#method-i-helper_method
[12:10:02] dionysus69: no I figured its trying to call a scope which is also called a giftbox its not from helper file
[12:10:04] mikecmpbll: has joined #RubyOnRails
[12:10:35] crankharder: has joined #RubyOnRails
[12:11:38] speakingcode: has joined #RubyOnRails
[12:14:16] njero: has joined #RubyOnRails
[12:15:14] rapha: ah nevermind, found it. thanks!
[12:15:17] rapha: has left #RubyOnRails: ("WeeChat 1.3")
[12:17:12] speakingcode: has joined #RubyOnRails
[12:19:02] mojo-jojo: has joined #RubyOnRails
[12:21:17] bruce_lee: has joined #RubyOnRails
[12:22:20] shinnya: has joined #RubyOnRails
[12:23:08] prestorium: has joined #RubyOnRails
[12:23:49] MaDErroR123: has joined #RubyOnRails
[12:27:31] Cork: has joined #RubyOnRails
[12:28:02] siddart: has joined #RubyOnRails
[12:29:11] bbrowning: has joined #RubyOnRails
[12:31:31] beauby: has joined #RubyOnRails
[12:34:38] lokson: has joined #RubyOnRails
[12:36:09] freezevee: workmad3: why If I do user = User.find(1) and then user.profiles I get a message Mysql2::Error: Unknown column 'users.user_id' in 'where clause': SELECT `users`.* FROM `users` WHERE `users`.`user_id` = 1 ?
[12:36:44] opal: has joined #RubyOnRails
[12:40:57] lokson: error message means that you are missing a column in migration
[12:41:16] lokson: however, shouldn't it be that profile.user_id is missing?
[12:41:19] pawnbox: has joined #RubyOnRails
[12:41:20] alexcid: has joined #RubyOnRails
[12:41:21] jhass: or set the wrong primary_key, I guess
[12:41:27] lokson: i guess the relation is badly defined
[12:41:42] jhass: User.find shouldn't load any relation
[12:42:12] lokson: yep, but message is later, on user.profiles
[12:42:41] jhass: ah, somehow read over that, sorry
[12:43:47] armyriad: has joined #RubyOnRails
[12:43:54] lokson: freezevee: i guess you may have in user.rb model a line like: belongs_to :user
[12:44:08] lokson: ... which should be moved to profile if this guess is correct
[12:44:16] freezevee: there is no profile model
[12:44:28] lokson: ok, create profile.rb model
[12:44:30] jhass: so what's user.profiles for?
[12:45:16] bobbobbins: has joined #RubyOnRails
[12:45:56] freezevee: it's the same model
[12:46:01] opal: has left #RubyOnRails: ()
[12:46:03] freezevee: user can have many profiles (users)
[12:46:12] freezevee: and profiles(users) could belong to one user
[12:46:22] jhass: sounds like a bad design
[12:46:44] jhass: should user.profiles.first.profiles work?
[12:46:58] Peteykun: has joined #RubyOnRails
[12:47:31] freezevee: jhass: https://gist.github.com/chrisvel/0fc7aae240fe5e6820be
[12:47:38] freezevee: this is why I asked workmad3
[12:47:45] freezevee: I was afraid of a bad design
[12:48:04] freezevee: this is just experimenting but I want to know some "best practises"
[12:48:30] jhass: we don't even know what issue you're trying to solve "create other users" isn't really a usecase
[12:48:43] njero: has joined #RubyOnRails
[12:49:24] sebstrax: has joined #RubyOnRails
[12:49:47] freezevee: jhass: it's simple, there is a model User and I want be able to create Users as a User
[12:50:05] Zamerick: has joined #RubyOnRails
[12:50:11] jgt: has joined #RubyOnRails
[12:50:23] freezevee: that will all have an owner_id equal to me who created them
[12:50:34] jhass: with what motivation? what does the relation between the created users and the creating user represent? What capabilities will the created users compared to the creating user have etc.
[12:51:05] jhass: in a sentence?
[12:51:14] freezevee: the "master" will be able to crud users
[12:51:15] sankaber: has joined #RubyOnRails
[12:51:18] freezevee: the he created
[12:51:23] alex88_: has joined #RubyOnRails
[12:52:08] alex88__: has joined #RubyOnRails
[12:52:37] ericjphillips: has joined #RubyOnRails
[12:52:59] dstarh: has joined #RubyOnRails
[12:53:03] krisquigley: has joined #RubyOnRails
[12:55:57] alex88: has joined #RubyOnRails
[12:56:13] dici: has joined #RubyOnRails
[12:56:23] jhass: I'd make a separate model that keeps track of the relation, managements(manager_id, user_id); user has_many managements, as: manager; user has_one management, as: user; user has_many managed, through: managements; user has_one manager, through: management; management belongs_to manager, class: user; management belongs_to user
[12:57:01] jas02: has joined #RubyOnRails
[12:57:31] freezevee: jhass: this is what I initially suggested
[12:57:52] freezevee: but workmad3 told me through joint tables are about many to many relationships
[12:58:18] jhass: has_one has the through option, so...
[12:58:39] losvedir: has left #RubyOnRails: ()
[12:59:41] bonhoeffer: has joined #RubyOnRails
[13:00:41] victortyau: has joined #RubyOnRails
[13:02:28] njero: hello rails geeks...
[13:02:28] njero: I'm trying to replace rails default integer primary key with uuid..
[13:02:28] njero: Googling gave me a solution with activeuuid gem.
[13:02:28] njero: But i've also seen some stackoverflow qstns suggesting use of SecureRandom.uuid which gives some v4 uuid.
[13:02:28] njero: I'm wondering which one to go for. activeuuid is pretty straight forward and not much changes needed in code.
[13:02:29] ericjphillips: has joined #RubyOnRails
[13:03:32] alexhart_: has joined #RubyOnRails
[13:03:41] FailBit: use what's easier for you
[13:04:03] dionysus69: how do i do something like this, generate content tag if product.field.includes?
[13:04:04] dionysus69: content_tag(:span, "#{product.age}", class:"age") if product.category.include? "whisk" I am given error saying undefined method include :\ should be an easy error, whats wrong with it?
[13:04:39] FailBit: dionysus69: what's product.category's type?
[13:04:51] havenwood: dionysus69: What's the exact error?
[13:04:59] dionysus69: undefined method `include?' for nil:NilClass
[13:05:05] rvanlieshout: dionysus69: and don't use "#{product.age}"
[13:05:06] FailBit: that's your problem
[13:05:31] FailBit: quite obviously you can't call normal methods on NilClass
[13:05:39] dionysus69: ok so how do I make it "skip" if its nill? and why not use "#{product.age}" rvanlieshout?
[13:05:41] lporras: has joined #RubyOnRails
[13:05:54] rvanlieshout: dionysus69: what would category be if filled? and why would it respond to .include?
[13:05:55] atrius: has joined #RubyOnRails
[13:05:57] FailBit: content_tag(:span, "#{product.age}", class:"age") if product and product.category.include? "whisk"
[13:06:00] rvanlieshout: it doesn't feel like it's going to be a collection
[13:06:09] rvanlieshout: and, dionysus69, just product.age
[13:06:22] rvanlieshout: you're creating a string and interpolating just 1 attribute as the complete string
[13:07:02] dionysus69: rvanlieshout: haha i get it I just used that to concatenate it with some other string :)
[13:07:16] Ergo^: has joined #RubyOnRails
[13:07:21] dionysus69: category would be american whiskey, scotish whisky or sparkling whine - just for example
[13:07:25] rvanlieshout: dionysus69: then consider a safe_join
[13:07:35] rvanlieshout: dionysus69: it would be a string?
[13:07:51] rvanlieshout: so then product.category.to_s =~ /whisk/i
[13:07:54] dionysus69: yes, ok will look at safe_join, I guess that is not a secure way of doing it?
[13:08:29] dionysus69: ok let me try thanks
[13:08:52] rvanlieshout: dionysus69: it retrains the html_safe
[13:09:43] blackmes1: has joined #RubyOnRails
[13:10:32] dionysus69: what is that i for in /whisk/i ? is this regex thing?
[13:10:44] dionysus69: and it works this time it takes care of nil cases ))
[13:10:52] rvanlieshout: the .to_s takes care of that
[13:11:17] dionysus69: and so what is i at the end of regex thing for?
[13:11:23] rvanlieshout: case insensitive
[13:11:24] FailBit: dionysus69: your nick is fitting for building a wine collection
[13:11:33] quazimodo: has joined #RubyOnRails
[13:11:35] dionysus69: oh I see thanks :D
[13:12:02] dionysus69: FailBit: this is my company's "price list page site" but actually I am building a site for my friend's winery's site :D
[13:12:13] dionysus69: just a coincidence haha
[13:13:22] njero: guys...any comments on SecureRandom.uuid vs UUIDTools::UUID.timestamp_create
[13:13:41] rvanlieshout: n_e_o: 15:03 < FailBit> use what's easier for you
[13:14:21] njero: so no side effects
[13:14:56] njero: then that shd be ur answer :P
[13:15:18] johnflux: has joined #RubyOnRails
[13:15:18] johnflux: has joined #RubyOnRails
[13:15:32] alexhartley: has joined #RubyOnRails
[13:15:34] tetraktys: has joined #RubyOnRails
[13:16:01] rvanlieshout: find out which one is easier for you
[13:16:11] rvanlieshout: they both have pro's and con's
[13:16:21] rvanlieshout: you don't need somebody else to tell you what _your_ reasons are
[13:16:53] freezevee: jhass: is it necessary ?
[13:17:01] njero: i'm asking whats than pros and cons .. i couldnt find it online
[13:17:13] freezevee: jhass: I mean why should I choose either a joint table or just a FK to the same table ?
[13:17:36] rvanlieshout: n_e_o: the only good way to find out is to give them a go
[13:17:56] jhass: freezevee: the two benefits I see is no NULL fks in the table and a place to put logic that concerns the relation only, keeping the user model smaller
[13:17:59] njero: i already did with activeuuid :)
[13:18:13] njero: but im cautious ...
[13:18:50] freezevee: jhass: why should there be NULL fks ? In every create action, the owner id is persisted
[13:19:03] rvanlieshout: n_e_o: does activeuuid work for you? is the gem well maintained?
[13:19:09] freezevee: jhass: aaaahh you mean If the admin/master user is deleted ?
[13:19:11] Hates_: has joined #RubyOnRails
[13:19:36] njero: rvanlieshout: works fine now..
[13:20:10] rvanlieshout: n_e_o: then why worry?
[13:20:36] jhass: freezevee: which value will the "admin/master" have?
[13:20:41] njero: my project is not online yet.. so i'm trying to forsee pitfalls
[13:21:02] rvanlieshout: not having it online cause you're spending all your time in why you should what solution is a pitfall too
[13:21:35] freezevee: jhass: I mean if the "owner" has 20 "users", the user.owner_id whould be equal to owner.id, so If the owner is deleted, the users could be left with null owner_ids
[13:21:46] freezevee: jhass: but still it's something manageable
[13:21:51] jhass: freezevee: not what i mean
[13:21:53] rvanlieshout: n_e_o: check if the gem is tested, and make sure your app is too
[13:22:07] allcentury: has joined #RubyOnRails
[13:22:09] njero: rvanlieshout: will do.. thanks
[13:22:15] doodlehaus: has joined #RubyOnRails
[13:22:18] jhass: freezevee: say you have a user created by an owner (why do we keep changing terms? admin/master/owner/profile...)
[13:22:27] jhass: freezevee: what's user.owner.owner ?
[13:22:54] freezevee: jhass: my mind is like a laundry machine
[13:23:43] rvanlieshout: ^ another pitfall
[13:23:48] jhass: freezevee: sounds like you have no real idea of what you're implementing, maybe you should make a feature design first before designing how to realize it
[13:24:05] freezevee: jhass: please forgive me I am burnt out
[13:24:06] njero: rvanlieshout: pardon me.. wht u mean?
[13:24:21] freezevee: jhass: I know what I want but I have a difficulty to present it
[13:24:23] jessemcgilallen: has joined #RubyOnRails
[13:24:29] rvanlieshout: n_e_o: that one wasn't for you :)
[13:24:31] Sirithcam: has joined #RubyOnRails
[13:24:37] orolo: has joined #RubyOnRails
[13:24:57] herbst: has joined #RubyOnRails
[13:25:09] tknz: has joined #RubyOnRails
[13:25:10] The_Ball: has joined #RubyOnRails
[13:25:27] armyriad: has joined #RubyOnRails
[13:25:41] herbst: has joined #RubyOnRails
[13:26:45] bePolite: has joined #RubyOnRails
[13:26:57] The_Ball: Hi guys. I'm looking for a simple customer support application basically to handle incoming emails -> tickets and that kind of thing. I'm learning rails so if something exists in this space that would be great. Anyone know of anything?
[13:28:19] mikecmpbll: The_Ball: pretty much all helpdesk applications have that functionality
[13:28:58] The_Ball: Sure, I meant any ones written in rails
[13:29:20] rvanlieshout: The_Ball: why does it have to be in Rails? You're obviouslly not going to create one yourself and that's why Rails exists
[13:29:34] michael_mbp: has joined #RubyOnRails
[13:29:43] dionysus69: safe_join(product.age.to, ??? ???) is the syntax for this correct? it throws up a huge error
[13:30:00] rvanlieshout: what are you trying to do?
[13:30:04] rvanlieshout: and why add a " "?
[13:30:15] Tokenizer: has joined #RubyOnRails
[13:30:16] mikecmpbll: dionysus69: are the weird quotes in your actual code?
[13:30:22] The_Ball: I'm learning rails so I'd like to play with some apps that are written in it, and a helpdesk app sounded like a good starting point
[13:30:31] rvanlieshout: cause you shouldn't be adding spaces like that in your html
[13:30:41] rvanlieshout: The_Ball: you won't learn rails from playing in apps that are created within
[13:30:49] dionysus69: safe_join(product.age, ??? years old???) this is whats in the code
[13:31:01] mikecmpbll: still weird quotes
[13:31:02] rvanlieshout: dionysus69: with the weird "?
[13:31:12] rvanlieshout: using windows?
[13:31:21] rvanlieshout: you might want to disable that quote thing
[13:31:30] dionysus69: I am using ", whats weird with it ? :D
[13:31:35] rvanlieshout: on your os.. so a " is a " now matter how many " you use
[13:32:20] The_Ball: rvanlieshout, I like learning that way, start with something that work, make small incremental changes
[13:32:43] dionysus69: wait I dont get it, these are regular quote marks next to the colon button, it worked everywhere always
[13:32:45] rvanlieshout: you might want to give yourself the time to look at one or two tutorials first.
[13:32:56] mikecmpbll: dionysus69: they are not
[13:33:41] The_Ball: rvanlieshout, sure, I'm already playing around, I've setup a Spree webshop with lots of tweaks and changes
[13:33:41] mikecmpbll: [14:31:29] <dionysus69> I am using ", whats weird with it ? :D <--- nothing wrong with that quote
[13:33:50] mikecmpbll: [14:30:48] <dionysus69> safe_join(product.age, ??? years old???) <-- plenty wrong with these
[13:34:03] rvanlieshout: hmm. and your time is off
[13:34:07] ircplususer13552: has joined #RubyOnRails
[13:34:10] rvanlieshout: oh wait. no that's ok
[13:34:15] linus: has joined #RubyOnRails
[13:34:22] sevenseacat: has joined #RubyOnRails
[13:34:43] dionysus69: the plenty wrong with these line you wrote, my quotes dont show up like that
[13:34:45] roshanavand: has joined #RubyOnRails
[13:34:48] emilkarl: has joined #RubyOnRails
[13:34:50] mxrguspxrt: has joined #RubyOnRails
[13:34:53] rvanlieshout: dionysus69: that's how we see them
[13:34:56] dionysus69: they show up the way "nothing wrong with that shows"
[13:35:05] mikecmpbll: so where did the code come from that you put in IRC
[13:35:07] rvanlieshout: dionysus69: but you might want to pass in an array
[13:35:14] dionysus69: weird lol maybe pasting into thunderbird makes them weird
[13:35:19] rvanlieshout: safe_join([product.age, " years old"])
[13:35:20] mikecmpbll: probably, yes.
[13:35:23] rvanlieshout: even better, use i18n
[13:35:36] rvanlieshout: or distance_of_time_ago_in_words(product.age.years)
[13:36:04] n1lo: has joined #RubyOnRails
[13:36:57] dionysus69: oh wait i just noticed too, this is pretty weird ye, thats how quotes get written inside safe_join, everywhere else its fine like its always been
[13:38:16] bonhoeffer: has joined #RubyOnRails
[13:38:35] beauby: has joined #RubyOnRails
[13:39:04] newdan: has joined #RubyOnRails
[13:42:37] umgrosscol: has joined #RubyOnRails
[13:44:44] sankaber: has joined #RubyOnRails
[13:46:27] ddv: is there a gem that handles the capability to do a atomic find_or_create?
[13:46:38] sankaber: has joined #RubyOnRails
[13:46:39] Script5ire: has joined #RubyOnRails
[13:46:57] rvanlieshout: ddv: wrap it in a transaction?
[13:48:03] ddv: rvanlieshout: didn't know this was available, so I should do transaction { find_or_create... } ?
[13:48:20] newdan: has left #RubyOnRails: ()
[13:48:36] rvanlieshout: something like that. lock the table for things you don't want to happen in between
[13:51:52] seank_: has joined #RubyOnRails
[13:52:24] Lytol: has joined #RubyOnRails
[13:52:49] ruurd: has joined #RubyOnRails
[13:54:17] jgt: has joined #RubyOnRails
[13:55:10] ruurd: has joined #RubyOnRails
[13:55:14] jessemcgilallen: has joined #RubyOnRails
[13:56:11] stannard: has joined #RubyOnRails
[13:59:32] emilkarl: I???m thinking of adding an api to my app. I think I will add it as an engine and use AMS. Would you recommend using versionist or versioncake for verisoning?
[14:00:58] siddart: has joined #RubyOnRails
[14:01:27] dopamean_: has joined #RubyOnRails
[14:04:40] Lightsword: has joined #RubyOnRails
[14:04:45] Script5ire_: has joined #RubyOnRails
[14:05:09] Guest77051: has joined #RubyOnRails
[14:05:44] dANO: has joined #RubyOnRails
[14:08:00] IFrank00: has joined #RubyOnRails
[14:08:14] cac: has joined #RubyOnRails
[14:08:25] Guest77051: has left #RubyOnRails: ()
[14:08:35] IFrank00: Good day to all
[14:08:49] bnwiscool: has joined #RubyOnRails
[14:09:30] weckl: has joined #RubyOnRails
[14:10:13] bnwiscool: has left #RubyOnRails: ()
[14:11:23] rickmasta: has joined #RubyOnRails
[14:12:37] sunya7a: has joined #RubyOnRails
[14:13:18] ritic: has joined #RubyOnRails
[14:13:57] bnwiscool: has joined #RubyOnRails
[14:14:05] arup_r: lot's of things still to grasp :)
[14:14:18] banister: has joined #RubyOnRails
[14:16:23] ritic: has joined #RubyOnRails
[14:20:43] n008f4g_: has joined #RubyOnRails
[14:22:01] roshanavand: has joined #RubyOnRails
[14:24:29] beauby: has joined #RubyOnRails
[14:24:37] bnwiscool: has left #RubyOnRails: ()
[14:27:46] wa_r_ch_i__ld1: has joined #RubyOnRails
[14:29:18] dionysus69: this is bugging me, <%= search_form_for @search do |f| html: {class:"navbar-form"}%> how do I insert class into this search_form_for?
[14:30:31] The_Phoenix: has joined #RubyOnRails
[14:31:40] wa_r_ch_i__ld1: if i have 2 methods in the same controller, if i call method "b" from method "a", how can I get the before_filter on method "b" to execute?
[14:32:13] mikecmpbll: dionysus69: does that look like correct ruby syntax to you? :)
[14:32:47] dionysus69: nope, but thats what I found on stack exchange for search_form case and nothing for search_form_for case :D
[14:33:05] mikecmpbll: look at the form_for docs.
[14:33:56] njero: has joined #RubyOnRails
[14:34:00] nertzy: has joined #RubyOnRails
[14:34:02] blackmes1: has joined #RubyOnRails
[14:34:25] dionysus69: oh I see, its before "do |f|" :D thanks mikecmpbll ))
[14:34:56] bitkiller: has joined #RubyOnRails
[14:35:33] michael_mbp: has joined #RubyOnRails
[14:35:50] shmilan: has joined #RubyOnRails
[14:35:57] xcm: has joined #RubyOnRails
[14:37:52] LiquidInsect: has joined #RubyOnRails
[14:38:56] emilkarl: has joined #RubyOnRails
[14:39:06] Peteykun: has joined #RubyOnRails
[14:39:33] Kerber0s: has joined #RubyOnRails
[14:39:59] raunico3: has joined #RubyOnRails
[14:40:28] chills42: has joined #RubyOnRails
[14:40:30] pawnbox: has joined #RubyOnRails
[14:41:34] Kerber0s: has joined #RubyOnRails
[14:41:50] jenrzzz: has joined #RubyOnRails
[14:42:08] EminenceHC: has joined #RubyOnRails
[14:42:43] sunya7a_: has joined #RubyOnRails
[14:43:43] i: has joined #RubyOnRails
[14:43:47] chills42: has joined #RubyOnRails
[14:45:26] jobewan: has joined #RubyOnRails
[14:45:43] axl_: has joined #RubyOnRails
[14:46:44] sankaber: has joined #RubyOnRails
[14:47:13] ruurd: has joined #RubyOnRails
[14:47:54] polishdub: has joined #RubyOnRails
[14:48:59] mary5030: has joined #RubyOnRails
[14:49:38] arup_r: wa_r_ch_i__ld1: beore_filter :a # this will call method `b` as per your description
[14:50:02] arup_r: you don't need to call `b` explicitly.. it will be called from `a`
[14:51:49] chouhoulis: has joined #RubyOnRails
[14:52:22] wa_r_ch_i__ld1: @arup_r what if i only want b to execute after a
[14:52:37] sivsushruth: has joined #RubyOnRails
[14:52:44] Guest23308: has left #RubyOnRails: ()
[14:52:58] sunya7a: has joined #RubyOnRails
[14:53:35] arup_r: ok. then beore_filter :a, :b # don't call `b` inside `a`?
[14:53:47] Guest19057: has left #RubyOnRails: ()
[14:54:05] wa_r_ch_i__ld1: but then it will execute before a also right?
[14:54:11] wa_r_ch_i__ld1: I only want it before b
[14:54:32] arup_r: a will be executed. then b will be executed
[14:54:42] arup_r: well.. I am confused now
[14:54:46] sunya7a: has joined #RubyOnRails
[14:54:49] wa_r_ch_i__ld1: haha I have it on stackoverflow
[14:54:51] sunya7a: good morning
[14:54:57] wa_r_ch_i__ld1: http://stackoverflow.com/questions/33083905/calling-ruby-on-rails-controller-method-from-another-method-in-the-same-controll
[14:55:02] bruno-: has joined #RubyOnRails
[14:55:25] hephaestus_rg: has joined #RubyOnRails
[14:56:55] jgt: has joined #RubyOnRails
[14:57:32] Tokenizer: has joined #RubyOnRails
[14:57:51] tubbo: wa_r_ch_i__ld1: just so you know, if method_a and method_b are both actions, this probably won't work very well.
[14:57:54] Hates_: wa_r_ch_i__ld1: before_filters run when an action is called directly. not when you're doing it this way. you shouldn't be calling actions from other actions though.
[14:58:02] tubbo: because that method is actually run in the context of a large http request
[14:58:23] wa_r_ch_i__ld1: method_a i originally had as a before_filter on method_b
[14:58:29] qejk: has joined #RubyOnRails
[14:58:38] wa_r_ch_i__ld1: but i need a different before_filter to execute only if method_a passes
[14:58:51] wa_r_ch_i__ld1: but blahblahblah if i call that before_filter from method_a it wont work
[14:59:17] umgrosscol: has joined #RubyOnRails
[14:59:17] hnanon: has joined #RubyOnRails
[15:00:06] tubbo: wa_r_ch_i__ld1: this sounds like a lot of complex logic, and probably not the business of the controller. i'd suggest doing what you want to do within an ancillary object of some kind, and just using a before_filter to instantiate the object and tell it to "do the work".
[15:00:18] hnanon: I have this:
[15:00:21] hnanon: <%= f.collection_select(:training_classification, TrainingRecord::TRAINING_CLASSIFICATIONS, :id, :name, { prompt: true }, { class: "form-field" }) %>
[15:00:33] hnanon: What should replace :name?
[15:00:35] arup_r: Ok. I see.. then? :) hnanon
[15:00:47] arup_r: ok. let me see now
[15:00:57] darrencauthon: has joined #RubyOnRails
[15:01:02] hnanon: I'm populating from model constants.
[15:01:08] wa_r_ch_i__ld1: @tubbo you lost me ;)
[15:01:35] tubbo: wa_r_ch_i__ld1: why not describe your problem a little more in terms of real things, not fake method names...and i might be able to tell you an alternative way of doing what you want
[15:01:51] arup_r: hnanon: I didn't get you. "replace" means?
[15:02:02] bmalum: has joined #RubyOnRails
[15:02:10] hnanon: I'm getting the error: undefined method `name' for "New Hire":String
[15:02:15] ruurd: has joined #RubyOnRails
[15:02:31] hnanon: for the text_method
[15:03:04] hnanon: So, :name should be something else.
[15:03:25] cschneid_: has joined #RubyOnRails
[15:03:49] wa_r_ch_i__ld1: @tubbo so there is a form, if this form has a field populated a certain way I need to show show a client side error message (method a), if the form is correct, if it's a certain type of record I need it to display a different pop-up (the before-filter method), finally if that pop-up is not needed or accepted, I need to save to the database (method b)
[15:04:22] wa_r_ch_i__ld1: @tubbo the before-filter method lives in the application controller, so I didn't want to start cutting everything up, but it sounds like I might need to
[15:04:25] tubbo: wa_r_ch_i__ld1: you are not using the correct tool for the job.
[15:05:19] arup_r: hnanon: Use http://apidock.com/rails/v4.2.1/ActionView/Helpers/FormOptionsHelper/select not the one you used as per the data you have
[15:05:49] tubbo: wa_r_ch_i__ld1: instead of using complex method routing in the controller to achieve your goals, you can actually rely on rails' own default behaviors to accomplish the first part (form validation). your second requirement can be fulfilled with a bit of javascript executed only if it's this "certain type of record".
[15:06:36] arup_r: collection_select needs the collection to be a list of objects which must responds to `id` and `name` method
[15:07:31] arup_r: but in your example it is just a plain array of array i think so, which you can't use in this case. That's why you must use f.select
[15:07:40] wa_r_ch_i__ld1: @tubbo if i use a model validation, it won't be executed until after the before_filter method
[15:08:22] arup_r: f.select has to be used when you have *A flat collection* and you have it ..
[15:08:31] arup_r: hnanon: You got me ? :D
[15:09:13] tubbo: wa_r_ch_i__ld1: so?
[15:09:14] hnanon: arup_r: I'm trying now.
[15:09:26] wa_r_ch_i__ld1: @tubbo that's outside what I want ;)
[15:10:00] cball: has joined #RubyOnRails
[15:10:22] tubbo: wa_r_ch_i__ld1: why?
[15:10:38] disgrntld: has joined #RubyOnRails
[15:11:30] alex88_: has joined #RubyOnRails
[15:12:06] tubbo: problem here is that i don't really know what that before_filter method does. it sounds like it just validates something.
[15:12:20] tubbo: it might be possible to extract all this logic out from the controller, then it would be easier to deal with
[15:12:42] dionysus69: does anyone use html5 boilerplates here? if yes which one?
[15:12:47] arup_r: lets have a skype with wa_r_ch_i__ld1 :D
[15:12:55] wa_r_ch_i__ld1: @tubbo maybe I can use redirect_to method_b somehow?
[15:13:18] arup_r: dionysus69: You are far ahead of my thinking and skills :(
[15:13:20] wa_r_ch_i__ld1: @tubbo i'd like to, but so much has to be rendered to the client
[15:13:28] doodlehaus: has joined #RubyOnRails
[15:13:38] hnanon: arup_r: Thanks. It's working.
[15:13:47] arup_r: happy to help
[15:13:48] dionysus69: arup_r: ugh come on now x)
[15:13:52] wa_r_ch_i__ld1: @tubbo and I thought i had it working yesterday!
[15:13:58] wa_r_ch_i__ld1: @tubbo checked it out today, i was like
[15:14:05] arup_r: hnanon: You got now I hope the usecase of the 2 methods right?
[15:14:23] arup_r: select vs collection_select
[15:14:59] arup_r: dionysus69: No, I swear.
[15:15:00] tubbo: wa_r_ch_i__ld1: yeah i can't see your facial expression so "i was like" means nothing to me :P
[15:15:28] wa_r_ch_i__ld1: @tubbo it looks like :-O
[15:15:34] tubbo: wa_r_ch_i__ld1: but yeah, you're trying to shoehorn the controller into doing something that isn't its job
[15:15:46] tubbo: which is why you're having problems, and you will find this to be hard to maintain in the future (if it isn't already)
[15:15:54] tubbo: i'm not even sure what you want here is possible without some JS at least.
[15:16:17] dionysus69: arup_r: If you mean, its generally lame to use boilerplate with rails, say so I won't be emotionally hurt ))
[15:16:24] arup_r: haha. yes wa_r_ch_i__ld1 telling Rails controller "YOU HAVE TO DO IT". I don't care the convention you have in mind
[15:17:11] arup_r: dionysus69: I don't know man, really . What you asked. I am just looking for someone to pick up that and answer you. And from there I will catch this.
[15:17:30] arup_r: I don't want to hurt you :(
[15:17:34] ishikawa91: has joined #RubyOnRails
[15:17:36] wa_r_ch_i__ld1: @tubbo, yes, trying to not reinvent the wheel on it
[15:17:53] tubbo: wa_r_ch_i__ld1: that's in fact exactly what you are doing ;)
[15:18:07] wa_r_ch_i__ld1: @tubbo is there some way I can redirect twice?
[15:18:25] wa_r_ch_i__ld1: @tubbo manually call the before_filter method, and have that execute method_b
[15:18:33] wa_r_ch_i__ld1: @tubbo without breaking DRY
[15:18:59] tubbo: wa_r_ch_i__ld1: totally. take all this logic in the controller and move it to a class, then you don't need to redirect twice.
[15:19:00] arup_r: wa_r_ch_i__ld1: Rails will put then an exception on your bucket "double render error" if you attempt to do so
[15:19:19] arup_r: oh. that way. hum
[15:19:33] dionysus69: just lol nvm
[15:19:37] acti0nman: has joined #RubyOnRails
[15:20:16] arup_r: pwnd_nfsw: Ask me, I am free. I opened a consultancy here in #rubyonrails.. Its a trial how my business would go, when I open a real one.
[15:20:18] tubbo: dionysus69: when you say "boilerplate" what do you mean? i use zurb foundation so `rails g foundation:install` edits my application layout to throw in proper html5 syntax and things like modernizr, etc
[15:20:28] arup_r: time to learn now...........
[15:20:29] EminenceHC: has joined #RubyOnRails
[15:20:45] arup_r: ACTION following tubbo s speech.. 
[15:20:56] pwnd_nfsw: arup_r, I wasn't asking any questions, I was just poking fun at the highlight spam.
[15:21:23] arup_r: I missed one opportunity then..
[15:21:32] dionysus69: tubbo: yep thats what I meant, I will look up zurb sounds like what i need thanks :)
[15:21:34] tubbo: i hate you all
[15:21:34] pwnd_nfsw: There was no opportunity to miss :p
[15:22:01] pwnd_nfsw: dionysus69, foundation is an alternative to bootstrap
[15:22:25] arup_r: yes, most of the people start like you.. Hey <Enter>, I have <Enter> ....... so I thought you also like starting your question van.
[15:22:57] arup_r: ACTION pokes wa_r_ch_i__ld1 
[15:23:02] dopie: has joined #RubyOnRails
[15:23:23] arup_r: nothing.. :)
[15:24:13] tubbo: i've always liked foundation, gives my personal apps a different look than just generic bootstrap, looks great, built with sass
[15:24:37] tubbo: though isn't bootstrap converting to sass now?
[15:25:41] axwhy: has joined #RubyOnRails
[15:26:19] krisquigley: has joined #RubyOnRails
[15:27:23] MaDErroR123: has joined #RubyOnRails
[15:27:35] dionysus69: well ye I havent even heard of foundation so I will look into it, the only reason I am using bootstrap is there is no "standard" alternative that I know of
[15:28:27] andywww: has joined #RubyOnRails
[15:28:50] Motoservo: has joined #RubyOnRails
[15:28:59] tubbo: foundation isn't really standard either
[15:29:01] riotjones: has joined #RubyOnRails
[15:29:07] tubbo: there's a lot of different CSS frameworks out there
[15:30:18] dionysus69: hmm ok will still explore ))
[15:30:41] mikecmpbll: i quite like the look of http://purecss.io/ as a modular minimalist framework
[15:31:22] mikecmpbll: plus i only really want the responsiveness stuff most of the time
[15:31:25] blackmesa: has joined #RubyOnRails
[15:32:30] andywww: has left #RubyOnRails: ()
[15:33:05] dionysus69: that looks good too actually
[15:35:15] jas02: has joined #RubyOnRails
[15:37:37] wa_r_ch_i__ld1: @tubbo is there a way to order the before_filter execution?
[15:37:44] tubbo: wa_r_ch_i__ld1: nope
[15:38:09] Lytol: has joined #RubyOnRails
[15:38:27] dopie: tubbo, do you have experience with rvm1-capistrano3 ?
[15:38:29] herbst: has joined #RubyOnRails
[15:38:35] herbst: has joined #RubyOnRails
[15:38:43] tubbo: dopie: not really, i haven't used rvm in a long time.
[15:38:44] dopie: I'm trying to set the gemset to use and I'm not finding where I set it in my deploy.rb
[15:39:15] dopie: tubbo, what do you use of gem management?
[15:39:41] ror15: has joined #RubyOnRails
[15:39:50] mikecmpbll: dopie: pretty sure you just specify it with your ruby version
[15:40:00] tubbo: dopie: well on a production server i prefer to just install a single ruby version with ruby-install, but locally on my dev machine i use chruby to switch between ruby versions and ruby-install to install them
[15:40:02] mikecmpbll: e.g. '2.0.0@somegemset'
[15:40:15] Lytol: has joined #RubyOnRails
[15:41:07] mikecmpbll: btw i'm not sure what that rvm1-capistrano3 gem is. there's a 'capistrano-rvm' which i use.
[15:42:20] a1fa: has joined #RubyOnRails
[15:42:46] a1fa: hey guys, how do should you deal with potential ZeroDivision?
[15:42:55] tubbo: a1fa: don't divide by 0
[15:42:58] a1fa: err how do you or should you
[15:43:16] tubbo: return 0 if arguments.any?(:zero?)
[15:43:29] a1fa: tubbo: it sometimes a legitimate input
[15:43:44] rubyonrailed: has joined #RubyOnRails
[15:43:47] tubbo: kinda depends on the problem here
[15:43:47] mikecmpbll: a1fa: you might have to provide slightly more background
[15:44:05] tetraktys: has joined #RubyOnRails
[15:44:46] a1fa: i have two fields, car_asset_inspected, and car_asset_total
[15:45:12] a1fa: sometimes both fields could be 0, 0 cars, and 0 cars inspected
[15:45:26] herbst: has joined #RubyOnRails
[15:45:30] ipstatic: has left #RubyOnRails: ("Bye")
[15:45:41] a1fa: so now i am checking the percentage of cars inspected for lot commpliance
[15:45:48] a1fa: ^ s/mm/m/
[15:45:50] Tempesta: has joined #RubyOnRails
[15:45:56] mikecmpbll: return "N/A" if cars_asset_total.zero?
[15:46:33] a1fa: mikecmpbll: it goes into the complaince table, as a snapshot in time
[15:46:41] mikecmpbll: that means nothing to me.
[15:46:51] [Butch]: has joined #RubyOnRails
[15:47:12] a1fa: mikecmpbll: i see what you did there, but.. i am still stuck dividing with 0
[15:47:26] tubbo: a1fa: so if either one of those attrs are zero, wouldn't the end result be zero?
[15:47:30] mikecmpbll: it's an edge case that you need to handle, i just gave you an example.
[15:47:35] a1fa: unless i write an if statement?
[15:47:50] EminenceHC: has joined #RubyOnRails
[15:48:14] mikecmpbll: or just handle the NaN result of 0/0
[15:48:26] mikecmpbll: ah it's integer division nvm
[15:48:41] mikecmpbll: wait no it's not.
[15:49:09] a1fa: tubbo: my first thought is to put unless or if, so the division never happens, and assign a 0 or something
[15:49:57] a1fa: compliance = inspected/total unless total.zero?
[15:49:58] mikecmpbll: 0 isn't accurate, but if that doesn't matter to you then go for it.
[15:50:56] jenrzzz: has joined #RubyOnRails
[15:51:11] a1fa: mikecmpbll: technically 0/0 is 100 :P
[15:51:21] mikecmpbll: nah, it isn't.
[15:51:44] a1fa: well 0 out of 0 is 100% <
[15:51:49] tubbo: a1fa: technically you don't know math
[15:51:50] mikecmpbll: no it isn't :)
[15:52:06] a1fa: haha, technically this isnt math
[15:52:16] tubbo: oh yeah? division isn't math now?
[15:52:21] a1fa: no, statistics
[15:52:27] tubbo: so statistics aren't math
[15:52:35] tubbo: quit while you're ahead ;)
[15:52:38] tubbo: it's ALL math
[15:52:56] a1fa: so what is 0 out of 0?
[15:53:02] tubbo: but yeah, since this *is* statistics i think the 0 value here is perfect
[15:53:15] mikecmpbll: it's an invalid mathematical operation
[15:53:19] mikecmpbll: there is no result
[15:53:28] a1fa: mikecmpbll: in statistics?
[15:53:32] tubbo: a1fa: register an account on piratebay. what is your ratio? if it's zero, then 0 out of 0 is 0 :)
[15:54:04] sininen: has joined #RubyOnRails
[15:54:23] EminenceHC: has joined #RubyOnRails
[15:54:31] mikecmpbll: you can tag any business logic meaning to it you like depending on your use case but it's not 0 or 100 or infinity or anything else, mathematically
[15:55:02] safety_cut: has joined #RubyOnRails
[15:55:13] creature_: has left #RubyOnRails: ()
[15:55:22] a1fa: mikecmpbll: in that case, defaulting to 0 sounds reasonable
[15:55:28] creature: has joined #RubyOnRails
[15:55:35] mikecmpbll: as long as you don't intend to do any further mathematics on it.
[15:55:47] a1fa: mikecmpbll: no more math
[15:56:19] mikecmpbll: i prefer something that indicates that the result is not relevant, hence i suggested n/a
[15:56:27] MrJoshua: has joined #RubyOnRails
[15:58:06] havenwood: a1fa: Ask Siri "What is zero divided by zero?" and she says: Imagine that you have zero cookies and you split them evenly among zero friends. How many cookies does each person get? See? It doesn't make sense. And Cookie Monster is sad that there are no cookies, and you are sad that you have no friends.
[15:58:20] michaeldeol: has joined #RubyOnRails
[15:59:17] a1fa: tubbo, mikecmpbll : appreciate your guidence
[15:59:32] a1fa: havenwood: fun
[15:59:54] dionysus69: has joined #RubyOnRails
[16:00:15] bonhoeffer: has joined #RubyOnRails
[16:00:19] hephaestus_rg: has joined #RubyOnRails
[16:00:26] sonofdirt: has joined #RubyOnRails
[16:00:34] a1fa: i already have a feeling they will make me set this to 100 if 0 out of 0.
[16:00:38] armyriad: has joined #RubyOnRails
[16:02:22] mrbubbles: has joined #RubyOnRails
[16:05:33] bnwiscool: has joined #RubyOnRails
[16:06:30] EminenceHC: has joined #RubyOnRails
[16:06:45] max_Q: has joined #RubyOnRails
[16:07:09] mrbubbles: This may be something simple so apologies: Reading.where(???i_l3 > 0") is working correctly, but Reading.where(???? > 0???, parameter.name) (where parameter.name is a string containing i_l3) is not. Am I doing something silly?
[16:07:09] maxx88: has joined #RubyOnRails
[16:07:29] mrbubbles: The error is ActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "i_l3"
[16:07:36] sanjayu: has joined #RubyOnRails
[16:08:48] EminenceHC: has joined #RubyOnRails
[16:09:56] nfk: has joined #RubyOnRails
[16:10:43] atmosx: has joined #RubyOnRails
[16:11:11] Bilbo-baggons: has joined #RubyOnRails
[16:11:52] EminenceHC: has joined #RubyOnRails
[16:13:57] hobodave: has joined #RubyOnRails
[16:14:00] mikecmpbll: try "`i_l3`" or something
[16:14:17] mikecmpbll: and show the exact query
[16:14:30] johnflux: has joined #RubyOnRails
[16:15:44] lucianosousa: has joined #RubyOnRails
[16:16:21] mrbubbles: Ah, looks like I have to use string interpolation
[16:16:40] mrbubbles: Reading.where("#{parameter.name} > 0") seems to work
[16:17:04] mikecmpbll: i hope parameter.name isn't user input
[16:17:14] mrbubbles: No it???s not
[16:19:22] lucianosousa: mrbubbles: avoid this kind of query string. it allows SQL injection
[16:20:04] mrbubbles: lucianosousa: But then Reading.where(???? > 0???, parameter.name) isn???t working :(
[16:20:15] mikecmpbll: mrbubbles: you didn't really respond to my suggestions
[16:20:24] mikecmpbll: so we can't really help you if you don't engage.
[16:20:33] mrbubbles: Sorry mikecmpbll, when you say try ???`i_l3`???
[16:20:37] lucianosousa: even if isnt a user input, people can read this in your code in the future and replicate the same idea for other purposes
[16:20:38] mrbubbles: do you mean in the test?
[16:20:46] mikecmpbll: i mean use backticks around it
[16:20:53] mikecmpbll: but i don't know pg too well, it was a stab in the dark.
[16:21:07] mikecmpbll: importantly, show us the whole SQL query from your logs.
[16:22:12] jsfan2: has joined #RubyOnRails
[16:22:13] yardenbar: has joined #RubyOnRails
[16:22:32] mrbubbles: Okay so when it works (i.e. when I???m using the bold syntax above) the query is: SELECT MIN("readings"."i_l3") FROM "readings" WHERE "readings"."meter_id" = $1 AND ("readings"."timestamp" BETWEEN 1436180400000 AND 1441969500000) AND (i_l3 > 0)
[16:22:35] smathy: has joined #RubyOnRails
[16:22:42] mikecmpbll: and when it doesn't?
[16:23:52] danman: has joined #RubyOnRails
[16:24:10] mrbubbles: SELECT MIN("readings"."i_l3???) FROM "readings" WHERE "readings"."meter_id" = $1 AND ("readings"."timestamp" BETWEEN 1436180400000 AND 1441969500000) AND ('i_l3??? > 0)
[16:24:20] mrbubbles: ActiveRecord::StatementInvalid (PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "i_l3???
[16:24:46] mrbubbles: oh I see the i_l3 is in quotes on the one that doesn???t work
[16:25:11] mikecmpbll: i don't think it's possible tbh.
[16:25:22] shmilan: has joined #RubyOnRails
[16:25:31] mikecmpbll: you could probably drop down to AREL and do it.
[16:25:43] towski_: has joined #RubyOnRails
[16:26:00] mrbubbles: So all I???m trying to do is to include a where clause wherre the parameter is in a variable
[16:26:37] mrbubbles: I thought that would be quite common
[16:27:58] mrbubbles: Okay so say I???ve got a table of columns A, B, C, D, E etc. and I want to get the minmum value of B but excluding 0???s??? is there another way to do that?
[16:28:09] arup_r: has joined #RubyOnRails
[16:28:10] crdpink: has joined #RubyOnRails
[16:28:18] mrbubbles: Just in case I???m over complicating things :)
[16:28:45] mikecmpbll: .where.not(b: 0).minimum(:b)
[16:29:03] jgt: has joined #RubyOnRails
[16:29:13] arup_r: I hate power cut.
[16:30:27] shinnya: has joined #RubyOnRails
[16:30:29] mrbubbles: but if ???b??? is stored in a variable??? I???m back to where I am?
[16:30:38] diegoviola: has joined #RubyOnRails
[16:31:21] riotjones: has joined #RubyOnRails
[16:31:33] wcalderipe: has joined #RubyOnRails
[16:32:23] mrbubbles: Ah - .where.not(parameter.name => 0).minimum(parameter.name)
[16:32:38] mrbubbles: Thanks for your help man )
[16:33:56] beanHolez: has joined #RubyOnRails
[16:34:55] bonhoeffer: has joined #RubyOnRails
[16:35:19] EminenceHC: has joined #RubyOnRails
[16:35:44] beanHolez: I need to run a method on a join model that creates an association to all users on the system. What is the most efficient way to do this? The associations are created via has_many, through
[16:35:52] wcalderipe: i'm quite new on ruby and i'm curious because i see a lot of people using ActiveRecord find method without encapsulate it in a rescue statement but when I do and for instance there's no record with the id passed it raises an error instead of those tutorial around there.. can some one please explain it to me? i have a gist with a sample of it https://gist.github.com/wcalderipe/ee1f108c51b9deb72efd
[16:36:34] beanHolez: Essentially, I'd like to run something like "ModelToAssociate.first.
[16:36:57] beanHolez: Whoops: Essentially, I'd like to run something like "ModelToAssociate.first.assign_to_all_users"
[16:37:14] tubbo: wcalderipe: there's also a method called find!() iirc that will just return nil.
[16:37:20] smathy: wcalderipe, for an API call as you have, where someone will be entering that ID themselves, I would generally use `find_by( id: params[:id] )` which just returns `nil` when the record doesn't exist.
[16:37:57] smathy: tubbo, no find!
[16:38:15] wcalderipe: my first call was change to find_by but i read in some stackoverflow commetns that it will be deprecated
[16:38:35] tubbo: nah that's find_by_* magic methods, which are actually replaced by find_by(your_param: 'whatever')(
[16:39:28] wcalderipe: oh.. thanks :)
[16:39:58] wcalderipe: i'll use find_by then but it's just weird because i use a lot gitlab source code as reference
[16:40:25] beanHolez: tubbo: How long have those finders been deprecated?
[16:40:27] smathy: beanHolez, is this a one-off thing, and how many user records do you have?
[16:40:31] benlieb: has joined #RubyOnRails
[16:40:34] wcalderipe: i dont know if it's the best code implementation in the planet but they are in the business a long time sound like they know what they're doing
[16:40:38] tubbo: beanHolez: since rails 3 i think
[16:40:39] wcalderipe: look at this: https://github.com/gitlabhq/gitlabhq/blob/master/app/controllers/autocomplete_controller.rb#L8
[16:40:49] bmalum: has joined #RubyOnRails
[16:40:57] smathy: They've always been deprecated in my house!
[16:41:04] smathy: Stupid dynamic finders
[16:41:07] tubbo: wcalderipe: just because something happens to work doesn't mean it's any good :)
[16:41:27] tubbo: gitlab is pretty nice though :) i haven't seen too many issues.
[16:41:46] wcalderipe: coderwall have a nice open source repository too
[16:42:26] smathy: wcalderipe, what you linked to in the gitlab source isn't a dynamic finder.
[16:42:26] wcalderipe: well as i said i'm new on ruby so i search for the big players and started to dig their code hehe
[16:42:31] wcalderipe: but thanks any way man :)
[16:43:05] beanHolez: Will not be a one-off. Right now, the users table is relatively small, but is expected to grow quite quickly. Let me explain the case a little more. I have a prompting system. Prompts need to be able to do some arbitrary task, and can be associated to any number of users. Some prompts will be shown for every user. I need a convenience method on the prompt model to be able to do that, but it will need to build a row in the join table for
[16:43:48] smathy: wcalderipe, so the point was that you see people use it without any rescue because they're generating the forms that will submit back to their app, so they won't ever generate a form that has an ID that doesn't exist in their DB.
[16:43:49] tubbo: wcalderipe: no worries, it's a good starting point but there's no need to take it as gospel...because code and the "proper" way to do things changes so quickly. you never know if you're looking at "good" code from years past or bad code from today :)
[16:44:42] smathy: There's also just very different styles with respect to exceptions, some people love using them as part of their normal execution path.
[16:44:56] Moeh: has joined #RubyOnRails
[16:45:04] wcalderipe: smathy: make sense know.. since i'm building an API this exception will be raised often
[16:45:21] tubbo: beanHolez: yeah i guess you'd just loop over each User and create an association for them when creating the Prompt, but only if you need to.
[16:45:27] beauby: has joined #RubyOnRails
[16:46:23] NBarnes: has joined #RubyOnRails
[16:46:23] beanHolez: @tubbo: I suspected, I just hate the idea of building a new User instance for each of those, when all I really need is the ID for the join table
[16:46:32] wcalderipe: tubbo: your point is also make sense.. i didn't stop to think if i was looking at a "new" code or "old" one
[16:46:55] jessemcgilallen: has joined #RubyOnRails
[16:46:58] wcalderi_: has joined #RubyOnRails
[16:47:14] tubbo: beanHolez: you're not building a new User instance, you'd be building a new instance of the join model that connects Prompt and User.
[16:47:44] sivsushruth: has joined #RubyOnRails
[16:48:17] Moeh: What do you guys use / what can you recommend for updating parts of the UI? Right now I use format.js in the controller something like $('#user').html('<%= j render partial: 'user', :locals => {:user => @user} %>');, however this feels quite clunky and requires lots of duplicated code if you want to use for many different partials. What would be optimal for me is if as reaction to a) a users action or b) a pusher event, I could tell
[16:48:19] wcalderi_: has left #RubyOnRails: ()
[16:48:24] Moeh: without having to adjust the controller, create the additional files etc. Is there a solution like this? Or another approach that you would recommend?
[16:48:45] ruurd: has joined #RubyOnRails
[16:48:59] wcalderipe: has joined #RubyOnRails
[16:49:17] dopamean_: has joined #RubyOnRails
[16:49:26] Shoutsid: has joined #RubyOnRails
[16:50:00] allcentury: has joined #RubyOnRails
[16:50:01] Moeh: I would love something where in the actual ruby code I could write "now refresh partial $uuid" and it would take care of the rest (send the html, create the js to react on it etc)
[16:50:58] zcreative: has joined #RubyOnRails
[16:51:07] arup_r: Moeh: I was reading today https://github.com/rails/turbolinks#client-side-api . I never tried though. But it seems do some automatic update
[16:51:31] tubbo: Moeh: i follow this pattern a lot, making use of rails ujs: https://gist.github.com/tubbo/e223b3c9465a2b09bf7b
[16:51:57] roshanavand: has joined #RubyOnRails
[16:52:03] tubbo: arup_r: fyi...the stuff in that README is actually for the *next* version of turbolinks, and doesn't work right now.
[16:52:38] beanHolez: tubbo: but I still have to iterate the users to get the ID for the new join model: "p = Prompt.first; User.pluck(:id).each {|u_id| p.prompt_users.create(prompt_id: p.id, user_id: u_id) }"
[16:52:39] Moeh: tubbo: I don't understand, how would this update the html?
[16:52:39] arup_r: Ok. Next version will come when ? I want to use it
[16:53:04] djbkd: has joined #RubyOnRails
[16:53:13] arup_r: Moeh: Read Sync gem. That is what you are looking for
[16:53:31] ruurd: has joined #RubyOnRails
[16:53:46] arup_r: because tubbo said, that API is not yet come with turbolink, so we can't use that
[16:54:12] tubbo: beanHolez: well yeah, also `User.each { |user| p.prompt_users.create(user: user) }` does the same thing. and you don't need to set prompt_id if you're calling `p.prompt_users`
[16:54:17] tubbo: it already knows prompt_id is p.id
[16:55:03] tubbo: Moeh: it uses jquery-ujs, which comes packaged by default in rails. here's a guide on how to use it: http://guides.rubyonrails.org/working_with_javascript_in_rails.html
[16:55:56] arup_r: tubbo: I got your point.. so, in the assets/some.js we can render partials too with that hooks right ?
[16:56:10] arup_r: assets/javascripts/some.js
[16:56:13] tubbo: sync looks cool but it makes you give up control
[16:56:41] michaeldeol: has joined #RubyOnRails
[16:56:42] Moeh: tubbo: Ah, yes, I was looking for this snippet: $("#new_article").append xhr.responseText
[16:56:42] arup_r: tubbo: I am still not 100% on sync, but it works.. I need to read the README more.
[16:57:39] tubbo: Moeh: yeah i'm not sure why they went with that...because i think xhr.responseText would be the same as data
[16:57:42] tubbo: but yeah, it works
[16:57:57] arup_r: tubbo: Tell me, do you write render partial kind of things in the ajax callback in assets file? I am curios that is why bugging you
[16:58:00] tubbo: arup_r: i would suggest not recommending tools to other people that even you don't understand fully. or at least provide some kind of disclaimer.
[16:58:13] tubbo: arup_r: no, i just render everything from the server-side.
[16:58:19] Moeh: The issue with this approach is that I would like to avoid updating small parts of the UI with js, I would rather just have rails rerender the whole html for this partial. Therefore I am looking for alternatives.
[16:58:21] beanHolez: tubbo: Ah, yes, oversight. I suppose my real question is, what is the most performant way to get an enumerable collection containing a single column? I'd rather not get full instances in this case so as to avoid overhead
[16:58:23] arup_r: tubbo: I do understand.. But not like a Boss
[16:58:29] tubbo: but sometimes i use JS to get the markup for an action without loading the rest of the UI, so i can just load it into markup
[16:58:35] tubbo: err, sorry, load it into the page*
[16:59:30] rattatmatt: has joined #RubyOnRails
[16:59:32] tubbo: beanHolez: given the way you're doing things, i'm not sure that's possible...but User.pluck(:id) will give you an array of id values for each user.
[16:59:36] arup_r: The sync gem is very handy.. till now what I feel
[16:59:38] tubbo: beanHolez: but i might be wrong
[17:00:20] tubbo: arup_r: yeah it looks interesting, it kinda does what jquery-ujs does as well...just has a lot more code written for you
[17:00:54] petricore: has joined #RubyOnRails
[17:01:36] mikecmpbll: has joined #RubyOnRails
[17:01:40] tubbo: to make what i did work, i updated the gist for ApplicationController...there's a bit of code you need to configure not displaying a layout if the request is ajax
[17:01:40] yaymukund: has joined #RubyOnRails
[17:02:19] ellisTAA: has joined #RubyOnRails
[17:02:28] beanHolez: tubbo: That's my current direction, just wanted to poke around for other suggestions. Here's the final: `User.pluck(:id).each {|u_id| self.prompt_user.create(user_id: u_id) }`
[17:02:41] AzaToth: has joined #RubyOnRails
[17:02:50] ellisTAA: i???m taking a look at unicorn???s documentation, and it says ???Designed for Rack, Unix, fast clients, and ease-of-debugging.??? any idea what it means by fast clients?
[17:04:24] benlieb: has joined #RubyOnRails
[17:05:04] beanHolez: tubbo: Suppose a bit of googling would have helped. FWIW, here's an article showing that pluck is indeed the way to go: http://gavinmiller.io/2013/getting-to-know-pluck-and-select/
[17:06:22] hephaestus_rg: has joined #RubyOnRails
[17:06:47] ellisTAA: beanHolez: looks like where??? am i wrong?
[17:07:21] beanHolez: EllisTAA: Sorry, I don't follow. As in #pluck looks like #where?
[17:07:30] ellisTAA: beanHolez: yeah
[17:09:23] beanHolez: EllisTAA: No, very different. #where is to be used when you want a collection of instantiated models based on some criteria. I needed just the values of a single column from the database. When using #pluck, no model instances are created, and you are given the results of a simplified DB query.
[17:09:44] ellisTAA: beanHolez: ahh i see. cool ill have to use that
[17:10:37] ritic: has left #RubyOnRails: ()
[17:10:59] beanHolez: EllisTAA: definitely useful in my case, where creating model instances for every user in the system is just unnecessary
[17:11:38] Moeh: tubbo: How the gist is right now, would it actually update the DOM on success or would I need to write js for that?
[17:12:24] greenride: has joined #RubyOnRails
[17:13:08] mib32: has joined #RubyOnRails
[17:13:12] freezevee: has joined #RubyOnRails
[17:14:15] DEA7TH: has joined #RubyOnRails
[17:14:40] pabvid: has joined #RubyOnRails
[17:16:38] cnk: has joined #RubyOnRails
[17:19:00] pabvid: has left #RubyOnRails: ()
[17:19:01] tubbo: Moeh: the JS i wrote that binds to the 'ajax:success' is the JS that is run when the ajax request is successful
[17:19:15] dionysus69: has joined #RubyOnRails
[17:19:59] shmilan: has joined #RubyOnRails
[17:20:12] pabvid: has joined #RubyOnRails
[17:22:29] smathy: EllisTAA, if you don't know what a fast client is, then you don't have them.
[17:23:04] tubbo: aren't "fast clients" just like most clients?
[17:23:07] tubbo: most browser clients*
[17:24:03] tubbo: given all our websocket advances, do people even use rainbows! anymore for long-running http requests?
[17:24:56] krisquigley: has joined #RubyOnRails
[17:24:58] Moeh: tubbo: I see. What would you think about something like: http://pastebin.com/fgLE4CvR ? Feels quite hacky, but might get the job done.
[17:25:16] hnanon: What's a good way to check if all columns of a table are not nil?
[17:25:24] craysiii: has joined #RubyOnRails
[17:25:51] arup_r: model_record.attributes.all(&:blank?)
[17:25:58] arup_r: model_record.attributes.all?(&:blank?)
[17:26:08] smathy: tubbo, no, that's not at all what fast clients are.
[17:26:20] arup_r: model_record.attributes.all?(&:nil?) # or..
[17:27:07] EminenceHC: has joined #RubyOnRails
[17:27:58] tubbo: Moeh: wow cool! watch this: "/serve_partial_html?partial=../admin/users/edit&name=Moeh" ;)
[17:27:59] Moeh: Just saw that my idea is quite similar to https://gist.github.com/kylewelsby/1154209
[17:28:00] smathy: tubbo, generally speaking you shouldn't use unicorn to serve clients outside your server's local network because any of them could be slow.
[17:28:09] tubbo: Moeh: that seems like a really bad idea, and a huge security risk
[17:28:18] codeurge: has joined #RubyOnRails
[17:28:49] tubbo: smathy: OHH i see what it means/you mean...a "fast client" in this case is nginx, not the end user, because technically the html is being served by nginx, not unicorn, though unicorn is being used to generate it.
[17:28:52] ellisTAA: is using unicorn or puma as easy as adding the gem to my gemfile and installing it?
[17:29:22] tubbo: EllisTAA: you also need to configure nginx to proxy all dynamic requests to your server (unicorn or puma)
[17:29:35] ellisTAA: tubbo: cool thanks
[17:29:37] baweaver: has joined #RubyOnRails
[17:29:49] bruno-: has joined #RubyOnRails
[17:30:16] beanHolez: has joined #RubyOnRails
[17:30:24] ellisTAA: tubbo: there???s no nginx gem right, i just choose it when i???m deploying?
[17:30:26] tubbo: Moeh: it actually does sound like that Sync gem will work out for you a little better than just using jQuery UJS, since you want to not only programatically be able to choose partials but you also want to use Pusher as a medium for telling the browser when to reload a given bit of html./
[17:30:31] baweaver: has joined #RubyOnRails
[17:30:39] tubbo: EllisTAA: nginx is not written in ruby, so no.
[17:30:46] ellisTAA: tubbo: thanks
[17:32:05] Joufflu: has joined #RubyOnRails
[17:32:09] riotjones: has joined #RubyOnRails
[17:32:28] smathy: tubbo, sure, if your reverse proxy can cache the response, and if that reverse proxy buffer is large enough for the largest response and/or request, then you'll be fine.
[17:32:34] smathy: tubbo, if not then unicorn is a bad choice.
[17:33:16] Cervajz: has joined #RubyOnRails
[17:33:23] ellisTAA: i???m reading about deploying my rails app, and a lot of ppl are bringing up capistrano, what is the benefit of using it over not using it?
[17:33:42] ellisTAA: smathy: would you recommend puma?
[17:34:10] smathy: I don't recommend any one in particular, it depends on your app.
[17:34:27] imkmf: has joined #RubyOnRails
[17:34:35] Cervajz__: has joined #RubyOnRails
[17:34:46] imkmf: has left #RubyOnRails: ()
[17:34:57] smathy: EllisTAA, capistrano just gives you a toolset for deploying your app so that it's basically a single command.
[17:35:00] EminenceHC: has joined #RubyOnRails
[17:35:11] ellisTAA: smathy: i see
[17:35:31] ellisTAA: smathy: so it comes in handy when i have many instances?
[17:35:50] smathy: EllisTAA, not sure what you mean there, it's handy for any deployment of a Rails app.
[17:36:12] ellisTAA: smathy: ah i just read ???Capistrano is an open source tool for running scripts on multiple servers??? so that???s why i asked
[17:36:47] smathy: EllisTAA, well, let me flip the question back at you, how else were you planning on deploying different versions of your Rails app?
[17:37:14] ellisTAA: smathy: i had no plan, this is my first time deploying a serious app
[17:37:20] Moeh: tubbo: May I ask what you think about option 3 (https://gist.github.com/kylewelsby/1154209)? This approach mitigates the security risk, correct?
[17:37:40] smathy: EllisTAA, ok, so what other alternatives are you considering?
[17:38:22] jenrzzz: has joined #RubyOnRails
[17:38:22] ellisTAA: smathy: i just assumed i deployed once and amazon figured it out when the site needed more servers ..
[17:38:29] tubbo: Moeh: not really, it's just writing the same thing in a different way.
[17:38:40] tenderlove: has joined #RubyOnRails
[17:38:49] Pharaoh2: has joined #RubyOnRails
[17:38:49] smathy: EllisTAA, "needed more servers"?
[17:38:52] ngscheur1: has joined #RubyOnRails
[17:39:02] tubbo: Moeh: it seems like you're building something that the sync gem just does for you automatically...i'm not sure why you're bothering to write all this code.
[17:39:09] smathy: EllisTAA, capistrano is not about scaling out to multiple servers, it's about deploying your app. Like, new versions of your app.
[17:39:10] ellisTAA: smathy: yeah like the site had a lot of traffic and i needed another server
[17:39:32] ellisTAA: smathy: ahhh ok, so when i make a change and want to update the app?
[17:39:38] smathy: EllisTAA, yes.
[17:39:46] smathy: EllisTAA, that's what "deployment" is.
[17:39:50] ellisTAA: smathy: cool ok, so i should use capistrano i???m guessing
[17:39:51] Shoutsid: has joined #RubyOnRails
[17:39:58] ellisTAA: smathy: lol
[17:40:48] smathy: EllisTAA, unless you have some other deployment system that you're already familiar with.
[17:40:55] ellisTAA: smathy: nope
[17:41:43] [Butch]: has joined #RubyOnRails
[17:41:47] Lightsword: has joined #RubyOnRails
[17:43:51] petricore: has joined #RubyOnRails
[17:44:17] Moeh: tubbo: Yes, you might be right. I usually prefer to write the things myself to have better understanding, but will try with sync first.
[17:45:52] beingjohnm: I need to deploy a demo of my app tomorrow for the first time. Is this a pretty good guide of how to do that? http://robmclarty.com/blog/how-to-deploy-a-rails-4-app-with-git-and-capistrano Or does anybody know of a better guide?
[17:48:05] smathy: beingjohnm, if you're new to this, and you need it tomorrow, then I think this is the best guide: https://devcenter.heroku.com/articles/getting-started-with-ruby#introduction
[17:48:59] krainboltgreene: Because I'm fairly sure I've never seen this done, here's a showcase of destructing an array: https://gist.github.com/krainboltgreene/2c6c3f29560c0c52a951
[17:49:04] jsrn_: has joined #RubyOnRails
[17:49:47] beingjohnm: smathy: I'll take a look at that. I'm probably going to deploy to an ec2 micro instance but I imagine most instruction will be similar.
[17:50:35] smathy: beingjohnm, my point really is that if you're new to this and need it online for tomorrow, just use heroku.
[17:52:05] pawnbox: has joined #RubyOnRails
[17:52:20] beanHolez: has joined #RubyOnRails
[17:52:29] beanHolez: I have a model with a #method_missing defined. The model is associated to users via belongs_to. I can see that instances of the model have a #user_id= defined, but setting that attribute causes #method_missing to be called. Any reason this might be?
[17:53:59] beingjohnm: smathy: ahh, got it! I want to include a demo with my YC application.
[17:54:13] lporras: has joined #RubyOnRails
[17:54:17] ishikawa91: could you provide a short gist, beanHolez?
[17:54:55] rubyonrailed: has joined #RubyOnRails
[17:55:11] chills42: has joined #RubyOnRails
[17:56:14] cnk: beingjohnm: The Heroku advise is excellent advise. If you reject that, my second choice would be a DigitalOcean VPS and their docs
[17:56:54] cnk: Their docs are good enough I am considering moving my vps there just to +1 their public info
[17:57:23] ishikawa91: for digital ocean, you can usually find their 2 month free coupon ($10)
[17:58:47] andersoldahl: has joined #RubyOnRails
[17:59:51] siddart: has joined #RubyOnRails
[18:00:20] axl_: has joined #RubyOnRails
[18:00:29] ellisTAA: anyone know what ???pty??? in my deploy file means?
[18:02:15] yaymukund: has joined #RubyOnRails
[18:02:19] beanHolez: ishikawa91: https://gist.github.com/bholzer/327877b55d43a0c54e32
[18:02:49] djbkd: has joined #RubyOnRails
[18:03:20] beanHolez: EllisTAA: I believe it means "pseudo-tty"
[18:03:21] tubbo: EllisTAA: https://en.wikipedia.org/wiki/Pseudoterminal
[18:03:34] djbkd: has joined #RubyOnRails
[18:03:58] kalusn: has joined #RubyOnRails
[18:05:36] Skelz0r: has joined #RubyOnRails
[18:06:56] solars: has joined #RubyOnRails
[18:06:56] yardenbar: has joined #RubyOnRails
[18:08:28] beingjohnm: cnk: I have a digital ocean droplet I can use too. Just have a reserved ec2 instance that I'm paying for and not using. I'll check out the DO docs as well. Thanks.
[18:09:18] craysiii: anyone have an bad experience with digital ocean and droplets with high cpu load?
[18:09:31] corioliss: has joined #RubyOnRails
[18:09:44] beingjohnm: I find the heroku pricing/ap availiblity confusing
[18:10:10] beanHolez: craysiii: I was not particularly impressed with DO. I've enjoyed the switch to S3
[18:11:17] craysiii: im looking to base a service off of their API, but don't want to get booted from the platform for high cpu or bandwidth usage. i dont think AWS would work for me but thanks :)
[18:11:45] meoblast001: has joined #RubyOnRails
[18:12:34] beanHolez: craysiii: You likely won't be booted, but I would expect to see slowdowns. I'm curious, if you don't mind my asking, what is it you are looking to accomplish?
[18:12:53] tubbo: craysiii: i'm not sure DO will "boot you from the platform", just figured they'd upcharge you if you used too many resources
[18:13:07] beanHolez: You can get droplets meant for high-cpu usage, or whatever uses you may need
[18:13:12] craysiii: i want to utilize their api to spin up pre-configured images for various types of servers
[18:13:20] beingjohnm: smathy: cnk: I think guys are right. Going to try Heroku. My time is much bettern spent over the next day on things other than setting up a server.
[18:13:31] gambl0re: can i delete a table row from the console?
[18:13:43] craysiii: gambl0re yes
[18:13:53] smathy: beingjohnm, yep, come back and revisit later - but for now, use heroku.
[18:13:57] cnk: beingjohnm: exactly. And you can move your DNS entry some time later
[18:14:14] smathy: beingjohnm, especially being a YC application, it speaks to your "focus on what's important"-ivity
[18:14:48] beanHolez: craysiii: That was exactly where I found DO lacking relative to AWS. I've been using a tool called terraform for building resources like that, may be something worth checking out.
[18:14:56] beingjohnm: smathy: For sure. I highly doubt I'll be accepted being a single founder but figure a demo would give me just a little more of a chance.
[18:15:09] beingjohnm: I've accomplished a lot over the last month or so with your guys' help!
[18:15:20] smathy: beingjohnm, FWIW, for a demo app you'd just use the free option.
[18:15:21] tubbo: beingjohnm: just surgically alter yourself to look like mark zuckerberg and you're IN
[18:15:22] craysiii: beanHolez i will definitely check that out, thanks!
[18:15:23] lucianosousa: has joined #RubyOnRails
[18:15:47] Shoutsid: has joined #RubyOnRails
[18:15:52] beingjohnm: tubbo: hah. I should wear a hoodie for my intro video.
[18:15:58] EminenceHC: has joined #RubyOnRails
[18:16:35] gambl0re: how would i delete a row in the console
[18:16:37] hephaestus_rg: has joined #RubyOnRails
[18:16:45] gambl0re: im trying to do the way i would normally doing in rails console
[18:16:55] gambl0re: im talking about browser console by the way
[18:16:57] gambl0re: not rials console
[18:17:09] tubbo: gambl0re: lol well you probably should have specified...no there is not a way to do that in the browser console.
[18:17:13] sarink: has joined #RubyOnRails
[18:17:13] craysiii: lol that would be important to know..
[18:17:21] beanHolez: craysiii: It's made by hashicorp who also develops vagrant, so they certainly seem to have a good team behind it.
[18:17:32] tubbo: i was wondering why that question looked painfully obvious..
[18:17:37] baweaver: has joined #RubyOnRails
[18:17:41] bendangelo: has joined #RubyOnRails
[18:17:46] gambl0re: yea i forgot to mention
[18:17:49] tubbo: beanHolez: +1 on terraform :)
[18:17:53] tubbo: we use it here and it's great
[18:18:03] craysiii: beanHolez i just want to offer voip/game servers/combo deals. you don't think its overkill?
[18:18:04] tubbo: along with chef
[18:18:29] ellisTAA: when adding a file to .gitignore, do i just throw the name of the file in there or do i need to throw in the path? i???ve looked online, can???t find anything
[18:19:17] kalusn: has joined #RubyOnRails
[18:19:41] dopie: anyone here use the figaro I'm struggling to make my env work
[18:19:57] beanHolez: craysiii: It's as complex as you want it to be, really. If you ever plan on building a similar infrastructure more than once, it seems to offer an advantage. Like @tubbo said, combined with chef, it makes server deployment as bout as easy as it gets if you still need some flexibility.
[18:20:13] jgt: has joined #RubyOnRails
[18:20:15] craysiii: awesome thanks you two.
[18:20:20] tubbo: dopie: !used
[18:20:20] helpa: dopie: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[18:20:22] Shoutsid: has joined #RubyOnRails
[18:20:37] dopie: I know, I've seen that 300 times
[18:20:39] dopie: just a habit
[18:21:03] doodlehaus: has joined #RubyOnRails
[18:21:46] greengriminal: has joined #RubyOnRails
[18:23:31] dopie: https://gist.github.com/staycreativedesign/4ca4827150021ffcc677
[18:23:36] dopie: am i using figaro correctly?
[18:23:36] mary5030_: has joined #RubyOnRails
[18:24:41] yardenbar: has joined #RubyOnRails
[18:24:51] Motoservo: has joined #RubyOnRails
[18:26:23] jameswork: has joined #RubyOnRails
[18:27:24] ericjphillips: has joined #RubyOnRails
[18:27:35] gambl0re: ok so i know basic rails and how to do simple crud operations
[18:28:15] beanHolez: ishikawa91: I found a fix for my method_missing problem. It appears I had a fundamental misunderstanding of how it works. The solution was to check to see if the model "respond_to?", and call super if so. Otherwise, send the call to the delegator
[18:28:24] gambl0re: now i want to learn to do something different with rails. i want to learn how to use open data to create a rails app. so my city has a site where it has loads of open data to use. how can i use this data to create a rails app.
[18:28:28] rromanch_: has joined #RubyOnRails
[18:29:09] craysiii: well gambl0re if they provide an api, you can make simple api calls to generate data in your controller, or you could set up a daemon to populate your own DB.
[18:29:18] beanHolez: gambl0re: First, you need to determine what it is you'd like to accomplish. That is step 1, and you won't get anywhere without it. The idea, though, is to use Rails as a middleman between your user and the services provided by your city.
[18:30:14] gambl0re: ok well for example, one idea had was to get the lat/long co-ordinates of some of the tourist attractions around the city and plop them on a map using google maps
[18:30:33] mary5030: has joined #RubyOnRails
[18:30:35] gambl0re: but i dont know where to start
[18:30:47] craysiii: create some user stories
[18:30:54] craysiii: execute one by one
[18:31:13] gambl0re: what do you mean creaet user stories
[18:32:05] gambl0re: are there any tutorials where i can learn to make rails apps using open data?
[18:32:09] chouhoulis: has joined #RubyOnRails
[18:32:15] mary5030_: has joined #RubyOnRails
[18:32:22] bklane: has joined #RubyOnRails
[18:32:28] hephaestus_rg: has joined #RubyOnRails
[18:32:53] riotjones: has joined #RubyOnRails
[18:33:29] beanHolez: gambl0re: They are everywhere. The open-data part isn't really that important as a criteria. Essentially what happens is you replace calls to your own database with calls to an external service. Everything else is going to be mostly the same. Have you built a rails app before?
[18:33:45] ritic: has joined #RubyOnRails
[18:34:05] riotjones: has joined #RubyOnRails
[18:34:16] han`: has joined #RubyOnRails
[18:34:49] cnk: gambl0re: sounds like you need inspiration. Is there an open data / open gov meetup anywhere near you?
[18:34:57] riotjones: has joined #RubyOnRails
[18:35:04] cnk: There are lots in Los Angeles so may be some near you
[18:35:14] gambl0re: ive only been creating crud apps
[18:35:18] gambl0re: its getting boring..
[18:35:27] benlieb: has joined #RubyOnRails
[18:35:54] craysiii: where can i learn about rails meetups in the bay area?
[18:36:07] dopie: ugh nobody?
[18:36:09] dopie: https://gist.github.com/staycreativedesign/4ca4827150021ffcc677
[18:36:27] beanHolez: The gist is much the same. But instead of using your controllers to interact with your database, you want to use them to interact with another service (generally through another module or class, keep those controllers skinny).
[18:36:32] dopie: I need help setting up figaro env ... for some reason i'm doing something wrong and I can't figure it out
[18:36:53] han`: I've been working at the same company for 15 years. I'm looking to branch out into rails contract jobs, but am wondering how to structure my resume because I've been with one company so long...
[18:37:00] cnk: dopie: Nope. I don't use figaro and your gist doesnt tell me what doesn't work
[18:37:02] beanHolez: dopie: I've not used figaro, but it looks pretty friendly. What exactly is the problem you are running into?
[18:37:16] safety_cut: has joined #RubyOnRails
[18:37:48] Shoutsid: has joined #RubyOnRails
[18:37:57] dopie: Well I get this error observer
[18:38:13] han`: has left #RubyOnRails: ()
[18:38:13] craysiii: stacktrace? error log?
[18:38:20] han`: has joined #RubyOnRails
[18:38:30] mary5030: has joined #RubyOnRails
[18:39:05] mary5030: has joined #RubyOnRails
[18:40:36] dopie: i updated the gist with the error
[18:40:40] beanHolez: Can anyone explain the process by which method_missing determines that a method is indeed missing?
[18:40:40] Lincee: has joined #RubyOnRails
[18:42:32] Shoutsid: has joined #RubyOnRails
[18:42:55] han`: beanHolez: http://phrogz.net/RubyLibs/RubyMethodLookupFlow.pdf
[18:43:13] beanHolez: dopie: Have you seen this answer on SO?: http://stackoverflow.com/a/26251177/1443478
[18:43:34] han`: also beanHolez, let me know if you can see this, i just registered this nick and can't tell if my messages are going through
[18:43:45] beanHolez: han`: yeah, it took
[18:43:50] han`: cool, thanks
[18:44:11] meoblast001: has joined #RubyOnRails
[18:46:09] mary5030: has joined #RubyOnRails
[18:46:26] ericjphillips: has joined #RubyOnRails
[18:46:47] podman: has joined #RubyOnRails
[18:46:51] mary5030: has joined #RubyOnRails
[18:47:07] eikood: has joined #RubyOnRails
[18:48:03] mary5030: has joined #RubyOnRails
[18:48:06] Scriptonaut: Hey guys, I have a person model, with friendlyId slugs. I have a guy who's slug is euclideanowner. GET /people/euclideanowner/edit works just fine. However, when I PATCH to /people/euclideanowner, it is saying the route doesn't exist, even though it should be going to people#update
[18:48:37] craysiii: scriptonaut can you post your routes.rb and result of rake routes
[18:48:41] sankaber: has joined #RubyOnRails
[18:48:55] Scriptonaut: the entire thing? Or just the relevant stuff
[18:49:04] pwnd_nsfw: has joined #RubyOnRails
[18:49:31] Shoutsid: has joined #RubyOnRails
[18:50:03] Scriptonaut: craysiii: https://gist.github.com/robins35/b894a118807a13247421
[18:50:16] Scriptonaut: the rake routes output is the output of rake routes | grep '/people/'
[18:50:57] manfrin: has joined #RubyOnRails
[18:51:11] zorbash_: has joined #RubyOnRails
[18:51:43] craysiii: can we see the code where you are calling the request?
[18:51:47] craysiii: in the same gist
[18:53:04] zorbash: has joined #RubyOnRails
[18:53:31] djbkd: has joined #RubyOnRails
[18:53:37] Scriptonaut: craysiii: https://gist.github.com/robins35/b894a118807a13247421
[18:53:48] Scriptonaut: it's just a form_for
[18:54:39] Scriptonaut: here's the stack trace: https://gist.github.com/robins35/b894a118807a13247421
[18:55:47] srinidhi: has joined #RubyOnRails
[18:56:33] craysiii: have you tried method: :patch
[18:57:09] draig: has joined #RubyOnRails
[18:57:22] Scriptonaut: No, but I checked the source and it has a hidden field that is a patch
[18:57:27] Scriptonaut: I'll try that
[18:57:29] youngbaks: has joined #RubyOnRails
[18:57:49] craysiii: yeah the docs say that what you have should have an implicit patch, just wondering if you'll get the same result by using it explicitly
[18:58:14] yaymukund: has joined #RubyOnRails
[18:58:37] safety_cut: has joined #RubyOnRails
[18:58:47] Scriptonaut: I tried explicitly setting both patch and put, no luck
[18:59:02] Scriptonaut: I think it's an issue with friendlyID, it's one of the most finnicky gems I've used
[19:00:13] smathy: FriendlyID doesn't seem to have enough functionality to warrant its use.
[19:00:35] Scriptonaut: I agree, the guy who managed this app before me was extremely Gem happy
[19:00:59] smathy: Same with the team I joined.
[19:01:05] craysiii: i like has_permalink, but then again its the only one i've used :P
[19:01:27] bungoman: has joined #RubyOnRails
[19:01:33] chouhoulis: has joined #RubyOnRails
[19:02:31] Scriptonaut: weird, it's only this one user
[19:02:35] Scriptonaut: the other users work fine
[19:02:46] Scriptonaut: must be friendlyID
[19:03:20] netzfisch: has joined #RubyOnRails
[19:04:22] dopie: updated errors
[19:04:22] dopie: https://gist.github.com/staycreativedesign/4ca4827150021ffcc677
[19:04:51] smathy: Scriptonaut, your gist says it's using a POST, not a PATCH. If `form_for person` is really what you have, where is the local `person` variable being set?
[19:05:55] krisquigley: has joined #RubyOnRails
[19:06:02] arup_r: Ok. So I decided to use counter_cache in one of my model. Now, I have to reset the existing records to. I thought to put the Post.find_each { |post| Post.reset_counters(post.id, :comments) } inside the migration through which I will add counter cache column. But it will fail when I will be doing rollback. So what check should I give inside the migration ?
[19:06:38] Scriptonaut: smathy: an exposure
[19:06:41] Scriptonaut: that I put in there as well
[19:06:42] gregmolnar: has joined #RubyOnRails
[19:07:20] arup_r: should I write migration classical up and down way ?
[19:07:25] Scriptonaut: hmm, you're right smathy
[19:07:33] Scriptonaut: I'll see if my person is nil or something
[19:07:57] arup_r: Am I visible ?
[19:08:06] gregmolnar: has left #RubyOnRails: ()
[19:08:32] arup_r: thanks to confirm
[19:08:36] gregmolnar: has joined #RubyOnRails
[19:08:37] roshanavand: has joined #RubyOnRails
[19:08:40] gregmolnar: has left #RubyOnRails: ()
[19:08:43] arup_r: I am keep disconnecting... so was not sure
[19:10:16] Scriptonaut: I wonder if I have some JS that's preventingDefault and then doing a post
[19:10:28] Scriptonaut: doesn't make sense why only on this one user though
[19:10:40] Scriptonaut: person isn't null, and it's persisted?
[19:12:00] smathy: Scriptonaut, person is persisted? and yet the form isn't generating a PATCH _method ?
[19:12:19] Scriptonaut: well, the form itself has a PATCH hidden field
[19:12:19] smathy: Scriptonaut, so looking at the HTML you don't see it?
[19:12:28] Scriptonaut: it's in the HTML, just not in the console
[19:13:11] Scriptonaut: <input type="hidden" name="_method" value="patch">
[19:13:14] Scriptonaut: that's in my form
[19:15:10] smathy: Scriptonaut, ok, and what about if you refresh on your /people/euclideanowner/edit page before submitting?
[19:15:21] Scriptonaut: no difference
[19:16:25] craysiii: so the speed that is gained by turbolinks isn't worth it?
[19:16:31] Scriptonaut: It has the hidden input with value patch still, but when I look in the log, it's doing a POST. What I'm confused about, is even if it *is* doing a POST, why is it telling me I have no route, when I do have a route for POST on people (create)
[19:17:03] craysiii: because the POST route doesn't match the URL pattern
[19:17:03] smathy: Scriptonaut, smells like your jquery-ujs isn't loaded.
[19:17:18] Scriptonaut: why would it be just for one person and not the rest
[19:17:20] smathy: Scriptonaut, if you view the source, can you see it?
[19:17:53] smathy: Scriptonaut, you don't have a route for POST on /people/euclideanowner
[19:17:59] roshanavand: has joined #RubyOnRails
[19:18:05] smathy: Ie. on /people/:id
[19:18:08] Scriptonaut: smathy: huh? THat's how I create people
[19:18:15] Scriptonaut: isn't the :id interchangeable with slug
[19:18:21] Scriptonaut: and yes jqueryujs is included
[19:19:15] Maletor: has joined #RubyOnRails
[19:19:17] dideler76: has joined #RubyOnRails
[19:19:34] smathy: Scriptonaut, you're actually not showing any create action for people in your https://gist.github.com/robins35/b894a118807a13247421#file-rake_routes
[19:20:05] smathy: Scriptonaut, but even if you were, it would be `POST /people` NOT `POST /people/:id`
[19:20:25] smathy: Scriptonaut, just stop your rails server, stop/kill spring, and restart your rails server.
[19:20:33] Coldblackice_: has joined #RubyOnRails
[19:21:02] Scriptonaut: I have no spring but I'll restart it
[19:21:32] kadoppe: has joined #RubyOnRails
[19:21:33] smathy: Scriptonaut, you asked: "isn't the :id interchangeable with slug" - kind of, the routing engine doesn't care what `:id` is replaced with, but it has to be replaced with something, so /people won't ever match /people/euclideanowner
[19:21:36] chrissonar: has joined #RubyOnRails
[19:21:50] smathy: Scriptonaut, you're sure you have no spring?
[19:21:59] Scriptonaut: ps ax | grep spring returned nothing
[19:22:41] Scriptonaut: bleh, still no luck
[19:22:56] theblang: has joined #RubyOnRails
[19:23:19] chrissonar: I use githubs redcarpet gem for markdown. I expected to return an HTML wit pr tag having several span tags inside, but it only returns a code tag (without any spans). Any idea, what this issue is about?
[19:23:20] pwnd_nsfw: isn't that installed by default?
[19:23:45] jameswork: has joined #RubyOnRails
[19:24:22] smathy: Scriptonaut, so, seems like a side-track, but why don't you have a create route for people?
[19:24:40] Pharaoh2: has joined #RubyOnRails
[19:24:41] Scriptonaut: I'll double check, I know i do
[19:24:54] Scriptonaut: it's saying I don't, but I do
[19:24:57] Scriptonaut: I create people just fine
[19:24:59] smathy: Scriptonaut, right, so I'm wondering why your gist doesn't say it.
[19:25:35] lucianosousa: has joined #RubyOnRails
[19:25:47] smathy: Scriptonaut, so what's the URL you're posting to?
[19:26:19] bender_unit: has joined #RubyOnRails
[19:26:26] Scriptonaut: ah, found the create
[19:26:44] Scriptonaut: there is a create, with a POST to /people(.:format)
[19:26:45] smathy: Scriptonaut, so, please make a new gist with updated code.
[19:26:52] smathy: Not in your gist.
[19:27:20] jameswork: has joined #RubyOnRails
[19:27:44] mloy: has joined #RubyOnRails
[19:27:46] mloy_: has joined #RubyOnRails
[19:28:02] stamina: has joined #RubyOnRails
[19:28:19] smathy: Scriptonaut, and add your Person model.
[19:28:46] smathy: Scriptonaut, and the decorator class you're using.
[19:29:09] rromanch_: has joined #RubyOnRails
[19:29:34] codeurge: has joined #RubyOnRails
[19:29:38] arBmind: has joined #RubyOnRails
[19:29:44] baweaver: has joined #RubyOnRails
[19:30:09] jenrzzz: has joined #RubyOnRails
[19:30:28] Scriptonaut: smathy: https://gist.github.com/robins35/b894a118807a13247421
[19:30:30] kristofferR: has joined #RubyOnRails
[19:31:11] beauby: has joined #RubyOnRails
[19:31:48] wa_r_ch_i__ld1: has joined #RubyOnRails
[19:32:19] smathy: So, you're still showing the log/exception from 11:42 - nearly an hour ago. Please run this again and paste the updated log.
[19:32:42] Scriptonaut: the code hasn't changed?
[19:32:48] Scriptonaut: the error is virtually identical
[19:32:52] manfrin_: has joined #RubyOnRails
[19:33:48] richipargo: has joined #RubyOnRails
[19:33:50] alaing: has joined #RubyOnRails
[19:34:03] Scriptonaut: https://gist.github.com/robins35/b894a118807a13247421
[19:34:07] Scriptonaut: that's the new error
[19:34:29] arup_r: if anybody want to know the answer ... of my question. This is how you can solve it : https://gist.github.com/aruprakshit/c0a4990ce7af8ecaa66f
[19:35:27] allcentury: has joined #RubyOnRails
[19:35:38] riotjones: has joined #RubyOnRails
[19:35:41] roshanavand: has joined #RubyOnRails
[19:36:43] riotjones: has joined #RubyOnRails
[19:37:15] Scriptonaut: hrm, it's just this one guy, I'm just going to ignore it and see if it works on the staging server later
[19:37:34] riotjones: has joined #RubyOnRails
[19:37:43] alaing: has joined #RubyOnRails
[19:37:50] alaing: HI I wonder if someone can help me understand how to use my joined tables
[19:37:57] manfrin`_: has joined #RubyOnRails
[19:37:58] alaing: I'm new to rails but understand how to write native sql joins and to use them
[19:38:20] alaing: I have ExpenseFreqType classthat has a has_many :expense_type and a class called ExpenseType that has a belongs_to :expense_freq_type
[19:39:19] alaing: Does this mean they will always be associated or do I still need to do that within the model or controller
[19:39:44] smathy: Scriptonaut, and you're using decent_exposure?
[19:40:12] ror15: has joined #RubyOnRails
[19:40:13] craysiii: you still need to create the association yourself
[19:40:18] craysiii: in your controller
[19:40:49] alaing: this is in my schema add_index "expense_types", ["expense_freq_types_id"], name: "index_expense_types_on_expense_freq_types_id"
[19:40:52] Scriptonaut: it doesn't work in beta either
[19:40:59] Scriptonaut: I filed a bug for it
[19:41:18] Scriptonaut: I need to get on to the story I was working on, thanks for helping me there
[19:41:22] alaing: cycliam: like this? @expense_types = ExpenseType.joins('INNER JOIN expense_freq_types ON expense_freq_types.id = expense_types.expense_freq_types_id').includes(:expense_freq_type)
[19:41:26] smathy: Scriptonaut, just that the docs for that mention a :finder option, not a :find option.
[19:41:33] smathy: Scriptonaut, np.
[19:41:48] arup_r: Again something new learned today
[19:41:51] craysiii: http://guides.rubyonrails.org/association_basics.html
[19:41:54] alaing: not to sure about the "includes
[19:41:56] arup_r: I am happy again
[19:41:59] Scriptonaut: Oh I forgot, smathy I'm using adequate exposure now
[19:42:43] yaymukund: has joined #RubyOnRails
[19:43:39] alaing: craysiii: like this? @expense_types = ExpenseType.joins('INNER JOIN expense_freq_types ON expense_freq_types.id = expense_types.expense_freq_types_id').includes(:expense_freq_type)
[19:43:50] alaing: Just having another read over that guide
[19:44:39] tubbo: Scriptonaut: what is adequate exposure?
[19:45:14] Scriptonaut: It's like decent_exposure before they went all crazy
[19:45:32] Scriptonaut: by hashrocket'
[19:45:33] Kerber0s: has joined #RubyOnRails
[19:45:47] craysiii: alaing you are trying to create an association between two models right?
[19:45:53] tubbo: Scriptonaut: yeah i just found it :) who went "all crazy", hashrocket?
[19:46:10] tubbo: i kinda like the way it works, allowing me to run authorization/decoration on every model
[19:46:16] han`: alaing: you shouldn't have to write that join. You could just reference expense_type.expense_freq_types
[19:46:17] alaing: craysiii: yes two tables that I have in my database
[19:46:18] craysiii: suppose you have @modelA and @modelB, to create the association you would do @modelA.modelB = @modelB
[19:46:25] Scriptonaut: they just really beefed up the gem
[19:46:38] Scriptonaut: we prefered the traditional minimal exposure that was originally decent_exposure
[19:47:00] ruurd: has joined #RubyOnRails
[19:47:00] alaing: craysiii: ah thats kind of what I'm after
[19:47:04] craysiii: if you go to the link i provided you, search for "Detailed Association Reference", a code example should be available there
[19:47:12] craysiii: http://guides.rubyonrails.org/association_basics.html
[19:48:49] roshanavand: has joined #RubyOnRails
[19:49:50] alaing: craysiii: hmmm its kind of going over my head
[19:51:03] smathy: Probably skimming/reading too fast and not playing in a demo app enough.
[19:51:15] arBmind: has joined #RubyOnRails
[19:51:39] havenwood: alaing: Keep re-reading it. It slowly sinks in for me sometimes that way.
[19:51:51] arup_r: Hey.. any tricks : pluralize(2, 'person') #=> " 2 People"
[19:52:16] ruurd: has joined #RubyOnRails
[19:52:24] baweaver: has joined #RubyOnRails
[19:52:30] arup_r: I meant: pluralize(2, 'person') #=> "2 People"
[19:52:46] slash_nick: arup_r: what do you mean, "any tricks"?
[19:53:20] arup_r: I want some customization beyond the doc: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-pluralize
[19:53:21] synthroid: has joined #RubyOnRails
[19:53:33] havenwood: arup_r: Like what?
[19:53:37] axl__: has joined #RubyOnRails
[19:53:39] pwnd_nsfw: has joined #RubyOnRails
[19:53:43] arup_r: not "2 people" but "2 People"
[19:53:55] slash_nick: arup_r: just call (what you have).titleize
[19:54:30] arup_r: That's it.. I was thinking to use yaml .. lol
[19:54:57] alaing: craysiii havenwood does it depend heavily on the schema i created to work properly?
[19:55:19] smathy: ...or also, if your input has a leading cap, then the output will be capitalized too.
[19:55:39] ruurd: has joined #RubyOnRails
[19:55:48] craysiii: it depends on your DB schema, your defined relations in each model
[19:56:29] craysiii: if you're trying it and getting errors, we would really like you to post your code/errors to gist
[19:56:44] alaing: craysiii: i'll pastebin the schema
[19:56:57] alaing: craysiii: ok,
[19:57:10] doodlehaus: has joined #RubyOnRails
[19:57:27] craysiii: include your schema, the two related models, the controller
[19:58:29] alaing: craysiii: I'm just trying to create a little app that records my budget
[19:58:42] alaing: just using it as an example app to get my head around rails
[19:58:59] alaing: and hopefully it will become something more useful to me
[19:59:46] hephaestus_rg: has joined #RubyOnRails
[20:00:18] craysiii: have you done any tutorials / online programs?
[20:00:34] safety_cut: has joined #RubyOnRails
[20:01:36] diegoviola: has joined #RubyOnRails
[20:01:53] alaing: yeah I've done the basic make a "twitter type" app
[20:01:55] Pharaoh2: has joined #RubyOnRails
[20:02:02] hobodave: has joined #RubyOnRails
[20:02:16] craysiii: and it didn't have associations ?
[20:02:18] alaing: but find its just very basic and just really cpy whatever you get told
[20:03:05] alaing: good point.....Not that i remember but thinking about it it would be strange not too
[20:03:22] alaing: anyway heres my schema, controllers and models http://pastie.org/10477353
[20:05:20] safety_cut: has joined #RubyOnRails
[20:05:50] alaing: craysiii: thinking of your very simple example
[20:06:05] alaing: I think i need to remove line 42 in the pastie
[20:06:28] baweaver: has joined #RubyOnRails
[20:06:33] craysiii: do you know SQL at all?
[20:06:36] bonhoeffer: has joined #RubyOnRails
[20:06:52] craysiii: what you are trying to do is query the database and perform a JOIN
[20:07:46] alaing: craysiii: I do, I've been usign ORACLE and building application using ORACLE Application Express (Oracles version of php/phpmyadmin)
[20:07:58] alaing: craysiii: for the passed 10years
[20:08:20] craysiii: then why do you think JOIN is appropriate in order to create an association between two models?
[20:08:20] alaing: If I wrote this in sql it would be
[20:08:24] tubbo: that's hilarious
[20:08:36] siddart: has joined #RubyOnRails
[20:08:49] tubbo: i actually didn't know oracle made tools for writing apps, thought it was purely database stuff
[20:09:50] jenrzzz: has joined #RubyOnRails
[20:10:13] alaing: tubbo: https://apex.oracle.com/en/ its alright to get something up and running quickly but crap at trying to make something more customised
[20:10:19] craysiii: when i studied oracle 11g we had to use their special tool to interact with their DBs
[20:10:40] alaing: craysiii: SQL Developer?
[20:10:42] tubbo: alaing: yeah but you used it for TEN YEARS...
[20:11:13] craysiii: no, but i had interest in becoming one. not anymore
[20:11:19] alaing: tubbo I had to also support IE7 up until about 2 months ago when I decided to leave and join another team
[20:11:28] EminenceHC: has joined #RubyOnRails
[20:11:53] craysiii: anyway there is too much here for me to be able to walk you through this. i can't write your app for you
[20:12:27] Scripore: has joined #RubyOnRails
[20:12:27] djbkd: has joined #RubyOnRails
[20:12:42] alaing: craysiii: yeah I know and really appreciate your help so far. I',m just trying to get my head around rails and the syntax
[20:13:31] alaing: ok so if two models are associated do you have them available as instance variables within a controller
[20:14:10] alaing: or do you need to init them as variables and then do @modelA.modelb = @modelb
[20:14:30] alaing: eg. @modelb = ModelB.all
[20:14:41] Dopagod: has joined #RubyOnRails
[20:14:45] qejk: has joined #RubyOnRails
[20:15:09] craysiii: well, ideally, in your controller one model instance would already exist, which you would query and assign to an instance variable. the second model, the one that an association is being created on most likely, is built or created in the controller, from which you get an instance variable, and then you would make the assignment after.
[20:15:59] craysiii: @item = Item.where(user: current_user); @thing = Thing.new; @thing.item = @item; @thing.save
[20:16:04] joshkovach: has joined #RubyOnRails
[20:16:51] craysiii: though normally you would have a condition on @thing.save, where you would handle if it saved successfully or not.
[20:17:09] snockerton: has joined #RubyOnRails
[20:17:15] petricore: has joined #RubyOnRails
[20:17:35] alaing: Thanks thats making more sense and Yes I've seen how you can handle success/failures on .save
[20:17:43] alaing: let me give that a try
[20:17:56] snockerton: is there a way to "attach a rails console" to a running pry session, given a path to a rails project?
[20:17:59] alaing: thank you very much.....
[20:18:02] speakingcode: has joined #RubyOnRails
[20:18:19] snockerton: i.e. how do you import / read a model into pry?
[20:18:23] alaing: and I'm sorry if I came across as a total noob
[20:18:32] naftilos76: has joined #RubyOnRails
[20:18:33] bePolite: has joined #RubyOnRails
[20:18:34] zeknox: has joined #RubyOnRails
[20:18:35] bePolite: has joined #RubyOnRails
[20:20:18] craysiii: snockerton you mean how do you load a model from your rails project into the corresponding pry console
[20:20:44] alaing: craysiii: I initially through @expense_types = ExpenseType.all would automatically return the freq types
[20:21:06] joshkovach: has joined #RubyOnRails
[20:22:11] craysiii: well you should be able to access the freq type, @expense_types.each { |e| e.expense_freq_type ... }
[20:22:19] craysiii: as long as that association is already made
[20:22:38] Ergo: has joined #RubyOnRails
[20:22:53] snockerton: craysiii: yes, as in i launched an unrelated pry somewhere else and want to go "rails console" mode without exiting
[20:25:06] craysiii: i don't know that you're able to, a quick glance at https://github.com/pry/pry doesn't reveal anything, but maybe an expert like smathy can chime in :)
[20:27:47] smathy: ACTION clears his throat
[20:28:21] craysiii: (sorry for calling you)
[20:28:45] yfeldblum: has joined #RubyOnRails
[20:28:52] smathy: There is https://github.com/Mon-Ouie/pry-remote - but it sounds more like snockerton has a problem right now.
[20:29:48] northfurr: has joined #RubyOnRails
[20:29:49] ericjphillips: has joined #RubyOnRails
[20:30:10] Pharaoh2: has joined #RubyOnRails
[20:30:49] northfurr: anyone know why simple_form boolean fields return nil whether it???s checked or not?
[20:30:55] kidoz: has joined #RubyOnRails
[20:31:31] smathy: northfurr, !code please, because they work for me.
[20:31:31] helpa: northfurr: 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.
[20:33:05] dopie: dotenv anyone?
[20:33:21] dopie: Can i use dotenv for produciton?
[20:34:49] slash_nick: i won't stop you :)
[20:34:50] northfurr: smathy: https://gist.github.com/anonymous/94e10cf3e761ff751644
[20:34:51] joshkovach: has joined #RubyOnRails
[20:36:02] smathy: northfurr, and add your exam_params method from your ExamsController
[20:36:16] bruno-: has joined #RubyOnRails
[20:36:33] northfurr: ah man??? facepalm
[20:36:37] DEA7TH: has joined #RubyOnRails
[20:36:43] northfurr: added this column after i wrote the params method
[20:36:58] tubbo: dopie: sure why not
[20:38:04] Cervajz_: has joined #RubyOnRails
[20:38:19] riotjones: has joined #RubyOnRails
[20:38:20] smathy: northfurr, you're welcome.
[20:38:29] smathy: Such a stupid part of Rails.
[20:39:01] diegoviola: has joined #RubyOnRails
[20:39:29] mostlybadfly: has joined #RubyOnRails
[20:41:28] dopie: tubbo, have you used dotenv before?
[20:41:36] sunya7a: has joined #RubyOnRails
[20:41:46] tubbo: dopie: yes, i saw your issue and i think SECRET_KEY_BASE is supposed to be lowercase in your application.yml
[20:42:05] tubbo: i also use secrets for this kind of thing, not dotenv..
[20:42:11] tubbo: but i have used dotenv before
[20:42:16] dopie: used secrets?
[20:42:43] mary5030: has joined #RubyOnRails
[20:42:48] beauby: has joined #RubyOnRails
[20:43:28] tubbo: dopie: yeah, you know...secrets.yml? http://brandonhilkert.com/blog/using-rails-4-dot-1-secrets-for-configuration/
[20:43:38] dopie: tubbo, thank you
[20:43:51] Scripore: has joined #RubyOnRails
[20:44:35] tubbo: dotenv is more convenient for ensuring certain ENV vars are the right values without needing to rely on the shell env
[20:44:56] tubbo: but i think secrets are a better way of modeling this problem, especially from a developer's perspective..
[20:45:27] rakm: has joined #RubyOnRails
[20:47:42] htmldrum: has joined #RubyOnRails
[20:49:19] alaing: NameError (uninitialized constant ExpenseTypesController::ExpenseTypes):
[20:49:22] sankaber: has joined #RubyOnRails
[20:50:07] alaing: sorry ignore that
[20:50:12] alaing: it was a typo
[20:50:13] alaing: undefined method `join' for #<Class:0x007fc07b78b318>
[20:50:17] Guest26654: has left #RubyOnRails: ()
[20:50:38] alaing: index action @expense_types = ExpenseType.join(:expense_freq_type)
[20:50:40] sunya7a: has joined #RubyOnRails
[20:51:00] arup_r: it is joins
[20:52:11] smathy: All covered in association basics.
[20:52:21] alaing: yip sorry
[20:53:05] alaing: hmmm var instance @expense_types isn't mentioning anything about freq type
[20:53:32] alaing: I'm using byebug to try debug the instance variable
[20:55:01] smathy: "isn't mentioning" doesn't actually tell us anything.
[20:55:39] MartinElvar: has joined #RubyOnRails
[20:56:06] arup_r: alaing: has bucket of errors.. :D
[20:56:27] alaing: arup_r: yes thats about right :-D
[20:56:54] alaing: http://pastie.org/10477454
[20:57:39] tubbo: da fuq is that
[20:57:52] arup_r: Arel shit
[20:58:18] tubbo: no i mean, if you wanted to actually inspect what's in the @expense_types collection, why not just do @expense_types.first.freq_type
[20:58:45] smathy: I don't see any errors.
[20:59:03] alaing: SQLite3::SQLException: no such column: expense_types.expense_freq_type_id: SELECT "expense_types".* FROM "expense_types" INNER JOIN "expense_freq_types" ON "expense_freq_types"."id" = "expense_types"."expense_freq_type_id"
[20:59:29] smathy: alaing, !associations
[20:59:29] helpa: alaing: http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[20:59:39] alaing: just checking why
[20:59:51] smathy: alaing, because you don't know what you're doing.
[21:00:03] arup_r: makes sense
[21:01:38] jenrzzz: has joined #RubyOnRails
[21:01:52] honzahov1: has joined #RubyOnRails
[21:02:55] lukekhamilton: has joined #RubyOnRails
[21:03:18] arup_r: smathy: Was it to me? "...or also, if your input has a leading cap, then the output will be capitalized too...."
[21:03:25] arup_r: I might missed it..
[21:03:28] ritic: has joined #RubyOnRails
[21:03:44] bnwiscool: has joined #RubyOnRails
[21:04:00] safety_cut: has joined #RubyOnRails
[21:04:02] smathy: arup_r, if you were the one asking about `pluralize`
[21:04:14] smathy: arup_r, ie. if you do: pluralize( 2, "Person") then you'll get "People"
[21:04:21] smathy: *"2 People"
[21:04:36] arup_r: oh. yes. thanks I don;t need titlize then
[21:04:48] Giddeon: has joined #RubyOnRails
[21:05:11] arup_r: I closed everything.. except IRC. Tomorrow I will change my code to add this.
[21:05:13] ruurd_: has joined #RubyOnRails
[21:06:12] diegoviola: has joined #RubyOnRails
[21:06:15] arup_r: When 5 people will be asking simultaneously and 5 answering also .. Then IRC generally messed up.. and it happened with me
[21:06:31] arup_r: I thought it was for someone else.
[21:06:56] krisquigley: has joined #RubyOnRails
[21:07:01] sonofdirt: has joined #RubyOnRails
[21:07:10] smathy: Sorry, I must have forgotten to prefix.
[21:08:14] arup_r: .. its ok.. Thank god, I scrolled up to see... something
[21:09:21] rromanch_: has joined #RubyOnRails
[21:13:23] Giddeon: I inherited some Rails 4 code that has a "namespace :organization" call in the routes.rb file. There's also a model named Organization. The app breaks when we try to do Organization.new, so the previous developer did ::Organization.new. Whenver we call Organization.new in a controller, Rails throws a "NameError uninitized constant" error. Instead of just looking for "Organization",
[21:13:23] Giddeon: Rails looks for something like "Admin::Organization::EventsController::Organization" which doesn't exist (and shouldn't exist). I'd like to get rid of the need to use the ::Organization everywhere. Is there way to go accomplish this while still letting us have "organization" in the path? Our current paths use a nested namespace of admin and organization and create paths like
[21:13:23] Giddeon: "/admin/organization/events"
[21:14:04] Scripore: has joined #RubyOnRails
[21:14:20] mloy: has left #RubyOnRails: ("Leaving")
[21:14:27] mloy: has joined #RubyOnRails
[21:14:54] crdpink: has joined #RubyOnRails
[21:16:38] smathy: Giddeon, !gist your controller showing what you'd like to be doing with Organization, and paste the error you're getting (not "something like" the error, but the actual error)
[21:16:38] helpa: Giddeon: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:16:48] MaDErroR123: has joined #RubyOnRails
[21:17:37] baweaver: has joined #RubyOnRails
[21:20:57] cnk: has left #RubyOnRails: ()
[21:23:13] momomomomo: has joined #RubyOnRails
[21:25:32] maxdoubt: has joined #RubyOnRails
[21:25:37] Scripore: has joined #RubyOnRails
[21:25:45] maxdoubt: is there a way to created nested_attributes and save only the children, not the parent?
[21:26:23] sunya7a: has joined #RubyOnRails
[21:26:32] tubbo: maxdoubt: nope.
[21:26:34] sunya7a: has joined #RubyOnRails
[21:27:41] chipotle: has joined #RubyOnRails
[21:27:53] maxdoubt: tubbo: how about a ???rails way??? to build mutiple iterations of a form??? similar to fields_for, and then save those models?
[21:29:11] VeryBewitching: has joined #RubyOnRails
[21:29:32] Pumukel: has joined #RubyOnRails
[21:29:52] Giddeon: maxdoubt: Yes there is. I just did it yesterday. Just don't pass the params into the parent. Whatever controller you're working in is going to get a params hash with a sub hash containing the child elements. You can iterate through that info and standup your own child models. There's no need to go through the parent.
[21:30:14] Radar: GOOD MORNING
[21:31:23] maxdoubt: Giddeon: so something like??? params[:league][:invitations_attributes].each do |invitation| and then save each child individually?
[21:31:41] EXCHGR: has joined #RubyOnRails
[21:32:02] Giddeon: maxdout: Yep. That's perfectly ok.
[21:32:37] benlieb: has joined #RubyOnRails
[21:33:45] northfurr: has joined #RubyOnRails
[21:35:02] t3rm: has joined #RubyOnRails
[21:35:16] beauby: has joined #RubyOnRails
[21:35:21] roshanavand: has joined #RubyOnRails
[21:39:00] dopie: tubbo, I read the article and didn't understand with he is doing
[21:39:03] riotjones: has joined #RubyOnRails
[21:39:12] tubbo: dopie: !vague
[21:39:12] helpa: dopie: Your question has just been deemed vague; please consider rewording it. It may also help to give us any relevant code or errors so that we may better assist you.
[21:39:19] dopie: pretty vague
[21:39:28] tubbo: dopie: what about it do you not get?
[21:39:41] Giddeon: maxdoubt: I just peaked at my code. What I ended up doing was something a little different. @league.invitation_attributes = invitations_params. Then I call @league.save. This would let your still go through you parent model which is nice because it will rollback if there are problems with validations. That invitations_params method is a method I added on the controller which looks
[21:39:41] Giddeon: through the params and pulls out the params[:league][:invitations_attributes] part. It also processes it a little bit to add/remove keys or data. You may not need that. If your @league doesn't have any changed attributes it won't save anything out to the database so there's no harm in going through it to save your child models.
[21:39:47] dopie: Where is his solution!@?
[21:40:17] rickmasta: has joined #RubyOnRails
[21:40:53] maxdoubt: Giddeon: yeah, keeping the parent (despite not needing it) would be ideal for validation purposes??? and it feels more idiomatic??? could you share your params method?
[21:41:12] tubbo: dopie: i think it's under that subtitle called "The Solution"
[21:41:20] MaDErroR123: has joined #RubyOnRails
[21:41:32] dopie: tubbo, yep I didn't understand it
[21:42:02] tubbo: dopie: well, config/secrets.yml comes by default with rails
[21:42:13] tubbo: and it has secret_key_base pre-populated for all environments except production
[21:42:17] diegoviola: has joined #RubyOnRails
[21:42:20] tubbo: which it populates using ENV["SECRET_KEY_BASE"]
[21:43:29] chouhoul_: has joined #RubyOnRails
[21:43:32] baweaver: has joined #RubyOnRails
[21:43:43] hobodave: has joined #RubyOnRails
[21:43:43] Giddeon: maxdoubt: Line 1) p=params.require(:league).permit(:id, :invitation_attributes => [...child attributes you want to whitelist]). Line 2) p[:invitiation_attributes]
[21:43:57] tubbo: dopie: in that environment, you're expected to have $SECRET_KEY_BASE defined in the app's login shell environment (for its deploy user), for security purposes
[21:44:18] tubbo: this way whoever is doing your ops doesn't need to expose secret credentials to any dev who happens to join the team
[21:44:19] cornerma1: has joined #RubyOnRails
[21:44:42] maxdoubt: Giddeon: ah, i gotcha??? you???re just not letting any of the parent attributes through??? smart! thanks!!!
[21:45:30] dikaio: has joined #RubyOnRails
[21:45:40] weaksauce: has joined #RubyOnRails
[21:45:53] tubbo: dopie: so like...your problem here is because you did something, at some point, to not use secrets.yml for the secret_key_base, OR you just never set $SECRET_KEY_BASE in production.
[21:46:21] dopie: it seems to me that I never set $SECRET_KEY_BASE in production
[21:46:24] tubbo: dopie: because if you `rails new a_new_project_app`, config/secrets.yml comes pre-populated with generated secret keys
[21:46:26] baweaver: has joined #RubyOnRails
[21:46:31] tubbo: dopie: you might wanna do that
[21:46:43] yaymukund: has joined #RubyOnRails
[21:46:44] tubbo: rails uses that for CSRF token generation and a few other things
[21:47:26] ruurd: has joined #RubyOnRails
[21:47:33] Giddeon: maxdoubt: I did the params hash processing in another method. What I did was specific to my app. I needed to add some default params that weren't being set via the form, but I wanted to make sure they went to the DB. I also had to convert some hash values to what the model expected from what was presented in the form. You can do all that before you make the call to "@league.invitia
[21:47:33] Giddeon: tion_attributes = invitation_params" if needed. Happy to help. I spent a while trying to crack this one the other day. :)
[21:50:10] lporras_: has joined #RubyOnRails
[21:50:15] jglover: has joined #RubyOnRails
[21:50:39] Giddeon: maxdoubt: Oh the one other trick I had to solve was what happened if the validations failed. You'll need some way to re-create that @invitations variable in your :create or :update action. I ended up doing something like this @league.invitations.select(&:changed). @league might have other invitations that were created before this particular :create action. You don't want them to appear
[21:50:39] Giddeon: when you redisplay the form if the validations fail.
[21:52:04] maxdoubt: Giddeon: very helpful!!! hopefully I can tinker a bit and get this working now
[21:52:59] Or1on: has joined #RubyOnRails
[21:53:14] allcentury: has joined #RubyOnRails
[21:53:22] mary5030: has joined #RubyOnRails
[21:54:02] lea: has joined #RubyOnRails
[21:54:02] momomomomo_: has joined #RubyOnRails
[21:54:58] rhizome: bout to rip out devise
[21:55:04] Pharaoh2: has joined #RubyOnRails
[21:55:15] Motoservo: has joined #RubyOnRails
[21:55:30] ellisTAA: has joined #RubyOnRails
[21:56:04] krisquigley: has joined #RubyOnRails
[21:58:48] richb___: has joined #RubyOnRails
[21:59:26] smathy: Sensible man.
[21:59:29] The_Ball: rvanlieshout, FYI, I found "Brimir" which is a very simple ticketing system running on ROR
[22:01:16] alxndr: has joined #RubyOnRails
[22:01:17] Kerber0s: has joined #RubyOnRails
[22:01:23] hellschreiber: has joined #RubyOnRails
[22:01:50] danlucraft: has joined #RubyOnRails
[22:02:04] framlinqp: has joined #RubyOnRails
[22:02:30] Coldblackice: has joined #RubyOnRails
[22:04:46] BBHoss: has joined #RubyOnRails
[22:04:52] jenrzzz: has joined #RubyOnRails
[22:05:37] dideler76: has left #RubyOnRails: ()
[22:05:37] wildlander: has joined #RubyOnRails
[22:05:45] user1138: has joined #RubyOnRails
[22:06:55] beauby: has joined #RubyOnRails
[22:10:02] greengriminal: has joined #RubyOnRails
[22:10:19] lipoqil: has joined #RubyOnRails
[22:11:27] ELCALOR: has joined #RubyOnRails
[22:11:33] Pharaoh2: has joined #RubyOnRails
[22:12:47] barhum2013: has joined #RubyOnRails
[22:13:21] barhum2013: I am trying to do a live preview of html code. Anyone recommend a good solution? Thanks
[22:13:29] simplyianm: has joined #RubyOnRails
[22:14:17] jenrzzz_: has joined #RubyOnRails
[22:15:52] darrencauthon: has joined #RubyOnRails
[22:16:15] beauby: has joined #RubyOnRails
[22:16:46] JusticeFries: has joined #RubyOnRails
[22:18:11] pydave6367: has joined #RubyOnRails
[22:21:35] skmp: has joined #RubyOnRails
[22:21:46] kalusn: has joined #RubyOnRails
[22:22:17] dopie: Is there any reason why capistrano will not copy files i created in config/initializers??
[22:22:45] a1fa: i am looking for a gem similar to will_paginate, but that can toggle view fields, and/or remove/add columns into view
[22:23:41] s2013: has joined #RubyOnRails
[22:24:35] ishikawa91: has joined #RubyOnRails
[22:24:56] momomomomo_: has joined #RubyOnRails
[22:25:29] MiracleBlue: has joined #RubyOnRails
[22:26:48] annlewis: has joined #RubyOnRails
[22:27:32] dotty: has joined #RubyOnRails
[22:28:04] sankaber: has joined #RubyOnRails
[22:28:49] ewilliam: has joined #RubyOnRails
[22:29:31] sankaber: has joined #RubyOnRails
[22:30:16] nyandoge: has joined #RubyOnRails
[22:30:29] Radar: dopie: because they're not committed ot version control
[22:30:45] dopie: if it appears in github
[22:30:47] pfg: has joined #RubyOnRails
[22:31:01] FailBit: smoke node everyday
[22:31:16] dopie: Radar, this honestly would be a good one for you too look at...
[22:31:32] Glyphik: has joined #RubyOnRails
[22:31:33] dopie: I'm seriously perplexed as to why this is happening
[22:31:36] lokson: has joined #RubyOnRails
[22:31:37] rushed: a1fa: that's not really pagination anymore :)
[22:32:23] a1fa: rushed: i am trying to have some dynamic views.. like checkbox to exclude sold items, etc
[22:32:39] rushed: a1fa: and does that sound like a description of pagination?
[22:33:38] a1fa: no, but something similar would be cool
[22:33:40] smathy: barhum2013, not sure what you're asking, but if my guess is correct then render_to_string in the controller, escape_once in the view?
[22:34:02] rushed: a1fa: the only similarity at that point would be they're both gems~
[22:36:07] manfrin: has joined #RubyOnRails
[22:36:15] barhum2013: smathy: I am trying to enter an html email template and preview it automatically on the right. Side by side.
[22:36:30] smathy: dopie, !gist your deploy.rb and copy-paste of your `cap deploy` output.
[22:36:30] helpa: dopie: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:37:04] smathy: barhum2013, oh, so you mean like a WYSYWIG editor for HTML?
[22:38:20] smathy: barhum2013, ok, so that's nothing to do with Rails, just google WYSIWYG editors and evaluate them.
[22:38:40] barhum2013: smathy: thanks for the guidance!
[22:39:04] smathy: barhum2013, no problem, sometimes the hardest thing is knowing what to search for.
[22:39:57] riotjones: has joined #RubyOnRails
[22:41:03] EminenceHC: has joined #RubyOnRails
[22:41:28] northfurr: has joined #RubyOnRails
[22:42:16] HenryBahus: has joined #RubyOnRails
[22:44:52] Anakat: has joined #RubyOnRails
[22:46:12] quazimodo: has joined #RubyOnRails
[22:47:44] johnflux: has joined #RubyOnRails
[22:54:23] tweeeaks: has joined #RubyOnRails
[22:56:48] wethu: has joined #RubyOnRails
[22:57:11] a1fa: rushed: i think "Ransack" is what i am looking for
[22:57:34] zeknox: whats the best way to override a models delete functionality to a destroy
[22:57:53] EminenceHC: has joined #RubyOnRails
[22:58:35] n1lo: has joined #RubyOnRails
[22:58:50] jtperreault: has joined #RubyOnRails
[22:59:00] rhizome: once again in english please
[22:59:36] superlou: has joined #RubyOnRails
[23:00:14] Anakat: has joined #RubyOnRails
[23:02:30] rakm: has joined #RubyOnRails
[23:02:36] boom1992: has joined #RubyOnRails
[23:02:41] chills42: has joined #RubyOnRails
[23:03:27] stannard: has joined #RubyOnRails
[23:04:40] baweaver: has joined #RubyOnRails
[23:06:09] doctorly: has joined #RubyOnRails
[23:06:47] workmad3: has joined #RubyOnRails
[23:09:54] bruno-: has joined #RubyOnRails
[23:10:32] hephaestus_rg: has joined #RubyOnRails
[23:13:39] unreal: has joined #RubyOnRails
[23:13:43] Dopagod: has joined #RubyOnRails
[23:13:55] Anakat: has joined #RubyOnRails
[23:15:09] chipotle: has joined #RubyOnRails
[23:15:25] rhizome: nice 44-file commit to untangle
[23:15:41] Radar: zeknox: What do you want to do exactly?
[23:19:33] bonhoeffer: has joined #RubyOnRails
[23:21:06] tejasmanohar: has joined #RubyOnRails
[23:23:08] Kerber0s: has joined #RubyOnRails
[23:24:43] Cervajz: has joined #RubyOnRails
[23:29:00] ellisTAA: what???s the offtopic channel?
[23:29:03] ellisTAA: #off-topic?
[23:30:28] dopie: has joined #RubyOnRails
[23:30:50] Limix: has joined #RubyOnRails
[23:31:08] havenwood: EllisTAA: You mean #ruby-offtopic?
[23:31:16] ellisTAA: thanks havenwood
[23:34:02] Pharaoh2: has joined #RubyOnRails
[23:35:28] pabvid: has joined #RubyOnRails
[23:35:30] jameswork: has joined #RubyOnRails
[23:37:06] hephaestus_rg: has joined #RubyOnRails
[23:37:58] bonhoeffer: has joined #RubyOnRails
[23:40:42] riotjones: has joined #RubyOnRails
[23:41:40] riotjones: has joined #RubyOnRails
[23:41:57] shmilan: has joined #RubyOnRails
[23:42:52] Pharaoh2: has joined #RubyOnRails
[23:45:12] rubyonrailed: has joined #RubyOnRails
[23:45:34] blackhuey: has joined #RubyOnRails
[23:47:02] Icey: has joined #RubyOnRails
[23:48:31] zeknox: Radar: I found out that what I really want is a on_delete: cascade as part of my migration, i guess this is new to 4.2 and that is why I'm getting foreign key errors
[23:49:06] zeknox: Radar: is there a way to pass this as an argument when creating the migrations from the CLI
[23:50:08] Radar: on_delete: cascade is a model concern
[23:51:05] SteenJobs: has joined #RubyOnRails
[23:51:19] zeknox: Radar: based on this they make it sound like a migration option part of 4.2: https://robots.thoughtbot.com/referential-integrity-with-foreign-keys#cascading-deletes
[23:52:04] justinmburrous: has joined #RubyOnRails
[23:52:06] baweaver: has joined #RubyOnRails
[23:52:15] Radar: Oh, there.
[23:52:18] madebymarkca: has joined #RubyOnRails
[23:52:21] Radar: Sorry, I was confusing it with dependent option in model
[23:52:40] snarkfest: has joined #RubyOnRails
[23:53:40] zeknox: Radar: do I have to do this as a seperate migration or can I just append this to my existing t.references: model, index: true, foreign_key: true, on_delete: :cascade ?
[23:53:45] EminenceHC: has joined #RubyOnRails
[23:54:06] Radar: zeknox: If the migration has been run already then you'll need to create a new migration for it.
[23:54:09] Radar: Or rollback the existing migration
[23:54:24] zeknox: Radar: right, i get that, but wondering if what i have in mind is proper syntax
[23:54:31] helpa: Why don't you try it and find out for yourself?
[23:55:12] rubyonrailed: has joined #RubyOnRails
[23:56:14] zeknox: Radar: well the migration ran, now lets see if it works!
[23:56:44] MartinElvar: has joined #RubyOnRails
[23:57:13] one_zero: has joined #RubyOnRails
[23:57:41] mary5030: has joined #RubyOnRails
[23:58:33] zeknox: Radar: seemed to run, but still throwing the `violates foreign key constraint`
[23:59:28] smathy: zeknox, unknown options will just be ignored. Also, FWIW, if it was going to work it'd be more likely for the syntax to be: ...., foreign_key: { on_delete: :cascade }
[23:59:37] smathy: zeknox, but I don't think it will work.