« Back to channel list

#RubyOnRails - 19 March 2016

« Back 1 day Forward 1 day »
[00:02:02] VeryBewitching: |PiP|: I think it's the header field names that are CI though.
[00:02:14] ur5us: has joined #RubyOnRails
[00:03:39] Devalo: has joined #RubyOnRails
[00:05:24] bricker: has joined #RubyOnRails
[00:05:58] sysodaff: has joined #RubyOnRails
[00:07:03] bscott_: has joined #RubyOnRails
[00:07:57] Guest34101: has joined #RubyOnRails
[00:08:07] Radar: siaw: You probably want to do allow(controller).to receive(:current_user).and_return(user)
[00:10:59] Radar: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[00:11:01] Radar: has joined #RubyOnRails
[00:12:28] Radar: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[00:12:29] Radar: has joined #RubyOnRails
[00:14:26] ql6wlld: has joined #RubyOnRails
[00:17:19] martin290: has joined #RubyOnRails
[00:17:32] martin290: Hey everyone
[00:18:11] KensoDev: has joined #RubyOnRails
[00:18:30] Radar: hi martin290
[00:18:35] jstransky: Does anyone know if there’s a font-awesome gem that will allow me to use it’s mixins?
[00:18:47] Radar: jstransky: did you try https://rubygems.org/gems/font-awesome-rails?
[00:19:17] jstransky: Radar: using that now. It’s just a port of the css, not the original source
[00:19:38] Cohedrin: has joined #RubyOnRails
[00:19:39] jstransky: I don’t like having to use extra elements just to render an icon
[00:19:39] martin290: Radar, would you think going from php to ror would be an easy move? I'm kind of sick of php
[00:20:06] Radar: martin290: I did that about 10 years ago.
[00:20:15] Radar: I found it easy enough
[00:20:37] martin290: Yeah? Would you ever go back?
[00:20:42] Radar: jstransky: you mean the <i> elements?
[00:20:53] Radar: martin290: I can't think of a better way to put it than "HELL NO"
[00:21:05] jstransky: I prefer to mix them into my own classes
[00:21:16] Radar: martin290: PHP's syntax and general disregard for sensible programming practices is what makes it abhorrent to me.
[00:21:44] jstransky: PHP by definition wasn’t supposed to Radar
[00:21:44] rodfersou: has joined #RubyOnRails
[00:21:56] martin290: Radar: ok. I'm just trying to make a simple crud website
[00:22:07] rattatmatt: has joined #RubyOnRails
[00:22:08] Radar: jstransky: Ah. You might be able to just do @extend .fa-check in that instance then?
[00:22:37] Radar: martin290: !gettingstarted covers all you need to know about CRUD :)
[00:22:37] helpa: martin290: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[00:22:56] jstransky: Radar: hmm, maybe. not sure if that’s going to result in extra css
[00:23:23] martin290: Awesome, thanks!!!
[00:23:39] Radar: martin290: And if you want something more indepth than that, then I wrote a book too:
[00:23:40] Radar: martin290: !r4ia
[00:23:40] helpa: martin290: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[00:23:43] rattatmatt: so, lets say I want to perform a post request from a controller to another server, using parameters coming from the user... what would be my best bet for that?
[00:23:43] martin290: Is ruby fully oop?
[00:23:55] Radar: martin290: yes
[00:24:14] siaW: Radar: where does the allow(controller).to receive(:current_user).and_return(user) go? in my controller spec?
[00:24:17] Radar: martin290: everything is an object and you call methods on objects to get where you want to get to.
[00:24:24] Radar: siaw: Where you've currently got "sign_in"
[00:24:29] martin290: Radar: You wrote a book?! You must be a super ruby ninja
[00:24:33] Radar: rattatmatt: HTTParty would do that.
[00:24:47] ayoros: has joined #RubyOnRails
[00:24:52] Radar: martin290: I have just been doing it for quite a long time: http://ryanbigg.com/about-me/
[00:25:19] rattatmatt: Radar: thanks!
[00:25:20] Radar: And I've answered a lot of ruby / rails questions to cement that knowledge: http://stackoverflow.com/users/15245/ryan-bigg
[00:25:43] Radar: rattatmatt: If you're going to be posting files to that other endpoint, I would look at Excon though. HTTParty doesn't handle file uploads well.
[00:25:49] Radar: rattatmatt: if it's just params, HTTParty will do just fine
[00:26:07] Radar: rattatmatt: What's the other server if you don't mind me asking?
[00:26:07] htmldrum: has joined #RubyOnRails
[00:26:27] rattatmatt: Radar: no files, just params. there aren't any potential security issues with accepting params from the user and then just sticking them in, are there?
[00:26:38] siaW: Radar: does this make sense?https://gist.github.com/siaw23/e1ff201df46318b8258a#file-accounts_controller-rb-L10
[00:26:45] Radar: rattatmatt: not if you're just passing them along
[00:26:46] siaW: i put it in a before block
[00:26:54] mwlang: has joined #RubyOnRails
[00:26:59] Radar: siaw: Yup, that seems fine to me.
[00:27:24] jstransky: Ok looks like font-awesome-sass will do what I want. How do I remove the old gem first?
[00:27:26] siaW: it’s not working
[00:27:30] Radar: siaw: !didntwork
[00:27:30] helpa: siaw: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[00:27:36] Radar: jstransky: Remove font-awesome-rails from your Gemfile
[00:27:39] Radar: jstransky: there is no stpe 2
[00:27:57] rattatmatt: Radar: stripe is the target server
[00:27:59] jstransky: Radar: Thanks, I thought so but wasn’t sure if there was a bundle uninstall or anything
[00:28:08] martin290: Radar: wow man, that's awesome. What ide would you recommend for ruby?
[00:28:25] Radar: rattatmatt: Oh, right. You could use the excellent Stripe gem for that instead: https://rubygems.org/gems/stripe
[00:29:22] systemsgotyou: is rbenv popular?
[00:29:31] systemsgotyou: (do most people use it)
[00:29:37] Radar: systemsgotyou: Define "most" :P
[00:29:39] jstransky: systemsgotyou: it’s just diffrennt
[00:29:40] rattatmatt: Radar: oh, I'm already using the stripe gem, this is actually for custom oauth implementation with stripe connect
[00:29:44] Radar: systemsgotyou: It's relatively popular, yes.
[00:29:45] martin290: Radar: I'm on Windows if that helps
[00:29:50] Radar: rattatmatt: aha :)
[00:30:00] Radar: martin290: I use Sublime Text 3 and I think it works on Windows too.
[00:30:20] siaW: Radar: if i use `allow(controller).to receive(:current_user).and_return(user)` the test doesn’t sign_in at all. i’m guessing it’s because it doesn’t know who `current_user` is
[00:30:22] rattatmatt: Radar: wouldn't be doing it if I didn't have to, but none of the oauth gems will do what I need them to do so I'm just going to do it myself
[00:30:29] martin290: Radar: yup it does. Cool, thanks for your help!
[00:30:36] Radar: siaw: So what happens then?
[00:30:50] siaW: Radar: the test redirects it to the login page
[00:31:02] Radar: rattatmatt: Did you try omniauth-stripe-connect? https://github.com/isaacsanders/omniauth-stripe-connect
[00:31:12] Radar: siaw: show me the logs from the logs/test.log please
[00:31:37] dalbuschat: has joined #RubyOnRails
[00:32:19] rattatmatt: Radar: yup, I can't remember which problem that ran up against but I think it might have had something to do with the fact that we're running as an api with token auth. can't remember though, I've been ripping my hair out for days trying various different gems/solutions
[00:32:37] siaW: Radar: https://gist.github.com/siaw23/677c38e271b02bdca3e1
[00:33:01] Radar: siaw: What is this set_account filter? Filter chain halted as :set_account rendered or redirected
[00:33:30] Radar: siaw: And can you show me AccountsController please?
[00:33:43] uglybandersnatch: has joined #RubyOnRails
[00:33:59] rattatmatt: Radar: if I had the time to waste on it, I could probably make it work, but we need this within the next week so I gave up in favor of doing it myself
[00:34:08] siaW: Radar: https://gist.github.com/siaw23/677c38e271b02bdca3e1#file-accounts_controller-rb
[00:34:27] Radar: siaw: thanks
[00:34:36] siaW: i should be thanking you
[00:34:38] snowy: has joined #RubyOnRails
[00:35:43] Radar: siaw: Give me a few minutes to try to reproduce this here.
[00:36:09] siaW: i’m trying to figure it out on my own here too
[00:36:51] Radar: siaw: Rails 4.2.5 or around there? Not Rails 5?
[00:36:53] FooMunki: has joined #RubyOnRails
[00:38:03] Radar: Ok, that's fine too.
[00:38:41] Radar: siaw: User model + user factory too please
[00:39:59] siaW: Radar: https://gist.github.com/siaw23/677c38e271b02bdca3e1
[00:40:16] Radar: Thank you.
[00:40:23] siaW: you’re welcome :D
[00:40:25] Radar: User model?
[00:40:53] neanderslob_: has joined #RubyOnRails
[00:43:37] siaW: https://gist.github.com/siaw23/677c38e271b02bdca3e1#file-user-rb
[00:43:56] stannard: has joined #RubyOnRails
[00:44:43] Radar: I can't reproduce in a new app.
[00:45:32] siaW: thanks anyway :)
[00:45:38] siaW: i’ll spend 2 more days on this
[00:46:06] jottr: has joined #RubyOnRails
[00:50:41] stannard: has joined #RubyOnRails
[00:56:51] AntiSpamMeta: has joined #RubyOnRails
[00:57:01] kgutteridge: has joined #RubyOnRails
[00:57:48] _Tariq: has joined #RubyOnRails
[01:02:08] jstransky: has joined #RubyOnRails
[01:09:08] AntiSpamMeta: has joined #RubyOnRails
[01:14:41] epochwolf: has joined #RubyOnRails
[01:15:38] Ikri: has joined #RubyOnRails
[01:16:38] DarkBushido: has joined #RubyOnRails
[01:16:42] DarkBushido: has joined #RubyOnRails
[01:17:49] _Tariq: has joined #RubyOnRails
[01:18:19] shamanime_: has left #RubyOnRails: ()
[01:19:23] arBmind: has joined #RubyOnRails
[01:22:10] Ikri: has joined #RubyOnRails
[01:23:10] Didrik: has joined #RubyOnRails
[01:27:03] chagel: has joined #RubyOnRails
[01:27:33] ensyde_: has joined #RubyOnRails
[01:27:50] bronson: has joined #RubyOnRails
[01:32:01] griffindy: has joined #RubyOnRails
[01:38:58] SeanLazer: has joined #RubyOnRails
[01:40:24] pawnbox: has joined #RubyOnRails
[01:45:33] DarkBushido: has joined #RubyOnRails
[01:45:33] DarkBushido: has joined #RubyOnRails
[01:50:23] stannard: has joined #RubyOnRails
[02:00:29] halfamind: has joined #RubyOnRails
[02:03:11] htmldrum: has joined #RubyOnRails
[02:04:17] uglybandersnatch: has joined #RubyOnRails
[02:04:59] DmitryBochkarev: has joined #RubyOnRails
[02:06:00] pawnbox: has joined #RubyOnRails
[02:06:03] Devalo: has joined #RubyOnRails
[02:06:14] SteenJobs: has joined #RubyOnRails
[02:10:40] Guest34101: has joined #RubyOnRails
[02:14:48] matthias_: has joined #RubyOnRails
[02:16:03] i: has joined #RubyOnRails
[02:16:30] k1t: has joined #RubyOnRails
[02:16:38] dopie: has joined #RubyOnRails
[02:18:50] gbgdev: has joined #RubyOnRails
[02:19:04] k1t_: has joined #RubyOnRails
[02:23:01] mrgreenfur: has joined #RubyOnRails
[02:34:24] rogue_koder: has joined #RubyOnRails
[02:38:41] jottr: Why does c = Crowdbar.new c.fetch_stats c.save! not commit the fields to the db? https://gist.github.com/jottr/9206480467b87cdf75d5
[02:42:40] sp1rs: has joined #RubyOnRails
[02:42:49] jottr: c.persisted? yields true.
[02:45:44] htmldrum: has joined #RubyOnRails
[02:45:54] sp1rs: has joined #RubyOnRails
[02:46:38] tomatoes: has joined #RubyOnRails
[02:46:42] _Tariq: has joined #RubyOnRails
[02:50:11] bronson: has joined #RubyOnRails
[02:51:09] jottr: But, the attributes are not persisted: https://gist.github.com/jottr/9206480467b87cdf75d5#file-rails_console-rb
[02:55:44] yfeldblum: has joined #RubyOnRails
[02:56:59] SteenJobs: jottr: not really sure without being able to play with the code a bit more, but have you tried setting the properties explicitly and seeing if it changes anything? looking at the SQL being executed, its only inserting `created_at`, `updated_at’ values
[02:57:45] jottr: SteenJobs: yes. I've tried that already, but it did not change anything.
[02:58:22] SteenJobs: jottr: did you try changing your model method to something like self.referal_count= instead of @referal_count=
[02:58:43] jottr: SteenJobs: let me try
[02:59:27] jottr: SteenJobs: Problem remains
[02:59:34] DmitryBochkarev: has joined #RubyOnRails
[03:00:44] SteenJobs: aright, do me a favor and in console type c = Crowdbar.create!(total_commission: <some value>, referal_count: <some_value>, … seven_day_referal_count: <some value>) and let me know what happens
[03:01:39] halfamind: has joined #RubyOnRails
[03:02:43] duncannz: has joined #RubyOnRails
[03:03:14] sneakerhax: has joined #RubyOnRails
[03:03:24] jottr: SteenJobs: No change: https://gist.github.com/jottr/dc84de9fc10da64dbd5e
[03:04:31] SteenJobs: don’t have to do c.save after a create, but gimme a sec
[03:04:44] jottr: Yep. just saw that in the doc for create
[03:08:11] SteenJobs: jottr: do me a favor a gist your db/schema.rb
[03:08:58] jenrzzz: has joined #RubyOnRails
[03:09:13] jottr: SteenJobs: here's the schema.rb https://gist.github.com/jottr/af10de7deb5673b076b0
[03:10:12] cabinB: has joined #RubyOnRails
[03:13:32] Spami: has joined #RubyOnRails
[03:13:48] SteenJobs: jottr: do you have any validations that could be getting in the way?
[03:14:25] SteenJobs: get rid of attr_accessor and lemme know what happens
[03:14:31] SteenJobs: in your Crowdbar model
[03:14:38] jottr: SteenJobs: tried already. Did not help
[03:15:28] SteenJobs: humor me and get rid of attr_accessor and then use the .create!() method as you did before
[03:15:32] SteenJobs: and show me the output
[03:15:33] jottr: not true.
[03:15:37] jottr: You were right
[03:15:58] jottr: I must've not tested it after commenting the attr_accessor out
[03:16:13] jottr: Could you explain why the attr_accessor causes problems?
[03:17:09] bga57: has joined #RubyOnRails
[03:19:08] SteenJobs: ActiveRecord creates its own getter and setter methods, and i believe attr_accessor overrides them and takes precedence
[03:19:25] SteenJobs: generally attr_accessor is used for virtual attributes that aren’t being persisted to the db
[03:26:04] DmitryBochkarev: has joined #RubyOnRails
[03:26:28] johnflux: has joined #RubyOnRails
[03:28:29] _Tariq: has joined #RubyOnRails
[03:34:23] kies: has joined #RubyOnRails
[03:36:48] chagel: has joined #RubyOnRails
[03:45:04] i: has joined #RubyOnRails
[03:45:31] dopie: has joined #RubyOnRails
[03:45:31] djbkd: has joined #RubyOnRails
[03:52:14] DoctorMonocular: has joined #RubyOnRails
[03:55:38] bricker: has joined #RubyOnRails
[04:00:52] quazimodo: has joined #RubyOnRails
[04:02:17] halfamind: has joined #RubyOnRails
[04:03:18] ziggy: has joined #RubyOnRails
[04:07:35] Devalo: has joined #RubyOnRails
[04:08:22] stardiviner: has joined #RubyOnRails
[04:15:20] braincrash: has joined #RubyOnRails
[04:15:36] boontdustie: has joined #RubyOnRails
[04:16:34] _Tariq: has joined #RubyOnRails
[04:22:10] johnflux: has joined #RubyOnRails
[04:22:11] johnflux: has joined #RubyOnRails
[04:25:20] ur5us: has joined #RubyOnRails
[04:27:10] beauby: has joined #RubyOnRails
[04:27:48] treaki_: has joined #RubyOnRails
[04:32:13] njero: has joined #RubyOnRails
[04:34:20] clorisu: has joined #RubyOnRails
[04:34:26] clorisu: are ruby classes the same as html classes?
[04:40:50] baweaver: has joined #RubyOnRails
[04:45:27] tycoon177: has joined #RubyOnRails
[04:45:40] pawnbox: has joined #RubyOnRails
[04:50:37] awasum: has joined #RubyOnRails
[04:50:49] bronson: has joined #RubyOnRails
[05:02:54] halfamind: has joined #RubyOnRails
[05:07:17] jenrzzz: has joined #RubyOnRails
[05:09:53] pyemkey: has joined #RubyOnRails
[05:14:38] hamster88: has joined #RubyOnRails
[05:14:46] hamster88: hello everyone :)
[05:15:12] pipework: You don't want to say hi to epochwolf, he may bite or rough up the legs of your armchair.
[05:16:10] hamster88: I have an article and a category model. which has many to many association with each other.. How can i view the article from just one Id?
[05:16:35] hamster88: one category*
[05:17:34] hamster88: let say I have a category named featured and I want to fetch all the articles with that id on home page..which is the action for the welcome controller
[05:18:04] Ropeney: hamster88, gist your models association and schema of them
[05:18:18] hamster88: ropeney, sure
[05:21:01] hamster88: here is the gist > https://gist.github.com/thedesignable/bac7068ec2ec643caff3
[05:22:58] Ropeney: the featured_instance.articles doesnt work?
[05:25:30] Meow-J: has joined #RubyOnRails
[05:26:44] hamster88: well the thing is i can't get my brain around the logic
[05:26:57] hamster88: I want only one article from featured category to include on home page
[05:27:24] Ropeney: the featured_instance.articles.first ?
[05:27:29] chouhoul_: has joined #RubyOnRails
[05:27:35] hamster88: featured_instance :S
[05:27:59] Ropeney: you didn't post your schema, so i couldn't tell you how to get the correct instance
[05:28:05] Ropeney: but an instance of the featured category
[05:28:17] Ropeney: so category.articles.first
[05:29:06] hamster88: ok i have updated the gist
[05:29:13] hamster88: please have a look
[05:29:31] Ropeney: Category.find_by(title: 'featured').articles.first
[05:30:32] clorisu: whats the difference between a template and a view?
[05:31:43] hamster88: y> Category.find_by(name: 'featured').articles.first
[05:31:50] hamster88: shouldn't it be that way?
[05:32:23] hamster88: so I should just add it to my views that's it ?
[05:32:37] Ropeney: thats how you get it
[05:32:51] Ropeney: i dont suggest that code in a view though
[05:33:15] Ropeney: I have very little information, just trying to answer what your trying to do
[05:33:40] hamster88: so all i need is to def @category in my welcome controller and then call it up ?
[05:33:50] hamster88: like @category.first.articles
[05:33:54] hamster88: something like that eh?
[05:34:32] merida_: has joined #RubyOnRails
[05:34:33] merida: has joined #RubyOnRails
[05:34:55] Ropeney: @categories_first_article = Category.find_by(name: params[:category]).articles.first
[05:35:31] hamster88: yep just added it to my controller
[05:35:38] Ropeney: i'd even consider moving that to the model
[05:35:53] hamster88: hmm that sounds good
[05:36:52] hamster88: so in views I shall do like <@categoriesone.each do |category| %>
[05:36:53] Ropeney: i wonder if `has_one :first_article, -> { articles.first }`
[05:41:43] hamster88: ropeney, i tried > @categoryone = Category.find_by(name: params[:category]).articles.first
[05:41:51] hamster88: getting undefined method `articles' for nil:NilClass
[05:42:32] pyemkey: has joined #RubyOnRails
[05:43:35] Ropeney: did u pass a param with category=featured in url?
[05:43:55] hamster88: there is no category by that name as of now
[05:44:14] baweaver: has joined #RubyOnRails
[05:44:33] Ropeney: then thats why its nil
[05:44:50] hamster88: ok added the category
[05:44:59] Ropeney: you know how to get the result you wanted, now you get to implement it :D
[05:45:25] hamster88: still getting nil class error
[05:45:51] bronson: has joined #RubyOnRails
[05:46:26] hamster88: ok let me gist welcome controller hang on
[05:47:19] hamster88: https://gist.github.com/thedesignable/bac7068ec2ec643caff3
[05:47:21] hamster88: there we go
[05:47:52] Ropeney: and whats the url u are using to get to there
[05:47:54] pawnbox: has joined #RubyOnRails
[05:48:11] hamster88: the url is the index page of the app
[05:48:20] Ropeney: and it is?
[05:48:28] hamster88: http://startup-startup-app.c9users.io/
[05:48:37] Ropeney: so you didnt include ?category=featured
[05:48:38] yfeldblum: has joined #RubyOnRails
[05:49:00] hamster88: the thing is there are other articles on that page too
[05:49:14] hamster88: and an ads section
[05:49:18] arup_r: has joined #RubyOnRails
[05:49:21] smoitra: has joined #RubyOnRails
[05:49:26] Ropeney: okay, I dont know what your trying to do then. But you have a solution to the question you asked so you should be able to now make it work for the rest
[05:50:22] hamster88: so all i have to do is pass a params?
[05:51:04] hamster88: I have been working from past 3 hours to figure it out
[05:51:08] Ropeney: if you have a collection of categories
[05:51:08] hamster88: I will look at it
[05:51:46] Ropeney: your ::easiest:: answer here is, @categories.each do |category| category.articles.first end
[05:52:04] Ropeney: hello arup_r
[05:52:24] chagel: has joined #RubyOnRails
[05:52:25] arup_r: ropeney: o/
[05:57:26] pawnbox: has joined #RubyOnRails
[05:57:36] Ropeney: all sorted hamster88?
[05:57:55] hamster88: I am checking by creating a new article
[05:58:41] bricker: has joined #RubyOnRails
[06:00:52] pipework: @categories.includes(:articles).map(&:first_article) # Define #first_article as a scope like `scope :first_article, order('id asc').limit(1)` or so.
[06:01:34] Ropeney: pipework, agreed
[06:02:05] Ropeney: thats if @categories isn't used for anything else
[06:02:13] pipework: ropeney: Why would it matter?
[06:02:30] Ropeney: i would put the includes in the controller
[06:02:33] Ropeney: and the map in the view
[06:02:40] pipework: I wouldn't put the map in the view.
[06:02:46] Ropeney: fair enough
[06:03:06] Ropeney: if he wants the title of each category
[06:03:08] pipework: The includes can go anywhere that you want to handle making sure the articles are joined in.
[06:03:12] Ropeney: he has another collection of categories?
[06:03:23] pipework: Why can't he just @categories.map(&:title)?
[06:03:33] halfamind: has joined #RubyOnRails
[06:03:43] Ropeney: maybe i don't know what your aim is either :)
[06:03:52] pipework: ropeney: Query efficiency.
[06:04:04] Ropeney: without know everything he is trying to accomplish
[06:04:06] pipework: Only load the category and the single article.
[06:04:12] DoctorMonocular: has joined #RubyOnRails
[06:04:16] pipework: ropeney: I know exactly as much as you. :)
[06:04:25] Ropeney: and yet we have difference of opinion here
[06:04:28] pipework: We can endlessly debate about what each other don't know.
[06:04:33] pipework: ropeney: You may have.
[06:05:19] hamster88: it seems like really not working
[06:05:33] pipework: hamster88: that sucks. I had a car that didn't work once.
[06:05:55] hamster88: pipework, lol
[06:06:37] hamster88: I am trying to display just the article from one category in one of the section on homepage
[06:07:02] hamster88: thats what i am trying.. rest is working fine
[06:07:04] Ropeney: hamster88, whats "the article"
[06:07:24] hamster88: the article that belongs to featured category
[06:07:28] pipework: hamster88: So you want to select an article for each category, besides belonging to the category, are there any other constraints?
[06:07:30] Ropeney: but many belong to it
[06:07:32] Ropeney: so which one?
[06:07:46] hamster88: lets say all the articles
[06:07:56] pipework: hamster88: So you don't want one article per category, you want them all?
[06:07:57] Ropeney: so not... an article...
[06:08:09] pipework: Perhaps choose and stick to one at least for the duration of us helping you. :)
[06:08:14] hamster88: not an article.. all the article from that category
[06:08:25] Ropeney: an article, and all the articles are different, very different
[06:08:33] arup_r: has joined #RubyOnRails
[06:08:37] pipework: hamster88: @categories.includes(:articles) # This will have all the articles eagerly loaded for all categories.
[06:08:42] hamster88: sorry i was not clear with my question
[06:08:48] pipework: Assuming that @categories holds the categories you want.
[06:08:55] hamster88: it does right
[06:09:05] Devalo: has joined #RubyOnRails
[06:09:17] hamster88: so will this get articles from only one category ?
[06:09:35] pipework: hamster88: !try
[06:09:35] helpa: hamster88: Why don't you try it and find out for yourself?
[06:09:35] sneakerhax: has joined #RubyOnRails
[06:09:45] hamster88: let me have a go
[06:09:53] norc: has joined #RubyOnRails
[06:09:55] Ropeney: hamster88, look at comment https://gist.github.com/thedesignable/bac7068ec2ec643caff3
[06:09:58] pipework: Feel free to look up the docs for any code that you don't understand.
[06:10:28] Ropeney: why did it truncate my spacing
[06:10:47] pipework: ropeney: github markdown bro
[06:11:02] Ropeney: pipework, yeah just worked that out lol. I've actually never gisted
[06:11:14] pipework: ropeney: It's a github comment like any other
[06:11:27] Ropeney: fixed it up with the code tag
[06:11:55] w0rd-driven: has joined #RubyOnRails
[06:12:15] Ropeney: updated yet again
[06:12:29] Ropeney: hamster88, @category =, i think you want @categries =
[06:12:33] Ropeney: for clarity anyway
[06:14:03] pipework: ropeney: Do you not know github markdown? Use ```ruby\n codehere\n```
[06:14:10] pipework: Gets you code highlighting.
[06:14:29] Ropeney: i do, i just didn't care for it enough when i thought the point of the code was clear
[06:14:47] pipework: seems indicative.
[06:14:51] pipework: checks out.
[06:15:08] pipework: Anyways, weekending!
[06:16:12] Ropeney: enjoy it :D
[06:17:05] hamster88: ok so i think i am half way through
[06:17:19] hamster88: only need to get the articles from featured category.. its fetching all articles
[06:17:53] Ropeney: I'm giving up working out what you want sorry.
[06:20:16] |PiP|: has joined #RubyOnRails
[06:21:11] stannard: has joined #RubyOnRails
[06:22:59] uglybandersnatch: has joined #RubyOnRails
[06:25:13] quazimodo: has joined #RubyOnRails
[06:39:57] jstransky: has joined #RubyOnRails
[06:41:20] smoitra: has joined #RubyOnRails
[06:42:46] yfeldblum: has joined #RubyOnRails
[06:51:58] SteenJobs: has joined #RubyOnRails
[06:52:01] yfeldblum: has joined #RubyOnRails
[06:54:03] jiing: has joined #RubyOnRails
[06:59:14] _bogus_: has joined #RubyOnRails
[06:59:52] Jon30: has joined #RubyOnRails
[07:04:23] alaing: has joined #RubyOnRails
[07:04:33] alaing: has joined #RubyOnRails
[07:04:39] alaing: good morning
[07:04:43] halfamind: has joined #RubyOnRails
[07:06:55] alaing: I'm trying to build a plugin but having problem with the dummy app that gets created. I had added a development dependency that brings in some sass files in the dummy app's application.css.scss I reference it as '@import colours' but its ahving problems finding it
[07:07:47] alaing: I have another proper raisl app that uses the gem i'm depending on and I call it in exactly the same way and that has no problems finding it
[07:08:37] alaing: i added the dev dependency to the gemspec file
[07:11:07] arup_r: has joined #RubyOnRails
[07:13:10] quazimodo: has joined #RubyOnRails
[07:17:54] |PiP|: has joined #RubyOnRails
[07:23:17] arup_r1: has joined #RubyOnRails
[07:26:14] sp1rs: has joined #RubyOnRails
[07:30:19] Devalo: has joined #RubyOnRails
[07:31:13] bricker: has joined #RubyOnRails
[07:32:56] kgutteridge: has joined #RubyOnRails
[07:38:11] ruler_: has joined #RubyOnRails
[07:41:04] jkahn: has joined #RubyOnRails
[07:45:08] pyemkey: has joined #RubyOnRails
[07:52:14] merida: has joined #RubyOnRails
[07:54:14] alaing: has joined #RubyOnRails
[07:56:38] tvw: has joined #RubyOnRails
[07:57:35] jkahn: has joined #RubyOnRails
[08:05:19] halfamind: has joined #RubyOnRails
[08:09:22] neanderslob_: has joined #RubyOnRails
[08:12:46] duncannz: has joined #RubyOnRails
[08:14:55] davee_: has joined #RubyOnRails
[08:15:12] darutoko: has joined #RubyOnRails
[08:29:09] dionysus69: has joined #RubyOnRails
[08:30:09] rogue_koder: has joined #RubyOnRails
[08:30:34] tercenya_: has joined #RubyOnRails
[08:31:22] lxsameer: has joined #RubyOnRails
[08:31:26] crdpink: has joined #RubyOnRails
[08:33:45] kgutteridge: has joined #RubyOnRails
[08:35:02] lxsameer: hey people, My app does not uses assets digest in production, but the digest option is set to true, where should I look for problem?
[08:40:41] FLeiXiuS`: has joined #RubyOnRails
[08:43:17] zworks: has joined #RubyOnRails
[08:43:58] zworks: I have a csv file with with characters other than english, such as french
[08:44:28] zworks: when i tried to load it using the ruby CSV , it says ArgumentError: invalid byte sequence in UTF-8
[08:44:37] marr: has joined #RubyOnRails
[08:44:44] zworks: how can i reslove this please ?
[08:45:30] FLeiXiuS`: has joined #RubyOnRails
[08:45:38] pyemkey: has joined #RubyOnRails
[08:48:57] BinaryMaster: has joined #RubyOnRails
[08:51:20] BinaryMaster: Question: is there a way to have a link_to without any text? for example <%= link_to about_path, class: 'fill-parent' %>
[08:51:49] Ropeney: link_to '' ?
[08:52:49] BinaryMaster: I will give it a try
[09:00:10] triangles: has joined #RubyOnRails
[09:00:26] jenrzzz: has joined #RubyOnRails
[09:02:50] gingray: has joined #RubyOnRails
[09:05:58] halfamind: has joined #RubyOnRails
[09:06:28] jammanbo: has joined #RubyOnRails
[09:06:32] bePolite: has joined #RubyOnRails
[09:07:39] jammanbo: Am using postgres. Can anyone tell me why this fails in a migration? `execute("SELECT * FROM actors WHERE name = ''")`
[09:07:52] jammanbo: It's a valid query AFAICT
[09:08:10] jammanbo: => ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block
[09:09:46] yfeldblum: has joined #RubyOnRails
[09:11:54] Ropeney: jammanbo, thats all the whole code you run contains?
[09:12:02] chagel: has joined #RubyOnRails
[09:12:33] ayoros: has joined #RubyOnRails
[09:13:53] jammanbo: ropeney: Hmm, no there is stuff earlier in the migration. Turns out that it works if I run it in a rails console. Hmm
[09:14:22] Ropeney: that command is valid
[09:15:22] jammanbo: ropeney: Okay good hint, thanks. Yeah it is something to do with some other SQL being executed prior to that.
[09:16:44] arup_r: has joined #RubyOnRails
[09:17:46] mdw: has joined #RubyOnRails
[09:20:15] clorisu: has joined #RubyOnRails
[09:20:55] clorisu: has joined #RubyOnRails
[09:21:38] clorisu: has joined #RubyOnRails
[09:22:23] clorisu: has joined #RubyOnRails
[09:23:04] clorisu: has joined #RubyOnRails
[09:23:49] clorisu: has joined #RubyOnRails
[09:24:32] clorisu: has joined #RubyOnRails
[09:29:16] mdw: has joined #RubyOnRails
[09:31:11] tvw: has joined #RubyOnRails
[09:41:02] dgncn: has joined #RubyOnRails
[09:43:16] srinidhi: has joined #RubyOnRails
[09:44:08] scope: has joined #RubyOnRails
[09:46:38] mdw: has joined #RubyOnRails
[09:47:08] AzaToth: has joined #RubyOnRails
[09:47:11] AzaToth_: has joined #RubyOnRails
[09:49:13] baweaver: has joined #RubyOnRails
[09:51:05] kgutteridge: has joined #RubyOnRails
[09:51:45] sp1rs: has joined #RubyOnRails
[10:01:26] mdw: has joined #RubyOnRails
[10:04:35] blackhuey: has joined #RubyOnRails
[10:06:15] Doddlin: has joined #RubyOnRails
[10:06:34] halfamind: has joined #RubyOnRails
[10:06:56] pyemkey: has joined #RubyOnRails
[10:10:59] bePolite: has joined #RubyOnRails
[10:12:07] johnflux: has joined #RubyOnRails
[10:14:30] siaW: in my rails server i have something like this
[10:14:31] siaW: SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 ORDER BY created_at DESC LIMIT 1
[10:14:49] siaW: i know what everything means. but what does the `$1` mean?
[10:16:28] Ropeney: $1 is your first argument
[10:17:03] |PiP|: has joined #RubyOnRails
[10:17:33] siaW: so $2 would be second argument? and $3, third argument?
[10:17:50] siaW: wooooooow :D
[10:17:57] siaW: i learned something new. thanks
[10:21:45] sneep: What SQL server takes "" instead of `` to refer to table/column names?
[10:23:58] Ropeney: you referring to siaws question?
[10:24:24] Ropeney: he just used `` to reference what he was speaking about
[10:24:49] uglybandersnatch: has joined #RubyOnRails
[10:25:40] sneep: Erp, I mean the " in SELECT "accounts".*
[10:25:48] Mia: has joined #RubyOnRails
[10:25:49] Mia: has joined #RubyOnRails
[10:25:52] sneep: I'm just going to assume that it's not a straight copy and paste
[10:26:24] Ropeney: looks like it is to me
[10:26:48] Ropeney: in that case, this is the output when I use postgresql
[10:28:58] Didac: has joined #RubyOnRails
[10:29:36] mdw: has joined #RubyOnRails
[10:31:37] bePolite: has joined #RubyOnRails
[10:33:55] pawnbox: has joined #RubyOnRails
[10:36:21] pawnbox: has joined #RubyOnRails
[10:39:09] Dreamer3: anyone else see really slow Rails::Rack::Logger#call times in New relic? trying to figure out what the deal is with Rails cache flushing these days
[10:39:16] Dreamer3: can't find any recent good articles on the matter
[10:39:26] Dreamer3: 20% of my time is spent flushing the cache
[10:41:44] hightower2: has joined #RubyOnRails
[10:42:16] hightower2: has left #RubyOnRails: ()
[10:42:22] hightower2: has joined #RubyOnRails
[10:42:24] hightower2: has left #RubyOnRails: ()
[10:42:38] hightower3: has joined #RubyOnRails
[10:43:09] hightower3: In a form with collection_select, how do I specify the default value that should be selected if no choice exists yet?
[10:44:10] mdw7: has joined #RubyOnRails
[10:45:54] SanguineAnomaly: has joined #RubyOnRails
[10:46:27] Meow-J: has joined #RubyOnRails
[10:48:51] scope: has joined #RubyOnRails
[10:50:16] Dreamer3: answer: config.autoflush_log = false
[10:50:48] p8m: has joined #RubyOnRails
[10:54:21] mdw: has joined #RubyOnRails
[10:55:54] cac: has joined #RubyOnRails
[10:58:28] htmldrum: has joined #RubyOnRails
[11:00:57] dici: has joined #RubyOnRails
[11:02:11] SanguineAnomaly: has joined #RubyOnRails
[11:02:25] pyemkey: has joined #RubyOnRails
[11:03:05] quazimodo: has joined #RubyOnRails
[11:03:23] mdw: has joined #RubyOnRails
[11:03:41] Ropeney: hightower3, in html_options, give selected the value u want
[11:04:35] gingray_: has joined #RubyOnRails
[11:05:13] roshanavand: has joined #RubyOnRails
[11:05:38] Pazician: has joined #RubyOnRails
[11:07:42] Spami: has joined #RubyOnRails
[11:07:45] halfamind: has joined #RubyOnRails
[11:12:34] bePolite: has joined #RubyOnRails
[11:14:14] chagel: has joined #RubyOnRails
[11:15:55] hightower3: ropeney, thanks. (Right, I figured in the meantime that was the solution; I just thought there could be a default: or something)
[11:17:54] mikecmpbll: has joined #RubyOnRails
[11:23:04] jottr: has joined #RubyOnRails
[11:25:54] mhoungbo: has joined #RubyOnRails
[11:34:08] smoitra: has joined #RubyOnRails
[11:34:46] roshanavand: has joined #RubyOnRails
[11:39:02] triangles: has joined #RubyOnRails
[11:39:58] mdw: has joined #RubyOnRails
[11:40:57] mdw7: has joined #RubyOnRails
[11:44:44] jottr_: has joined #RubyOnRails
[11:46:15] mhoungbo: has joined #RubyOnRails
[11:52:37] kgutteridge: has joined #RubyOnRails
[11:53:33] jottr: has joined #RubyOnRails
[11:58:57] The_Phoenix: has joined #RubyOnRails
[12:01:16] Peteykun: has joined #RubyOnRails
[12:02:48] smoitra: has joined #RubyOnRails
[12:08:25] halfamind: has joined #RubyOnRails
[12:12:20] Pazician: has joined #RubyOnRails
[12:13:35] beast: has joined #RubyOnRails
[12:19:00] apotry: has joined #RubyOnRails
[12:25:02] hightower3: has joined #RubyOnRails
[12:31:45] FCser: has joined #RubyOnRails
[12:36:30] djellemah_: has joined #RubyOnRails
[12:36:32] smoitra_: has joined #RubyOnRails
[12:41:40] felltir: has joined #RubyOnRails
[12:42:52] beauby: has joined #RubyOnRails
[12:43:46] cac: has joined #RubyOnRails
[12:44:01] srinidhi: has joined #RubyOnRails
[12:53:31] kgutteridge: has joined #RubyOnRails
[12:54:41] sp1rs: has joined #RubyOnRails
[12:58:26] muhammadn: has joined #RubyOnRails
[12:59:07] muhammadn: Hi, i have a general question on Rails
[13:00:04] muhammadn: i hope to create an app with many users per company but the user will have a primary user controlling via the admin interface
[13:00:30] muhammadn: i have looked around (even with apartment gem) and basically it uses subdomains (from all that i have read on the internet)
[13:00:51] muhammadn: and i don't want to use subdomains but other information (such as name)
[13:04:14] Pazician: has joined #RubyOnRails
[13:05:04] durexlw: has joined #RubyOnRails
[13:05:10] durexlw: afternoon all
[13:05:45] tknz: has joined #RubyOnRails
[13:06:21] sonofdirt: has joined #RubyOnRails
[13:07:16] jottr: has joined #RubyOnRails
[13:09:07] halfamind: has joined #RubyOnRails
[13:12:48] scope: has joined #RubyOnRails
[13:13:45] scope: hello how do you know what gems to use for your app
[13:13:59] scope: is there a tutorial on deciding the best gems to use
[13:15:22] durexlw: scope: tutsplus has a video on gems
[13:15:37] durexlw: "Essential Rails Gems"
[13:16:46] durexlw: You looking for anything in particular?
[13:17:10] scope: just how you decide
[13:17:21] scope: i cant get my head round how you dont need js or css
[13:17:23] intrigueD: has joined #RubyOnRails
[13:17:33] Megamos: has joined #RubyOnRails
[13:17:45] scope: i understand that if you need jquery you install the jquery gem
[13:17:50] durexlw: scope: what do you mean? rails comes standard with jquery
[13:18:01] scope: i get that
[13:18:30] scope: my point is say im starting a website
[13:18:55] scope: and i want to make a gambling website for uno
[13:19:01] mwlang: scope: are you wanting to start the most bare-bones version of Rails possible and then add gems back as you go?
[13:19:02] scope: i know im going to need js
[13:19:24] scope: and logins payment
[13:19:32] scope: maybe a ranking score
[13:19:43] scope: how would i choose the rails gems
[13:19:57] scope: surely just having a rails gem isnt enough to create the site
[13:20:06] scope: like i have to code the game to start
[13:20:24] scope: so are gems just there for core features
[13:20:31] durexlw: depends on your knowledge and time, but I understand what you are saying
[13:20:41] scope: its highly confusig
[13:20:54] |PiP|: has joined #RubyOnRails
[13:21:12] durexlw: I guess if you're a bit new to the whole gems, google is your friend: "best authentication gem rails" will give you some references
[13:21:20] mwlang: scope: well start with rubytoolbox.com and click on categories tab.
[13:21:36] mwlang: for logins for example, you’ll see gems for handling authentication
[13:21:49] scope: i like to think myself as an advanced google user theres nothing i cant find
[13:22:01] scope: but doesnt seam like people go into depth about choosing gens
[13:22:25] mwlang: if you click the individual categories, you can see what’s most popular within a category.
[13:22:27] scope: right so gems then are basically the core features that are used so often it makes sence to automate it
[13:22:36] durexlw: scope: it would be quite a work to list all advantages of a gem to make up your specific need I guess
[13:23:38] durexlw: scope: think of gems like a common coding task: like authentication: same views all over the place, or adding comments to your website. Stuff we all do individually, but that is (pretty much) general
[13:23:52] mwlang: scope: choosing gems is somewhat an exercise in efficiency once you’ve built a few rails apps. you get to know your gems real well after, say ten rails apps.
[13:24:19] durexlw: mwlang: yeah and reading tutorials will boost that bigtime
[13:24:41] scope: i have to be honest reading tutorials so far hasnt answered that question
[13:24:43] durexlw: plus, you don't need that much gems... after a while you start to settle on a few
[13:25:02] durexlw: scope: probably you looked at the wrong ones... it's how I learned
[13:25:15] scope: but just for example i built this uno gamblin website
[13:25:29] mwlang: what I look for in gems is that they have been around a while, still have activity that indicates they’re being maintained and they have test suites covering their implementation.
[13:25:29] clorisu: has joined #RubyOnRails
[13:25:51] durexlw: mwlang: same here... and good documentation... which isn't always the case
[13:25:53] scope: so id use the gem for logins, payment, ranking, comments, and maybe a forum
[13:26:03] scope: then the game itself would be coded using javascript
[13:26:11] durexlw: sounds reasonable
[13:26:14] scope: i would then link that game code to the rails app
[13:26:24] FooMunki: has joined #RubyOnRails
[13:26:57] bePolite: has joined #RubyOnRails
[13:27:03] scope: i understand the dry stuff hence id have a navbar, footer, accounts, and ranking partial
[13:27:22] scope: using erb to display the codes
[13:27:28] roshanavand: has joined #RubyOnRails
[13:27:29] scope: pages sections sorry
[13:28:01] scope: so then really i should look at gems as little helpers. now heres where i get confused
[13:28:06] durexlw: i'd use haml, you should check that out... saves a lot of time in the html department of your site
[13:28:26] durexlw: ok, what confuses you,
[13:28:32] scope: why do i not need css
[13:28:49] scope: surely just installing a gem wont knowhow i want it to look
[13:29:02] scope: the gem might have everything i need but the colors and designs are way off
[13:29:06] Pazician_: has joined #RubyOnRails
[13:29:39] durexlw: scope: css is just css in rails as well... the only thing you can have is say you want to use a css framework, like bootstrap
[13:30:28] durexlw: then there will probably be a gem out there to strap that framework into your rails app, where the gem does most of the heavy lifting for you to have the framework in your rails app available (so takes away all the config and downloading stuff)
[13:31:01] durexlw: for example: look for "bootstrap gem rails" and you'll find a few gems that add the bootstrap-framework to your rails app
[13:31:05] theod: has joined #RubyOnRails
[13:31:23] scope: like bootstrap or bootstrap-sass
[13:31:43] durexlw: from there on, it's just bootstrap as in any other website, the only difference is that the files are arranged in the asset pipeline of rails, which is just a fancy way of saying that the css and js files are just organised in a structured folder
[13:31:56] durexlw: yeah bootstrap-sass is the one you want
[13:32:21] scope: now the next one is say i download a template
[13:32:32] scope: the template will come with all these fancy js and css files
[13:32:41] _Tariq: has joined #RubyOnRails
[13:32:46] scope: now i watched a great tutorial on integrating templates into rails
[13:32:54] scope: and it explained a lot and help me learn
[13:33:03] scope: but it didnt go into enough detail
[13:33:11] scope: as radar saw last night/this morning
[13:33:30] durexlw: so if you want to use bootstrap in your rails app, you have two options: download bootstrap, upload to your rails app or use a cdn (just as you would do in any other site)... that works. Or you could just add "bootstrap-sass' to your gemfile and type 'bundle'... same thing
[13:33:46] durexlw: ok, the template is just a html file and css and js, right?
[13:34:07] scope: few others but they dont bother me as no gems for them
[13:34:21] durexlw: so the only thing you need to know is: in rails, where does html go, where does js go and where does css go... that's basically it
[13:34:26] scope: now i installed bootstrap something or other
[13:34:31] scope: the latest
[13:34:32] hightower3: has joined #RubyOnRails
[13:34:36] theod: has joined #RubyOnRails
[13:34:45] scope: but i needed a different version
[13:35:12] durexlw: first of all: if you use gems: if the gem packs a new version of bootstrap, it will do that for you
[13:35:20] scope: how do you know which version you need
[13:35:20] scope: some of the templates i have there is no indication in the bootstrap.css file to the version
[13:35:26] RegulationD: has joined #RubyOnRails
[13:36:01] srinidhi: has joined #RubyOnRails
[13:36:04] durexlw: scope: i'd just use the last version... they tend to be pretty slow in evolution anyway and fairly compatible among versions
[13:36:19] durexlw: fix the problem if it occurs
[13:36:30] durexlw: don't think too much about the problems up front
[13:38:53] durexlw: anyone use fixtures and minitest?
[13:39:39] scope: would this come down to efficency and/or expeiriance
[13:39:40] scope: reading the code to understand the version it was written in then selecting the appropriate version
[13:39:40] scope: thats seams reasonable
[13:39:40] scope: im the type of person that wants to know why something is the way it is then how it is the way it is and then what i can make it do
[13:39:41] scope: i guess im thinking to much
[13:40:04] durexlw: scope: I kinda know what you're saying...
[13:41:18] durexlw: the hardest part about rails for me was that it became 'a special thing' in my mind... whereas in fact, it's just html, css and js... the structure is a bit special, but in the end, it's just a convienient way to tie those things together. I know I'm over simlicying it, but I tended to overcomplicate it myself
[13:41:55] bitkiller: has joined #RubyOnRails
[13:43:29] durexlw: Say I have a "Parties.yml" party1 has a title. I kinda thought that in my unit test, I could just do "@party = Party(:party1)" to retreive the data from the fixture. But that doesn't work. Can anyone say how to get the fixture data in my testfiles?
[13:45:26] tomatoes: has joined #RubyOnRails
[13:46:33] scope: i think thatsmy problem
[13:47:24] bricker: has joined #RubyOnRails
[13:48:09] durexlw: scope, I kinda think it would help you to look at this one tutorial... it shows how rails is actually build... it helps to demystify it
[13:49:57] moeabdol: has joined #RubyOnRails
[13:49:59] bollullera: has joined #RubyOnRails
[13:51:29] baweaver: has joined #RubyOnRails
[13:52:02] scope: the way i describe rails to people is this: ruby is facebook rails is candy crush. while candy crush is a seperate entity it still needs facebook to run. but you can use facebook to maximise the users playing candy crush and to add some cool features t the game
[13:53:55] durexlw: ow lord... about the fixtures, could have looked for hours... it was just a typo
[13:54:16] scope: haha figures
[13:55:45] durexlw: scope, about gems... here's a good advice: test using minitest or minitest spec... the whole rspec thing just overly complicates things imho
[13:56:06] scope: i use minitest and
[13:56:14] stannard: has joined #RubyOnRails
[13:56:28] Pazician: has joined #RubyOnRails
[13:56:46] scope: gem 'minitest-reporters'
[13:56:47] scope: gem 'mini_backtrace'
[13:56:47] scope: gem 'guard-minitest'
[13:56:59] durexlw: you like your gems huh ):
[13:57:23] durexlw: what's the 'mini_backtrace' and guard?
[13:57:27] scope: ive been playing around alot
[13:58:41] scope: https://rubygems.org/gems/mini_backtrace
[14:00:20] DoubleMalt: has joined #RubyOnRails
[14:00:59] scope: this is also the problem with alot of tutorials they use so many different gems but dont really say why
[14:01:34] durexlw: I don't quite get the function of that backtrace yet
[14:02:21] durexlw: so reduces the backtrace, right?
[14:03:58] Pupeno: has joined #RubyOnRails
[14:04:01] durexlw: the guard is just a way to run tests for the files that changed, right?
[14:04:12] Spami: So I made an API which is supposed to be though my website, is there a way to block users to directly hit my API without using my website?
[14:04:38] scope: yes but its now redundent
[14:04:38] scope: like i said the problem with tutorials is there all over the place
[14:04:38] scope: its mainly when you tst and get a red test you see a huge backtrace
[14:04:38] scope: it cleans that u[p
[14:04:40] blackhuey: has left #RubyOnRails: ()
[14:05:51] Pupeno_: has joined #RubyOnRails
[14:06:18] scope: durexlw its so you can avoid repetitive tasks
[14:06:59] scope: https://github.com/guard/guard#readme
[14:07:12] bob434: has joined #RubyOnRails
[14:08:29] durexlw: so yeah, when files change, tests are run to see if changed don't break the tests... among other things. I can still live with that doing that myself
[14:08:40] durexlw: Spami: authentication
[14:09:02] Spami: I'm not sure i'm following
[14:09:47] halfamind: has joined #RubyOnRails
[14:10:47] durexlw: I'm no expert on the matter: but if you talk about preventing a user to... then you're into authentication. probably about 3 ways to do that: simple html auth, token based, oauth
[14:11:19] durexlw: Spami: so basically: pass some form of authentication into your api call and only respond when the user is allowed, authenticated to make that call
[14:12:10] Spami: durexlw, I see. The issue is that it's a search
[14:12:26] Spami: so every visitor is allowed to use it
[14:12:40] Spami: I just don't want ppl to reverse engineer it to start scrapping the data
[14:13:13] durexlw: Spami: there is a difference between the users using your website (which can be accessible to all) and your website being authenticated, so allowed, to make an api call
[14:13:24] Spami: ah, I see
[14:14:32] durexlw: basically look at your website as the only thing being allowed to use your api and all users of your website can therefore make api call through the website, but not directly (unless they have the login to your api)
[14:15:01] durexlw: anyway, if it's a search, so just a read, why bother blocking it?
[14:16:15] Spami: durexlw, well, because i'm building a business API
[14:16:20] Spami: and I'm selling the access
[14:16:39] durexlw: Spami: fair reason right there :)
[14:16:44] dcunit3d: has joined #RubyOnRails
[14:16:51] Spami: I don't want ppl to reverse engineer the JS on my website and start using the undocumented API
[14:17:12] Spami: durexlw, it was so painful the make the data I have usable
[14:17:24] Pazician: has joined #RubyOnRails
[14:18:05] dionysus69: has joined #RubyOnRails
[14:18:27] durexlw: Spami: I hear ya... what did you use to transform your data?
[14:18:39] durexlw: I recently use Kiba (an etl gem)
[14:19:46] griffindy: has joined #RubyOnRails
[14:19:58] Spami: durexlw, what do you mean by transform ?
[14:21:22] durexlw: you have data, you did something to it to make it usefull. So I guess you either combined tables, added or removed columns or calculated fields... those latter actions, I refered to as 'transforming your data'
[14:21:31] Abhijit: has joined #RubyOnRails
[14:21:33] Abhijit: universa1, ping
[14:22:15] Spami: durexlw, ah, just pure SQL queries
[14:22:42] Abhijit: can I use "&" to match two active record collection proxy objects/
[14:22:43] |PiP|: has joined #RubyOnRails
[14:23:08] chouhoulis: has joined #RubyOnRails
[14:23:32] Abhijit: is thats meant only for strings and arrays?
[14:23:48] durexlw: Spami: do you do that inside your rails app our outside?
[14:24:15] durexlw: so do you first load your data in temp tables, then transform it into usable tables or how do you do it?
[14:24:24] theod: has joined #RubyOnRails
[14:24:42] durexlw: Abhijit: I don't know
[14:26:00] tvw: has joined #RubyOnRails
[14:26:12] stannard: has joined #RubyOnRails
[14:26:42] uglybandersnatch: has joined #RubyOnRails
[14:27:11] Spami: durexlw, basically, my data come from public records, the government gives me datasheets that I load in temp tables. Then I try to find the most common parts with each tables
[14:27:46] Spami: I create a final table. Then I organize each temp table so it fits the final one and then I load everything into the final table
[14:28:01] bePolite: has joined #RubyOnRails
[14:28:12] mrgreenfur: has joined #RubyOnRails
[14:28:29] Spami: it's a pain in the ass because there are a lot of typos, and from year to year the spreadsheets have different field. Usually the newest have some very valuable nformations
[14:29:07] durexlw: Spami: I hear ya... I used Kiba for that same purpose. It's a cool concept in that you can use ruby to process the information and you're therefore not restricted to sql
[14:29:41] Spami: I did not know about kebab, I'm going to look into it
[14:29:54] Spami: I'm hoping I can make money with my data now ahah
[14:30:06] durexlw: "Kiba" kebab is just there to fill your stomach :)
[14:30:32] durexlw: Spami: I hope so too... the thing I did was for government as well... they have a way of fucking up data
[14:30:56] Spami: durexlw, they do. the worst is everything is in uppercase. WHY???
[14:31:09] durexlw: so recognizable :)
[14:31:44] durexlw: probably cause noone told the guy entering the data his caps lock was on...
[14:31:49] Spami: but damn they have so much data
[14:32:01] Spami: They are also a pain to deal with for FOI request
[14:32:14] durexlw: FOI request?
[14:32:23] Spami: Freedom Of Information
[14:32:32] durexlw: ow, yeah, tell me about it
[14:32:50] Spami: I'm battling against 3 state agencies to get access to some data
[14:32:56] Spami: they won't disclose anything
[14:33:23] durexlw: Spami: not possible to scrape a site or something? That's how I do it
[14:33:44] Spami: Not for the data I'm requesting
[14:33:55] durexlw: fair enough
[14:34:22] durexlw: well good luck man. I hope it works. I'm having the same battle with a few companies.
[14:34:32] durexlw: software provider of local governments
[14:35:12] durexlw: we're doing a universal reporting system, but getting access to the data can mostly today only be done by exporting a few reports and then importing it... I want a direct link
[14:36:28] RegulationD: has joined #RubyOnRails
[14:42:44] andywww: has joined #RubyOnRails
[14:43:24] Pazician: has joined #RubyOnRails
[14:44:35] neohunter: has joined #RubyOnRails
[14:47:27] Oliphaunte: has joined #RubyOnRails
[14:47:32] neohunter: I want to create a column to store the transmission type of my, lets say, "car", what would be the best column type for this? enum('automatic', 'manual') or a boolean?
[14:52:01] IanMalcolm: has joined #RubyOnRails
[14:54:15] Devalo: has joined #RubyOnRails
[14:55:12] nerium: has joined #RubyOnRails
[14:55:36] cac: has joined #RubyOnRails
[14:57:05] fedexo: has joined #RubyOnRails
[14:58:30] srinidhi: has joined #RubyOnRails
[14:58:36] Oliphaunte: has joined #RubyOnRails
[15:03:27] Megamos: has joined #RubyOnRails
[15:10:29] halfamind: has joined #RubyOnRails
[15:11:48] theod: has joined #RubyOnRails
[15:13:04] scope: has joined #RubyOnRails
[15:14:55] sonofdirt: has joined #RubyOnRails
[15:17:09] merida_: has joined #RubyOnRails
[15:17:09] merida: has joined #RubyOnRails
[15:23:28] matthias_: has joined #RubyOnRails
[15:24:55] onechr: has joined #RubyOnRails
[15:25:07] arup_r: has joined #RubyOnRails
[15:25:09] chipotle: has joined #RubyOnRails
[15:25:38] Palsson: has joined #RubyOnRails
[15:27:31] sonofdirt: has joined #RubyOnRails
[15:28:36] arBmind1: has joined #RubyOnRails
[15:28:57] bricker: has joined #RubyOnRails
[15:30:36] tvw: has joined #RubyOnRails
[15:31:07] statelesscode: has joined #RubyOnRails
[15:33:35] gbgdev: has joined #RubyOnRails
[15:34:00] theod: has joined #RubyOnRails
[15:34:36] jhack: has joined #RubyOnRails
[15:36:53] Dreamer3_: has joined #RubyOnRails
[15:37:16] RegulationD: has joined #RubyOnRails
[15:37:22] stannard: has joined #RubyOnRails
[15:38:17] sonofdirt: has joined #RubyOnRails
[15:38:34] sonofdirt: has joined #RubyOnRails
[15:43:33] jottr_: has joined #RubyOnRails
[15:45:43] sonofdirt: has joined #RubyOnRails
[15:47:37] pipework: Spami: You mean a FOIA request.
[15:47:39] durexlw: neohunter: from db normalization point of view, you'd make a transition_types table
[15:47:54] riotjones: has joined #RubyOnRails
[15:48:12] Spami: pipework, yes
[15:48:57] neohunter: @durexlw what! but is only 2 options that will never change, that's is inpracticall, would I need to create a table even for gender?
[15:49:28] pipework: neohunter: In todays' social climate, gender is not always perceived as binary.
[15:50:10] pipework: Though I also don't really personally find use for a table either, just store a string and have the input field show male, female, prefer not to answer, and allow text input.
[15:50:15] neohunter: pipework: in today social climate, transmission type is perceived as binary
[15:50:18] sonofdirt: has joined #RubyOnRails
[15:50:36] theod: has joined #RubyOnRails
[15:50:37] pipework: neohunter: I don't know what you were trying to convey with that non-sequitur
[15:51:54] Devalo: has joined #RubyOnRails
[15:52:18] baweaver: has joined #RubyOnRails
[15:52:38] darkxploit: has joined #RubyOnRails
[15:52:55] pipework: neohunter: For things like you mentioned, the question might be better approached by asking whether you want to query based on the transmission type.
[15:53:26] pipework: I'd safely start with a string for miaow.
[15:53:40] pipework: You may find that an enum works fine, but no reason to jump ahead.
[15:53:49] humbledaisy: has joined #RubyOnRails
[15:54:37] sp1rs: has joined #RubyOnRails
[15:55:45] kgutteridge: has joined #RubyOnRails
[16:00:18] durexlw: neohunter: as pipe says... if it's that simple and needs no configuration, take string and hardcode the choices in your app
[16:00:49] jottr_: has joined #RubyOnRails
[16:02:44] Devalo: has joined #RubyOnRails
[16:06:06] fexilal: has joined #RubyOnRails
[16:07:44] ql6wlld: has joined #RubyOnRails
[16:10:55] qejk: has joined #RubyOnRails
[16:11:06] halfamind: has joined #RubyOnRails
[16:17:10] xploshioon: has joined #RubyOnRails
[16:23:04] Oliphaunte: has joined #RubyOnRails
[16:27:58] d0nn1e: has joined #RubyOnRails
[16:33:13] bePolite: has joined #RubyOnRails
[16:39:24] dandaman: has joined #RubyOnRails
[16:39:45] davee_: has joined #RubyOnRails
[16:39:49] DoctorMonocular: has joined #RubyOnRails
[16:41:37] moeabdol: has joined #RubyOnRails
[16:44:01] sonofdirt: has joined #RubyOnRails
[16:44:15] Pazician: has joined #RubyOnRails
[16:45:10] mices: has joined #RubyOnRails
[16:45:53] adavia: has joined #RubyOnRails
[16:46:01] mices: i can't use commas in a text field in my form, active record returns an invalid sql syntax error
[16:46:17] mices: text_area actually
[16:46:28] sonofdirt: has joined #RubyOnRails
[16:47:04] mices: do i have to manually strip them out in my controller?
[16:47:14] mices: am i missing something, shouldn't rails do this for me?
[16:47:33] Technodrome: has joined #RubyOnRails
[16:48:04] beingjohnm: mices: rails should definitely be handling that
[16:48:05] Technodrome: for a dashboard style application, what would you make the controller for the actual dashboard landing page? like DashboardController?
[16:48:17] beingjohnm: are absolutely positive that is the error?
[16:48:29] pipework: mices: Sounds like you're doing something extraordinarily wrong.
[16:49:10] beingjohnm: Technodrome: that is the name of my dashboard controller
[16:49:25] Technodrome: does that seem to be the most common naming for that/
[16:49:30] Technodrome: didn't know if there would be a better way
[16:49:42] Technodrome: beingjohnm you have no model backing that right? just a controller?
[16:49:43] beingjohnm: I haven't look at other people's so I cannot say
[16:49:47] beingjohnm: Technodrome: correct
[16:49:55] Technodrome: yeah seems natural
[16:49:59] pipework: I just name things after their resource kinds, personally.
[16:50:17] Technodrome: well most sites don't have /dashboard
[16:50:42] pipework: It sounds like you're managing what your 'root' resource looks like, at least.
[16:51:00] pipework: For your own convenience, feel free to name the controller however you like though.
[16:51:03] Technodrome: im guessing many would just check for a login and use the dashboard controller
[16:52:36] Technodrome: just a poll beingjohnm , but how many controllers do you have that are not model backed?
[16:53:11] pipework: It's a healthy mindset to disjoint models with controllers in terms of association or assignment. 1:1 ain't a thing to ever concern yourself with.
[16:54:01] beingjohnm: Technodrome: what pipework said. But it looks like four or five on this application.
[16:54:18] pipework: Actions are HTTP entrypoints with middleware. Rails routes requests to actions. Within the action, you have your whole application to do things with the request if you should choose.
[16:54:20] beingjohnm: Where I always run into problems is with models that aren't active record backed :)
[16:54:34] Technodrome: besides dashboard , what are the other controllers doing? static page controller?
[16:54:35] pipework: beingjohnm: Got a problem I could help you with it related to that?
[16:54:55] pipework: Technodrome: I've seen PageController, dashboard, home, root, etc.
[16:55:20] Technodrome: i was just curious in beingjohnm app what it was :)
[16:55:30] beingjohnm: pipework: I've found a lot of work arounds but it is kind of annoying that you use a lot of functionality when you aren't extending active record base. But thanks for the offer!
[16:55:43] pipework: beingjohnm: Activemodel is probably all you need.
[16:55:52] Technodrome: also if you don't mind me asking, what kind of application is it beingjohnm ?
[16:56:54] beingjohnm: Technodrome: pages, calculators, reports, set_language
[16:57:05] beingjohnm: and application obviously
[16:57:13] beingjohnm: Technodrome: financial services application
[16:57:27] Technodrome: how many models in total?
[16:57:34] Technodrome: and controllers
[16:57:52] Technodrome: is the reports controller just aggregating data from all the other controllers ?
[16:58:56] beingjohnm: pipework: I can't recall but I think there was the issue with active model was I couldn't do user.transactions.find() or whatever. So I worked aroudn that by setting the user in a method and then extending it. But honestly cannot remember why I couldn't get ActiveModel to work.
[16:59:09] durexlw: Technodrome: for the dashboard, how do you do your filtering then? js?
[16:59:21] bob434: has joined #RubyOnRails
[16:59:35] Technodrome: durexlw filtering? what kind of filtering?
[16:59:36] Pazician: has joined #RubyOnRails
[16:59:42] durexlw: ow, you meant by "dashboard has no model" that it in itself has no model
[16:59:44] sp1rs: has joined #RubyOnRails
[16:59:45] beingjohnm: Technodrome: reports controllers displays the reports. and the reports do gather data from various models.
[17:00:05] Technodrome: beingjohnm yeah, interesting
[17:00:07] durexlw: but you still use models to populate your data in your dashboard and in the dashboard controller, you filter those models, right?
[17:00:13] Technodrome: yep, all normal stuff i guess my app is then
[17:00:34] durexlw: sounds fair indeed
[17:00:52] Technodrome: durexlw of course yeah, the app has tons of models, the dashboard is just a hub in a sense with no particular data needed in that context specifically for that resource
[17:01:15] durexlw: Technodrome: makes complete sense
[17:01:25] Technodrome: i did that a static page controller but i use high voltage now
[17:01:33] Technodrome: which is like a static page controller ++
[17:01:59] pawnbox: has joined #RubyOnRails
[17:01:59] durexlw: what do you mean by that last?
[17:02:15] Technodrome: like a static page controller with more
[17:04:43] _Tariq: has joined #RubyOnRails
[17:05:04] Technodrome: well i guess in a way its just a static controller in a gem with some helper functions, but just gets it out of the app folder
[17:05:43] jottr_: has joined #RubyOnRails
[17:06:25] durexlw: Can someone tell me what I'm doing wrong? I'm trying to give a has_and_belongs_to_many another name as the model name: https://gist.github.com/durexlw/cb8fb179bc2dc1ffb26a
[17:06:31] pawnbox_: has joined #RubyOnRails
[17:10:05] srinidhi: has joined #RubyOnRails
[17:11:16] awasum: has joined #RubyOnRails
[17:12:17] halfamind: has joined #RubyOnRails
[17:12:40] mdw: has joined #RubyOnRails
[17:13:40] Pazician: has joined #RubyOnRails
[17:18:02] nerium: has joined #RubyOnRails
[17:18:17] bricker: has joined #RubyOnRails
[17:19:57] tonyynot: has joined #RubyOnRails
[17:20:57] mices: beingjohnm, pipwork: https://gist.github.com/mices/e8824619fec1d73c98ad
[17:21:29] arup_r: has joined #RubyOnRails
[17:22:37] beingjohnm: mices: I have to step away in a momemnt but can you update that with the error messages you are receiving? Include the query.
[17:23:26] kies: has joined #RubyOnRails
[17:23:38] liquid-silence: has joined #RubyOnRails
[17:23:38] liquid-silence: has joined #RubyOnRails
[17:23:51] theod: has joined #RubyOnRails
[17:24:15] mices: beingjohnm: refresh
[17:24:41] codepete: has joined #RubyOnRails
[17:27:10] durexlw: mices: it reminds me of a utf8-thing. Where did you get your data from?
[17:27:31] beingjohnm: mices: can you add the form submission from the console?
[17:27:56] mices: how would i capture that?
[17:28:08] beingjohnm: mices: rails c
[17:29:34] beingjohnm: mices: you might want to check your column character sets as durexlw alluded to
[17:29:57] beingjohnm: I have never had an issue like this before so I'm not sure if I will be a lot of help.
[17:30:04] snowy: has joined #RubyOnRails
[17:30:38] mikecmpbll: has joined #RubyOnRails
[17:31:59] durexlw: the whole encoding thing can be a pain
[17:32:59] sp1rs: has joined #RubyOnRails
[17:36:51] beingjohnm: mices: I gotta go but I'll be back in a few hours. good luck.
[17:37:13] arup_r: has joined #RubyOnRails
[17:37:17] SeanM_: has joined #RubyOnRails
[17:39:09] marcdel: has joined #RubyOnRails
[17:41:42] IFrank00: has joined #RubyOnRails
[17:41:53] baweaver: has joined #RubyOnRails
[17:42:16] rattatmatt: has joined #RubyOnRails
[17:46:23] rattatmatt: how can I force the client to redirect to a different website in my rails api? so they hit an api endpoint and instead of returning data to the client, I want to redirect them to an html website (meaning not redirecting to another api endpoint)
[17:46:44] |PiP|: has joined #RubyOnRails
[17:48:39] SeanM_: has joined #RubyOnRails
[17:48:45] nogic: has joined #RubyOnRails
[17:48:46] liquid-silence: has joined #RubyOnRails
[17:48:46] liquid-silence: has joined #RubyOnRails
[17:50:22] DLSteve: has joined #RubyOnRails
[17:52:30] Oliphaunte: has joined #RubyOnRails
[17:55:41] DoctorMonocular: has joined #RubyOnRails
[17:57:17] bob434: has joined #RubyOnRails
[17:58:12] n008f4g_: has joined #RubyOnRails
[18:05:41] DoctorMonocular: has joined #RubyOnRails
[18:06:48] arup_r: has joined #RubyOnRails
[18:09:19] moeabdol: has joined #RubyOnRails
[18:09:48] yehuda-moon: has joined #RubyOnRails
[18:10:42] Pazician: has joined #RubyOnRails
[18:10:43] DoctorMonocular: has joined #RubyOnRails
[18:12:56] halfamind: has joined #RubyOnRails
[18:13:12] merida___: has joined #RubyOnRails
[18:13:12] merida__: has joined #RubyOnRails
[18:13:22] Pazician: has joined #RubyOnRails
[18:15:36] jkahn: has joined #RubyOnRails
[18:16:14] FCser: So I've added a new has_and_belongs_to_many association between some existing models. The migrations have been setup. Fields added to the view. Now do I have to manually create the association records in the create / update actions?
[18:17:43] rattatmatt: has joined #RubyOnRails
[18:19:06] Cervajz_: has joined #RubyOnRails
[18:20:27] arup_r: for existing records or new records, you meant?
[18:20:32] muhammadn: has joined #RubyOnRails
[18:23:46] Technodrome: has joined #RubyOnRails
[18:24:37] intrigueD: has joined #RubyOnRails
[18:24:47] Technodrome: anyone here ever used rails admin as almost a CMS as such?
[18:25:35] pipework: Technodrome: Statements like that really belong in #masochism.
[18:25:38] petor: has joined #RubyOnRails
[18:27:33] jkahn: has joined #RubyOnRails
[18:28:03] Technodrome: i see the irony pipework
[18:28:24] Technodrome: but its sorta working for my purpose, editing around 15 pages of static content
[18:28:30] uglybandersnatch: has joined #RubyOnRails
[18:29:20] pipework: Technodrome: The biggest pain is that you're using something that works whale when not customized to hell for a situation where 110% of the time people want to be able to customize to hell.
[18:29:44] pipework: It would actually be a hilarious joke to pose in front of your coworkers. :p
[18:29:52] Technodrome: i'll put some background on it a bit
[18:30:03] _Tariq: has joined #RubyOnRails
[18:30:04] Technodrome: we do around 50-70 Drupal sites a year, mostly government and enterprise
[18:30:22] Technodrome: i hate splitting it up when doing a project in rails, and then doing front end in drupal
[18:30:39] Technodrome: nto even front end, just static content, 15-30 pages give or take
[18:30:46] rogue_koder: has joined #RubyOnRails
[18:31:58] Technodrome: yeah using the CMS for config , and moving things around with blocks and regions, thats not exactly the intention when I mean CMS like this with rails admin
[18:32:03] Technodrome: just a way to manage static content
[18:32:04] camilasan: has joined #RubyOnRails
[18:34:33] mices: has joined #RubyOnRails
[18:38:08] baweaver: has joined #RubyOnRails
[18:39:09] RegulationD: has joined #RubyOnRails
[18:47:53] meoblast001: has joined #RubyOnRails
[18:48:30] arup_r: has joined #RubyOnRails
[18:51:45] bob434: has joined #RubyOnRails
[18:52:23] mrgreenfur_: has joined #RubyOnRails
[18:52:35] kdough: has joined #RubyOnRails
[18:56:59] hotpancakes: has joined #RubyOnRails
[19:00:01] renegadeandy: has joined #RubyOnRails
[19:01:21] tonyynot: has joined #RubyOnRails
[19:01:37] Technodrome: any thoughts on that pipework ?
[19:01:49] Technodrome: maybe i'm abusing rails admin in a way
[19:02:13] pipework: Technodrome: Try something that's an actual CMS in rails maybe?
[19:02:27] Technodrome: i looked through refinery code
[19:02:42] Technodrome: seems like the closest thing to work, but in reality its doing a very similar thing to rails admin
[19:04:44] bePolite: has joined #RubyOnRails
[19:05:12] Technodrome: refinery has a very light region control system, and a tree view for management of pages
[19:07:03] solars: has joined #RubyOnRails
[19:10:04] jhack: has joined #RubyOnRails
[19:12:13] Pazician: has joined #RubyOnRails
[19:12:40] dionysus69: has joined #RubyOnRails
[19:13:38] halfamind: has joined #RubyOnRails
[19:16:23] nogic: has joined #RubyOnRails
[19:17:14] bob434: has joined #RubyOnRails
[19:17:45] hnanon: has joined #RubyOnRails
[19:18:46] hnanon: How would I model cities that have and belong to other cities?
[19:20:35] Technodrome: hnanon http://stackoverflow.com/questions/2168442/many-to-many-relationship-with-the-same-model-in-rails
[19:21:16] Technodrome: hnanon do you need any information about the relation itself?
[19:21:26] matthias_: has joined #RubyOnRails
[19:21:54] Miron: has joined #RubyOnRails
[19:22:02] djbkd: has joined #RubyOnRails
[19:22:05] hnanon: Technodrome: I don't think so.
[19:22:18] hnanon: (Great link, by the way)
[19:22:23] Technodrome: as in additional fields about reach relation
[19:23:03] durexlw: hnanon: I have the exact same question. Technodrome thanks for the link
[19:23:04] hnanon: At the moment, I can't think of a need for more info about the relation.
[19:23:46] durexlw: hnanon: you may want to sore which kind of relationship the one city has to the other
[19:24:00] durexlw: here I have contacts that have a relationship to another contact
[19:24:22] smathy: has joined #RubyOnRails
[19:24:42] hnanon: durexlw: What other info would you consider storing, in your case?
[19:25:21] Cohedrin: has joined #RubyOnRails
[19:25:45] Oliphaunte: has joined #RubyOnRails
[19:26:23] durexlw: to be more specifix: I have Parties (which can be a company or a person). A party can have a relationship to another party. For example: Marc (a party of type person) can have a relationship with "Company inc." (a party of type company). The kind of relationship is important
[19:26:37] durexlw: could be a consultant for that company or an employee
[19:27:28] durexlw: in the same way: a city is related to another city... it could be that the kind of relationship is relevant to you
[19:28:00] Oliphaunte: has joined #RubyOnRails
[19:28:23] arup_r: self join
[19:30:04] hnanon: Well, in my case, a city has it's own show view. That view links to "connected cities" (just nearby cities).
[19:30:44] hnanon: So, maybe I'll just use a has_many through connected_cities.
[19:30:52] durexlw: hnanon: fair enough... then the sole fact they are physically close is enough... sounds like no more info is needed then
[19:31:49] durexlw: arup_r: self join indeed... but the join table needs extra info, which makes it a bit more complex
[19:35:42] sp1rs: has joined #RubyOnRails
[19:35:44] hnanon: Tecnodrome: I can't get over how thorough the answer is in that link.
[19:36:24] hnanon: Technodrome: ^
[19:37:22] bronson: has joined #RubyOnRails
[19:37:36] Technodrome: to get this clear, cities relate to cities correct?
[19:37:48] Technodrome: a self referential relation with no other data but the relation itself?
[19:38:29] Martyn: has joined #RubyOnRails
[19:38:41] intrigueD: has joined #RubyOnRails
[19:38:56] Technodrome: i've not done it in rails, but i have done it in django many times, i assume its the same as that link shows, is there a part of it you dont' understand?
[19:40:01] jkahn: has joined #RubyOnRails
[19:40:12] Technodrome: hnanon http://stackoverflow.com/questions/5109893/rails-how-do-self-referential-has-many-models-work this can help too
[19:40:17] sp1rs: has joined #RubyOnRails
[19:40:54] Technodrome: hmm in a weird way, maybe depending on how you are doing it, a tree could work as well hnanon
[19:41:07] Technodrome: why are cities relating to other cities? what is the explaination behind it?
[19:41:57] futilegames: has joined #RubyOnRails
[19:41:58] durexlw: Technodrome: seems to be about that one is neighboring the other
[19:44:27] Devalo: has joined #RubyOnRails
[19:44:30] durexlw: what's a "has_enumerated"?
[19:45:03] bricker: has joined #RubyOnRails
[19:51:12] gmas: has joined #RubyOnRails
[19:57:54] PedramT: has joined #RubyOnRails
[19:59:35] bonhoeffer: has joined #RubyOnRails
[19:59:36] forcer: has joined #RubyOnRails
[20:08:02] mices: has joined #RubyOnRails
[20:11:45] Oliphaunte: has joined #RubyOnRails
[20:12:49] rattatmatt: has joined #RubyOnRails
[20:13:51] kdough: has joined #RubyOnRails
[20:14:15] halfamind: has joined #RubyOnRails
[20:16:18] Jasaka: has joined #RubyOnRails
[20:16:30] DoctorMonocular: has joined #RubyOnRails
[20:19:38] sp1rs: has joined #RubyOnRails
[20:24:28] bePolite: has joined #RubyOnRails
[20:27:28] DoctorMonocular: has joined #RubyOnRails
[20:29:35] mhoungbo: has joined #RubyOnRails
[20:29:49] mostlybadfly: has joined #RubyOnRails
[20:36:29] juhoh: has joined #RubyOnRails
[20:37:33] DmitryBochkarev: has joined #RubyOnRails
[20:38:28] Oliphaunte: has joined #RubyOnRails
[20:39:10] hotpancakes: has joined #RubyOnRails
[20:39:39] hnanon: technodrome: Sorry, I had to step away.
[20:39:58] hnanon: Cities are related when they are near each other.
[20:40:46] RegulationD: has joined #RubyOnRails
[20:41:03] _Tariq: has joined #RubyOnRails
[20:42:21] mices: has joined #RubyOnRails
[20:42:37] Cohedrin: has joined #RubyOnRails
[20:43:54] yfeldblum: has joined #RubyOnRails
[20:43:57] futilegames: has joined #RubyOnRails
[20:46:05] Devalo: has joined #RubyOnRails
[20:48:35] DmitryBochkarev: has joined #RubyOnRails
[20:52:04] Technodrome: hnanon are you sure you have the right approach then?
[20:52:08] Technodrome: near as in something distance related?
[20:52:20] Technodrome: so many miles or km's ?
[20:52:30] muhammadn: has joined #RubyOnRails
[20:53:54] bronson: has joined #RubyOnRails
[20:54:40] jenrzzz: has joined #RubyOnRails
[20:55:03] Oliphaunte: has joined #RubyOnRails
[20:56:19] hnanon: Yes, as in distance.
[20:56:28] hnanon: So I will create a city.
[20:56:39] Technodrome: so creating some sort of related city database for that i think, may not be the best idea
[20:56:54] hnanon: Then I will select nearby cities manually in a form.
[20:57:01] Technodrome: you would have so many overlapping records for each city, it would be huge even for a small country
[20:57:16] Technodrome: why not just use a geolocation database for this?
[20:57:43] hnanon: Can you explain how that would work?
[20:57:55] hnanon: For example, if I'm San Francisco...
[20:58:19] Oliphaunte: has joined #RubyOnRails
[20:58:22] Technodrome: there is alot of articles about distance and geolocation in rails, there is no way you woulld want to create a self referential model that keeps relating close by cities
[20:58:22] hnanon: The geolocation database will find the 10 largest cities within x miles and show them?
[20:58:36] baweaver: has joined #RubyOnRails
[20:58:52] Technodrome: 5 cities in close proximity would be , 5x5x5x5
[20:59:09] Technodrome: so 500 records just just 5 cities which are close, right? i think my math is correct here
[20:59:31] hnanon: Hmm. Yeah, you're right.
[20:59:32] Technodrome: because each city will have 5 records of the close cities (assuming there is only 5 close cities()
[20:59:40] hnanon: Yes, I see.
[21:00:03] hnanon: It's exponential record growth.
[21:00:04] Technodrome: you are essentially making each city a tree, a parent, and having child cities as a child, and then those children could have, and there would just be so much overlap
[21:00:34] Technodrome: a geolocation database would be better, there is many for rails, and you can have it all run locally, you dont need to use a 3rd party REST api
[21:01:01] hnanon: Can you point to one?
[21:01:10] Technodrome: if it was geographically restricted to one very small area, and there was good reason, like say you wanted to relate all the neighborhoods in San Fran , then maybe
[21:01:24] Technodrome: because that might not be so accurate with geolocation, usually its just cities
[21:01:45] Technodrome: but if its just cities, you're db for just some cities could be 10GB ha
[21:02:23] hnanon: Do geolocation dbs include city sizes?
[21:04:02] hnanon: I mean population.
[21:06:29] DmitryBochkarev: has joined #RubyOnRails
[21:07:13] hnanon: I suppose I don't actually need "population."
[21:07:29] hnanon: The geocoder gem looks helpful.
[21:07:52] pawnbox: has joined #RubyOnRails
[21:12:03] mikecmpbll: has joined #RubyOnRails
[21:13:14] Pazician: has joined #RubyOnRails
[21:14:56] halfamind: has joined #RubyOnRails
[21:15:54] pwnd_nsfw: hnanon, works p well
[21:18:24] gbgdev: has joined #RubyOnRails
[21:20:11] Technodrome: hnanon i believe many do include population
[21:20:28] Technodrome: now if you had a database of every US city with a field for population, that wouldn't be so bad
[21:20:45] Technodrome: but creating that self referencing tree structure overlapping, oh boy that would be a huge huge headache
[21:22:25] kdough: has joined #RubyOnRails
[21:22:29] duncannz: has joined #RubyOnRails
[21:26:58] _djbkd: has joined #RubyOnRails
[21:29:22] juhoh: has joined #RubyOnRails
[21:30:51] mhoungbo: has joined #RubyOnRails
[21:31:41] PedramT: has joined #RubyOnRails
[21:35:52] jottr: has joined #RubyOnRails
[21:36:43] Pathfinder: has joined #RubyOnRails
[21:36:45] synaps3: has joined #RubyOnRails
[21:37:49] synaps3: hello, can someone help me with an app i cannot find an error
[21:38:08] synaps3: https://rails-leverquin.c9users.io/ here is the link
[21:38:38] synaps3: and here is tutorial i am following, i am at partials part
[21:38:42] synaps3: https://www.railstutorial.org/book/filling_in_the_layout
[21:38:49] durexlw: synaps3: we can't see that. We'd need to be logged in in your cloud 9
[21:39:38] durexlw: take a screenshot of the error or make a gist or something
[21:40:04] samuelkadolph: has joined #RubyOnRails
[21:40:46] synaps3: https://gist.github.com/leverquin/8a97e947d4cd53d2d06a
[21:41:38] makerops: you are calling .save somwhere probably
[21:41:45] makerops: somewhere you shouldn't be
[21:42:20] synaps3: i dont have any models
[21:42:25] durexlw: makerops: pretty strong to deduce that with that little information
[21:42:33] Guest37582: has joined #RubyOnRails
[21:42:41] makerops: durexlw, i agree
[21:42:48] durexlw: synaps3: add your StaticPages controller to the gist
[21:42:52] makerops: 90% of the time ive run into that though...it's been that
[21:43:20] durexlw: yeah, well, I guess you have a strong reason to make the assumption
[21:43:27] synaps3: https://gist.github.com/leverquin/58f5afc96ee472b7b9c2
[21:43:37] durexlw: I look at the error and go like *stares blank* :)
[21:44:08] synaps3: there is so little code for this big error
[21:44:27] durexlw: what's your controller called?
[21:44:41] quazimodo: has joined #RubyOnRails
[21:44:55] synaps3: static_pages_controller
[21:45:17] makerops: it's something to do with spring fwiw
[21:45:52] makerops: for what it's worth
[21:45:56] makerops: at least i think
[21:46:13] durexlw: I would have guessed "fuck wive if worthy"
[21:47:05] georgedrummond: has joined #RubyOnRails
[21:47:08] durexlw: synaps3: where are you at the tutorial? up till where did it work and when did it start to go wrong?
[21:47:28] dcunit3d: has joined #RubyOnRails
[21:47:30] bricker: has joined #RubyOnRails
[21:47:34] synaps3: up intil i added lines like these:
[21:47:36] beingjohnm: makerops: woah. I believe I remember you from a couple other channels but haven't seen you here.
[21:47:49] synaps3: <%render '/layouts/shim'%>
[21:47:55] makerops: beingjohnm, i idle i here
[21:48:08] makerops: don't chat much though, unless im really bored
[21:48:12] synaps3: in layotus/application.html.erb
[21:48:33] synaps3: i think i sholud reinstall rails gem
[21:48:49] durexlw: I'm not sure that's the right idea
[21:49:13] DoctorMonocular: has joined #RubyOnRails
[21:49:40] durexlw: synaps3: what happens if you remove those lines then?
[21:49:55] georgedrummond: Hi - anyone know of a good place to pick up extra freelance ruby work?
[21:50:27] Pupeno: has joined #RubyOnRails
[21:50:30] synaps3: durexlw: it works
[21:50:45] synaps3: but without partials
[21:51:05] durexlw: can you add the line back in, make a gist of that file and mark the line that gives the error?
[21:51:27] synaps3: just a sec
[21:51:38] durexlw: georgedrummond: elance?
[21:52:54] durexlw: heavy competition though... hard to compete the countreis that work at $10 or less. I don't mean this offensive in any way, just as an observation that fees tend to be different among countries
[21:53:09] bricker: has joined #RubyOnRails
[21:53:15] georgedrummond: durexlw: ill check it out - thanks
[21:53:42] georgedrummond: yeah that is very low though
[21:53:45] makerops: georgedrummond, i have an IFTTT recipe setup to scan craigslist for some local major cities
[21:53:52] synaps3: https://gist.github.com/leverquin/51b20087c51e41f42c88
[21:54:25] makerops: post the header
[21:55:01] georgedrummond: haha awesome. maybe i can get my hue lights to flash if any leads come up
[21:55:10] hnanon: Does the geocoder gem all me to pass a city object and retrieve an array of nearby cities?
[21:55:32] durexlw: synaps3: add the _header.rb file in the gist
[21:56:11] alaing: has joined #RubyOnRails
[21:57:08] durexlw: hnanon: I think you need to think about: do you mean with 'near', closeby or neighboring?
[21:58:17] hnanon: durexlw, Well, I would provide a radius.
[21:58:59] hnanon: It's working fine when retrieving cities in my table near a given city.
[21:59:03] alaing: I'm trying to build a plugin but having problem with the dummy app that gets created. I had added a development dependency that brings in some sass files in the dummy app's application.css.scss I reference it as '@import colours' but its ahving problems finding it
[21:59:36] alaing: I'm trying to build a plugin but having problem with the dummy app that gets created. I had added a development dependency that brings in some sass files in the dummy app's application.css.scss I reference it as '@import colours' but its ahving problems finding it
[22:00:03] alaing: I have another proper raisl app that uses the gem i'm depending on and I call it in exactly the same way and that has no problems finding it
[22:00:05] hnanon: However, I was hoping there was a way to get all cities (from whatever api its using) that are near a given city (instead of those cities needing to exist in my cities table).
[22:00:24] synaps3: durexlw: thanks for your help but i have to go now will be here tomorow trying to fix this, bye
[22:00:33] durexlw: synaps3: laterz :)
[22:00:50] shiru: has joined #RubyOnRails
[22:01:18] quazimodo: has joined #RubyOnRails
[22:02:25] durexlw: need some rest too... been working all day. Laterz all.
[22:05:06] jenrzzz: has joined #RubyOnRails
[22:07:16] _Tariq: has joined #RubyOnRails
[22:07:45] bronson: has joined #RubyOnRails
[22:15:09] bonhoeffer: has joined #RubyOnRails
[22:16:05] halfamind: has joined #RubyOnRails
[22:19:41] IFrank00: has joined #RubyOnRails
[22:25:45] bollullera: has joined #RubyOnRails
[22:25:52] gbgdev_: has joined #RubyOnRails
[22:29:04] DmitryBochkarev: has joined #RubyOnRails
[22:30:21] uglybandersnatch: has joined #RubyOnRails
[22:30:35] ss_much: has joined #RubyOnRails
[22:31:20] _djbkd: has joined #RubyOnRails
[22:31:30] htmldrum: has joined #RubyOnRails
[22:32:27] _djbkd: has joined #RubyOnRails
[22:36:24] j4d: has joined #RubyOnRails
[22:38:15] Technodrome: this rails app I have to support has 1 page controller, and 300 methods, and then 300 lines in the routes for the url's , i know this is common in smaller sizes, but jeesh
[22:38:27] Technodrome: maybe the dev would've thought this wasn't the most DRY thing
[22:39:07] bob434: has joined #RubyOnRails
[22:39:38] DoctorMonocular: has joined #RubyOnRails
[22:39:51] intrigueD: has joined #RubyOnRails
[22:42:14] RegulationD: has joined #RubyOnRails
[22:42:35] tycoon177: has joined #RubyOnRails
[22:44:09] htmldrum: has joined #RubyOnRails
[22:46:01] pwnd_nsfw`: has joined #RubyOnRails
[22:46:45] |PiP|: has joined #RubyOnRails
[22:47:02] GreatDanton: has joined #RubyOnRails
[22:47:48] Devalo: has joined #RubyOnRails
[22:48:03] stannard: has joined #RubyOnRails
[22:48:12] netzfisch: has joined #RubyOnRails
[22:50:04] j4d: has joined #RubyOnRails
[22:50:58] tycoon177: has joined #RubyOnRails
[22:52:01] Miron: has joined #RubyOnRails
[22:53:07] j4d: has joined #RubyOnRails
[22:53:52] rrrepsaj: has joined #RubyOnRails
[22:54:19] armyriad: has joined #RubyOnRails
[22:55:28] htmldrum: has joined #RubyOnRails
[22:57:19] smathy: Technodrome, I think "dev" is a bit generous.
[22:57:58] Technodrome: smathy well i understand the struggle a bit
[22:58:12] Technodrome: sometimes its they plan to do 10 pages or 15 , then it gets to a 100 and so on
[23:03:04] smathy: Technodrome, heh, you say that as if a controller writes its own methods while you sleep ;)
[23:03:24] Technodrome: what do you do for static pages?
[23:03:37] Technodrome: url to a controller, grab id and look up a template with that name?
[23:03:42] Technodrome: I use high voltage personally
[23:06:59] eljimmy: has joined #RubyOnRails
[23:07:24] htmldrum: has joined #RubyOnRails
[23:08:48] mikecmpbll: has joined #RubyOnRails
[23:08:57] fox_mulder_cp: has joined #RubyOnRails
[23:11:59] DHH: has joined #RubyOnRails
[23:13:10] Pupeno: has joined #RubyOnRails
[23:14:53] Jed32: has joined #RubyOnRails
[23:16:44] halfamind: has joined #RubyOnRails
[23:16:57] ql6wlld: has joined #RubyOnRails
[23:19:18] berdf: has joined #RubyOnRails
[23:19:56] berdf: has left #RubyOnRails: ()
[23:20:33] stannard: has joined #RubyOnRails
[23:25:20] FooMunki: has joined #RubyOnRails
[23:25:26] berdf: has joined #RubyOnRails
[23:28:19] berdf: has left #RubyOnRails: ()
[23:28:32] berdf: has joined #RubyOnRails
[23:28:43] berdf: has left #RubyOnRails: ()
[23:28:51] mhoungbo: has joined #RubyOnRails
[23:28:51] j4d: has joined #RubyOnRails
[23:30:29] berdf: has joined #RubyOnRails
[23:30:42] berdf: has left #RubyOnRails: ()
[23:34:16] `adaedra: has joined #RubyOnRails
[23:36:02] berdf: has joined #RubyOnRails
[23:38:14] smathy: Technodrome, depends a lot, I rarely have more than a handful of static pages.
[23:39:10] pipework: I'd push the static pages to a CDN and serve from there.
[23:44:49] j4d: has joined #RubyOnRails
[23:45:38] Technodrome: oh smathy , it was a hypothetical :)
[23:46:02] pipework: Technodrome: When smathy is involved it's parenthetical.
[23:46:44] samuelkadolph: has joined #RubyOnRails
[23:47:47] j4d: has left #RubyOnRails: ()
[23:54:35] rrrepsaj: has joined #RubyOnRails