« Back to channel list

#RubyOnRails - 08 May 2017

« Back 1 day Forward 1 day »
[00:09:07] Archrover: has joined #RubyOnRails
[00:09:52] northfurr: has joined #RubyOnRails
[00:14:31] romeoh_: has joined #RubyOnRails
[00:29:24] ovaltine: has joined #RubyOnRails
[00:29:52] ovaltine: What is the reasoning for not allowing 'has_many through' through a has_one ?
[00:30:03] JayG1: has joined #RubyOnRails
[00:30:13] JayG1: Hello, everyone.
[00:30:27] spheric: has joined #RubyOnRails
[00:30:49] JayG1: Does anyone here have experience developing in Asia (specifically, China)?
[00:33:25] spheric: has joined #RubyOnRails
[00:33:26] xco: has joined #RubyOnRails
[00:34:16] xco: has joined #RubyOnRails
[00:35:11] xco: has joined #RubyOnRails
[00:36:01] xco: has joined #RubyOnRails
[00:36:51] xco: has joined #RubyOnRails
[00:37:36] xco: has joined #RubyOnRails
[00:38:23] xco: has joined #RubyOnRails
[00:39:13] xco: has joined #RubyOnRails
[00:39:42] testercsgo: has joined #RubyOnRails
[00:46:10] duderonomy: has joined #RubyOnRails
[00:54:25] quirkycoders: has joined #RubyOnRails
[01:02:24] auv: Anyone know of a pre-existing solution that takes dynamically generated inline JS (things with ERB variables in them) and puts it into a file
[01:02:33] auv: I'm doing it manually on a large app right now and it's killing me lol
[01:04:26] Jameser: has joined #RubyOnRails
[01:07:37] Pumukel: has joined #RubyOnRails
[01:16:22] francuz: hello everyone, is there a way to make some routes that only works when in dev but not in production ? don't know what to ask google to find it,
[01:24:02] quirkycoders: has joined #RubyOnRails
[01:26:08] romeoh: has joined #RubyOnRails
[01:28:45] peterhil: has joined #RubyOnRails
[01:28:52] creature: francuz: http://guides.rubyonrails.org/routing.html#advanced-constraints might help. There might be a simpler way too.
[01:33:17] apparition: has joined #RubyOnRails
[01:33:52] francuz: that might do the job, i'll keed searching for a simpler way tho, (I don't need it at all, I'm moslty curious and triing to learn as much as possible about rails)
[01:44:37] chare: has joined #RubyOnRails
[01:49:28] romeoh_: has joined #RubyOnRails
[02:02:53] atrius: has joined #RubyOnRails
[02:03:00] gusrub: has joined #RubyOnRails
[02:07:19] biox: has joined #RubyOnRails
[02:08:10] spheric: has joined #RubyOnRails
[02:12:01] spheric_: has joined #RubyOnRails
[02:14:53] TheMonster_: has joined #RubyOnRails
[02:15:11] biox: hi everyone! rails noobie here going through a rails book, and my controller test keeps failing. hopefully all relevant informations: https://hastebin.com/anoqetoxol.rb - let me know if there's anything else I can throw in
[02:15:34] biox: it has to do with this line: assert response.body.include?(stories(:one).name)
[02:15:47] biox: I'm wondering if the format is wrong
[02:26:04] northfurr: has joined #RubyOnRails
[03:01:41] AntiSpamMeta: has joined #RubyOnRails
[03:08:46] creature: biox: I don't fully grok your example, but it strikes me that you're looking for stories(:one) to have a "name" property and you don't have one in your YAML fixture.
[03:08:55] Pumukel: has joined #RubyOnRails
[03:10:03] biox: creature: in test/fixtures/stories.yml i define names for the stories. my impression is that those fixtures will load in parallel and be use-able as well?
[03:11:20] biox: https://hastebin.com/wubadolico.pas
[03:12:00] creature: Hmm. Are you copying this directly out of the book?
[03:12:12] biox: pretty much yea.
[03:12:32] biox: to answer directly, yes.
[03:12:48] creature: I'm curious why your votes_controller_test is testing whether a story can be retrieved. I'd have expected that to be either a stories_controller_test or a test "show vote".
[03:13:17] biox: creature: oh.
[03:13:24] creature: Also, you included the `create` method in your VotesController, but if you're testing an HTTP GET you probably want the `show` action instead.
[03:13:42] creature: And, well, probably the `show` method in the StoriesController.
[03:14:28] biox: creature: you are 100% correct, I overlooked where I was placing these tests, ack!
[03:14:38] biox: Will correct the placement and report back, thanks for the direction! <3
[03:15:15] creature: I mean, that's probably not going to fix your issue. :) Bu hopefully it'll get you looking in the right places. :)
[03:16:12] irishfromua: has joined #RubyOnRails
[03:16:12] biox: hopefully! i got it in my head that because I did all of my work on the VoteController I only needed to write tests for it. :) I forgot that I did some mapping between the votes/story controllers
[03:24:41] northfurr: has joined #RubyOnRails
[03:28:12] roamingdog: has joined #RubyOnRails
[03:30:02] tofutoon: has left #RubyOnRails: ()
[03:31:00] biox: creature: you were correct, the problem hasn't resolved by moving the test. Where does the 'response' object come from? as in `assert response.body.include?(stories(:one).name)`
[03:31:14] biox: also is there any log file or troubleshooting technique i should be using?
[03:32:10] creature: "response" is something that the test harness is providing for you.
[03:33:05] creature: If this were my test, I'd probably drop in a `binding.pry` statement just before the assertion, so when I ran the test suite it'd give me a debugger.
[03:33:25] creature: You'll have to add `require 'pry'` to your Gemfile first, if you don't have it already, and then run "bundle install".
[03:33:52] creature: Once you're in the debugger you can type "response.body", which will print the body, and you can see exactly what's in there.
[03:34:06] biox: creature: oh perfect, that's exactly what i was looking for.
[03:34:42] creature: A simpler way would be to add `puts response.body.inspect` in your test instead, but Pry is a useful thing to learn.
[03:37:23] biox: creature: wow, what a useful tool!
[03:37:30] biox: i think I have it figured out
[03:37:32] biox: https://hastebin.com/ezaqiyomoh.tex
[03:38:07] biox: the 'el blog' string isn't in the body verbatim, since i'm replacing whitespaces with hyphens when i generate uris
[03:40:10] creature: From what I can see in the output, you're not outputting the name at all?
[03:40:27] creature: In your HTML, I mean.
[03:40:55] biox: creature:in the HTML it appears like this: action=\"/stories/980190962-el-blog/votes\"
[03:41:21] biox: So I changed my assert to assert response.body.include?(stories(:one).name.gsub(/ /, '-')) which made the test pass
[03:42:41] biox: feels a little flakey though
[03:44:23] creature: I mean, if you're asking people to vote for things, maybe you should display the name of what they're voting for in the page?
[03:44:37] creature: Which would make your original test pass, _and_ help the user. :)
[03:46:45] biox: creature: this is a good point. :)
[03:48:56] biox: yaay, it works!
[04:06:27] patarr: has joined #RubyOnRails
[04:09:20] xall: has joined #RubyOnRails
[04:10:43] Pumukel: has joined #RubyOnRails
[04:18:32] xall: has joined #RubyOnRails
[04:36:30] biox: creature: kind of a complicated question, but I figured I'd ask it here. I'm considering diving deep into Rails and aiming to become a ror developer because I like the language and the framework a lot. Do you think that it's a good idea considering that microservices are the new hotness?
[04:38:09] creature: I don't know your background, and as you might have guessed I have done a fair amount of Rails - so I'm likely to be biased.
[04:38:27] uksio: has joined #RubyOnRails
[04:38:59] creature: But microservices have been the new hotness for at least a decade at this point, and I think that Rails is a great way to make web-based systems. I certainly don't think learning it will do you any harm.
[04:39:53] biox: my background is mainly in the operations world - linux/chef/jenkins and the like, but no pure programming. i initially started playing with ror because i picked up a book, but i find myself reading and playing with it in my free time
[04:40:41] xall_: has joined #RubyOnRails
[04:41:37] creature: I think the things you learn will stand you in good stead. :)
[04:41:57] creature: Rails is just a framework - you can write stuff in Rails that uses microservices.
[04:42:46] biox: isn't it kind of monolithic by design though? with the tight adherance to mvc
[04:43:21] creature: A lot of Rails-based projects are monolithic, yes. But they don't have to be.
[04:44:04] xall: has joined #RubyOnRails
[04:44:04] creature: For instance, there's no law that says you have to have models at all. If you didn't need to store anything, for instance, then you could use the controllers and the views to serve HTML.
[04:44:48] creature: And you could still do all kinds of processing in the controller, like if you were building a quiz or something (and didn't want to store the answers). There are simpler ways of doing this, but you can do it in Rails if you want.
[04:45:15] creature: And similarly, if you wanted your controller to make an API call to some external service, you can do that. If you wanted it to run some arbitrary Ruby code, you can make it do that too.
[04:46:24] creature: So you could, for instance, create an `app/services/quiz_service.rb` that talked to some microservice that picked questions, and have something along the lines of `quiz_service = QuizService.new; @questions = quiz_service.questions_for(user, 5)` in your controller.
[04:46:51] biox: good point, it reminds me of chef in a lot of ways in that you can do a lot of things that it's not necessarily designed for but still winds up being pretty good at - that way all teams can speak the same language anyway
[04:52:11] nahtnam: has joined #RubyOnRails
[04:53:31] biox: how long have you been using rails creature?
[04:54:03] dopie: has joined #RubyOnRails
[04:54:09] dopie: Hello all :)
[04:56:01] biox: dopie: hai!
[04:57:42] dopie: I have a question wth mina gem I have this setup in my deploy.rb but it keeps on asking me for my password when I enter sudo...
[04:57:44] dopie: https://gist.github.com/staycreativedesign/44118d1413daa4c469b200df1798cdff
[04:58:15] dopie: isn't ssh forwarding to forward my login credentials to mina?
[05:02:30] xall: has joined #RubyOnRails
[05:08:03] hndk: has joined #RubyOnRails
[05:08:04] irishfromua: has joined #RubyOnRails
[05:12:16] kevinem: has joined #RubyOnRails
[05:14:13] kevinem: I'm using postgres array feature for an attribute in a rails 5 project
[05:14:19] kevinem: as described in http://blog.arkency.com/2014/10/how-to-start-using-arrays-in-rails-with-postgresql/
[05:15:20] kevinem: Suppose the attribute is favourite_teams, how to i validate :favourite_teams array so that it contains only known values
[05:15:49] kevinem: validates_inclusion_of :favourite_teams, :in => %w(Team1 Team2 Team3), presence: true, array: true#:allow_nil => true
[05:15:52] kevinem: Doesn't work
[05:16:58] kevinem: has joined #RubyOnRails
[05:20:10] dopie: https://gist.github.com/staycreativedesign/fce74c5aa08a37c14ef81643e12a865a
[05:20:47] xall: has joined #RubyOnRails
[05:24:53] xall_: has joined #RubyOnRails
[05:27:21] dopie: has left #RubyOnRails: ("Leaving")
[05:33:40] roamingdog: has joined #RubyOnRails
[05:34:30] roamingdog: has joined #RubyOnRails
[05:35:15] roamingdog: has joined #RubyOnRails
[05:36:08] roamingdog: has joined #RubyOnRails
[05:36:53] roamingdog: has joined #RubyOnRails
[05:37:05] xall: has joined #RubyOnRails
[05:39:00] srinidhi: has joined #RubyOnRails
[05:47:11] p8m: has joined #RubyOnRails
[05:49:06] xall_: has joined #RubyOnRails
[05:49:58] xall: has joined #RubyOnRails
[05:50:36] MrCrackPotBuilde: has joined #RubyOnRails
[05:50:54] MrCrackPotBuilde: can i do a link_to and a image_tag together
[05:55:44] dminuoso: !goodmorning
[05:55:44] helpa: おはよう ございます
[05:56:05] dminuoso: Thank you helpa, very kind of you.
[05:56:47] dminuoso: MrCrackPotBuilde: Sure.
[05:57:12] dminuoso: kevinem: !didntwork
[05:57:12] helpa: kevinem: 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.
[05:57:28] MrCrackPotBuilde: would it be <%= link_to(image_tag("twitter.png"), www.twitter.com) %>
[05:58:11] MrCrackPotBuilde: or <%= image_tag(link_to("www.twitter.com"), twitter.png) %>
[05:58:44] dminuoso: MrCrackPotBuilde: The way to find out about such things is the API documentation.
[05:58:58] MrCrackPotBuilde: i did read but its a little confusing just starting out
[05:59:05] MrCrackPotBuilde: theres no <%= %>
[05:59:31] MrCrackPotBuilde: and searching the api i can only find image_tag and link_tag not both
[05:59:47] dminuoso: MrCrackPotBuilde: Why would you need a code example with <%= %> interpolation.
[05:59:56] dminuoso: Some day Im gonna club some people to death with a lead pipe.
[06:00:03] MrCrackPotBuilde: because im a weirdo like thazt
[06:00:08] dminuoso: Good luck then.
[06:00:30] dminuoso: You can either learn to use the API documentation, or keep on with that copy-and-paste style you are doing.
[06:00:38] dminuoso: I will only help you with one of these.
[06:00:47] MrCrackPotBuilde: id prefer learning
[06:00:52] MrCrackPotBuilde: copy paste does nothing
[06:01:18] dminuoso: MrCrackPotBuilde: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
[06:01:21] dminuoso: MrCrackPotBuilde: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag
[06:01:27] dminuoso: MrCrackPotBuilde: Now the question is, what do you want to do?
[06:02:01] dminuoso: Note that all <%= %> does is evaluate some code and put the output of the expression into the resulting HTML document.
[06:02:06] dminuoso: So you really don't need that.
[06:03:28] MrCrackPotBuilde: ah see the two links you sent i have open
[06:03:40] MrCrackPotBuilde: but what im confused with is whats the best practice of joining them together
[06:03:49] dminuoso: What does "joining them together" mean?
[06:04:00] dminuoso: MrCrackPotBuilde: What is your goal? Do you want to insert an image, or a link?
[06:04:01] MrCrackPotBuilde: is there a specific order so would image_tag come first or link_to
[06:04:09] dminuoso: That depends on what you want to achieve.
[06:04:26] dminuoso: You can either build a link to an image, or an image that doubles as a link.
[06:04:27] MrCrackPotBuilde: twitter logo that when i click sends to my twitter
[06:04:42] dminuoso: So it's a link first.
[06:04:53] dminuoso: And the body of that link is just an image.
[06:05:44] MrCrackPotBuilde: what is the difference between what you said here 14:04:27
[06:06:37] dminuoso: You could also have a link that says "Hello world", and when clicked will open an image.
[06:07:18] MrCrackPotBuilde: that i did already but using css
[06:07:23] patarr: has joined #RubyOnRails
[06:07:38] MrCrackPotBuilde: when you hover over the twitter icon it shows a preview of my account picture
[06:08:05] dminuoso: <a href="https://some/logo.png">Hello World</a> I meant
[06:08:07] MrCrackPotBuilde: i did that by just adding a class to the erb
[06:12:05] Pumukel: has joined #RubyOnRails
[06:12:20] xall_: has joined #RubyOnRails
[06:19:39] Lauer: has joined #RubyOnRails
[06:22:14] User458764: has joined #RubyOnRails
[06:24:54] sandstrom: has joined #RubyOnRails
[06:31:25] peterhil: has joined #RubyOnRails
[06:41:25] halogenandtoast: has joined #RubyOnRails
[06:42:14] halogenandtoast: With webpacker is there any way to get similar behavior to `expose window.MyClass` that I got with compiling with babel the "old way"
[06:43:02] halogenandtoast: from "sprockers-commoner"
[06:51:31] halogenandtoast: I think I can use expose-loader, but I'm not sure
[06:58:04] loveablelobster: has joined #RubyOnRails
[07:00:20] halogenandtoast: basically I just want to promote a class to the global namespace
[07:08:14] xall_: has joined #RubyOnRails
[07:08:52] navo: has joined #RubyOnRails
[07:11:30] halogenandtoast: has left #RubyOnRails: ()
[07:13:09] Pumukel: has joined #RubyOnRails
[07:16:36] spheric: has joined #RubyOnRails
[07:23:35] User458764: has joined #RubyOnRails
[07:33:42] sandstrom: has joined #RubyOnRails
[07:44:53] Pumukel: has joined #RubyOnRails
[07:48:57] kevinem: “favourite_teams”: [
[07:48:58] kevinem: "is not included in the list"
[07:49:52] kevinem: dminuoso: this is what happens, even when I'm trying with Team1, Team2 or Team3
[07:50:28] blackmesa: has joined #RubyOnRails
[07:50:35] jscheel: has joined #RubyOnRails
[07:50:42] dminuoso: Wanna hilight me again?
[07:50:47] dminuoso: Just to be sure you really caught my attention?
[07:51:18] kevinem: I'm sorry, I was not sure I highlighted you. New to this IRC client.
[07:51:34] dminuoso: kevinem: So start again. This time with a gist of a) your code that has been reduced to a testcase, b) some gist demonstrating the observed output, and then some that describes what you intended.
[07:56:20] kevinem: dminuoso: https://gist.github.com/kevin-madhu/6bbef13f6e05224873a49bf2d91e9fdf
[07:57:29] dminuoso: kevinem: Write a custom validation method.
[07:57:31] helpa: Next question, please!
[07:58:19] kevinem: Okay, Nothing more from me :P
[07:58:35] xco: has joined #RubyOnRails
[07:58:48] dminuoso: kevinem: Just as a hint, Array#| and Array#& will be your best friends.
[07:58:56] dminuoso: I named both for completions sake.
[07:59:17] kevinem: Thanks (y)
[07:59:20] User458764: has joined #RubyOnRails
[08:00:21] kevinem: I think that'll solve my issue. I was thinking some configuration to validates_inclusion_of can do it.
[08:00:51] kevinem: Will get back if I have anymore questions.
[08:08:11] patarr: has joined #RubyOnRails
[08:09:04] Cork: is there a date/time helper to check if "today" is a leap day?
[08:09:17] xco: has left #RubyOnRails: ()
[08:11:49] shilon: has joined #RubyOnRails
[08:15:30] tbuehlmann: Cork: Date.today.leap?
[08:15:57] Cork: ah, sweet, perfect thx
[08:32:42] antib: has joined #RubyOnRails
[08:40:50] arup_r: has joined #RubyOnRails
[08:47:32] User458764: has joined #RubyOnRails
[08:50:50] lxsameer: has joined #RubyOnRails
[08:51:36] xall_: has joined #RubyOnRails
[08:53:00] jlebrech: has joined #RubyOnRails
[08:53:14] jlebrech: anyone use webpacker with templates?
[09:05:26] arup_r: still looking for an opportunity to work with Webpack and new Rails :)
[09:07:14] arBmind: has joined #RubyOnRails
[09:08:38] quirkycoders: has joined #RubyOnRails
[09:09:37] jlebrech: i managed to get it to pack my angular code but can't get it to handle my templates
[09:13:24] marr: has joined #RubyOnRails
[09:16:19] k13nox: has joined #RubyOnRails
[09:18:51] bronson: has joined #RubyOnRails
[09:19:27] dminuoso: arathald: No you are not.
[09:19:40] dminuoso: webpack is best kept separate from rails imo.
[09:20:23] pwnd_nsfw: Probably not a bad idea for a POC
[09:20:34] pwnd_nsfw: to use webpack with rails
[09:20:45] arup_r: has joined #RubyOnRails
[09:22:01] dminuoso: pwnd_nsfw: Probably yeah.
[09:25:35] itarato: has joined #RubyOnRails
[09:26:31] jlebrech: i might just put my angular view templates in rails views, they I can use some erb in there.
[09:28:18] deur-_: has joined #RubyOnRails
[09:39:52] roamingdog: has joined #RubyOnRails
[09:45:54] dminuoso: pwnd_nsfw: But for scalability they should really be cleanly separated.
[09:46:13] dminuoso: I tried out the mixed approach for a couple months and it backfired badly as I tried to glue my react components in between static views.
[09:46:16] dminuoso: It blew up in my face.
[09:47:23] jlebrech: how does static and js blow up? :)
[09:48:01] jlebrech: because i'd like the templates to have stuff prerender on request to reduct xhr requests
[09:48:46] jlebrech: if I move my angular templates into views i'd need a controller?
[09:49:43] dminuoso: jlebrech: I dont mind server side rendering, but that's nothing Rails should be concerned about.
[09:50:21] jlebrech: i think I could have a lot less angularjs just by adding a little bit of rails to the mix
[09:51:13] dminuoso: jlebrech: I thought about it the same way. The problem is that switching between static and dynamic portions incurs some hefty penalties because the framework has to be reinitialized every time.
[09:51:15] jlebrech: i think this is what I need, https://github.com/pitr/angular-rails-templates but webpacker should be able to do this with a proper config
[09:51:26] dminuoso: And it gets super annoying because it forces you to dump and restore application state.
[09:51:38] dminuoso: And turbolinks will shoot you in your back.
[09:52:18] jlebrech: so, no erb in the angular templates +1
[09:52:31] dminuoso: Another problem is things like authentication suddenly become really hard to do.
[09:52:50] dminuoso: Because cookies are unfeasible, because your SPA portion cant look at them.
[09:53:05] jlebrech: but i'm thinking of ditching the angular router and just having pages and an agular app for each page. they I can rewrite any page without messing another part of the app
[09:53:29] dminuoso: jlebrech: Write it in full angular and have the rails just act as an API.
[09:53:38] dminuoso: It has a higher initial cost, but the advantages are limitless.
[09:53:53] jlebrech: i'm puttin my spa in rails so i can cut out my CORS code and use the same cookie :)
[09:54:23] jlebrech: dminuoso: yeah i'm doing this not, but have some dumb cors code for enable and api
[09:55:02] quirkycoders: has joined #RubyOnRails
[09:55:09] jlebrech: i'm thinking: one rails app to log into -> multiple angular pages that can use the cookie for the api.
[09:55:24] jlebrech: shouldn't be too complex at this point
[09:55:58] jlebrech: initially it'll keep the SPA just the same. but if i want to rewrite in something else webpacker should help me a lot.
[09:57:53] Ergo: has joined #RubyOnRails
[10:00:57] mahloun: has joined #RubyOnRails
[10:02:18] arup_r: has joined #RubyOnRails
[10:08:11] crst: has joined #RubyOnRails
[10:09:01] patarr: has joined #RubyOnRails
[10:09:08] crst: Hi can you write this https://pastebin.com/cERjYNyE without all the <% ... %> Like just having one <% at the top and %> at the last line?
[10:10:05] tetraktys: has joined #RubyOnRails
[10:12:36] ishahnaz: has joined #RubyOnRails
[10:14:36] jlebrech: crst: try yield content_tag(:ul, link_to ... but i'm not 100% sure
[10:16:53] manzo: has joined #RubyOnRails
[10:17:37] xall_: has joined #RubyOnRails
[10:19:10] bronson: has joined #RubyOnRails
[10:22:18] User458764: has joined #RubyOnRails
[10:28:38] conta: has joined #RubyOnRails
[10:33:34] arup_r: crst: it may work or need some tweak too https://gist.github.com/aruprakshit/00913dc36c0ffae8665bf47106a7437f :)
[10:36:59] scrooloose: has joined #RubyOnRails
[10:37:08] yaw: has joined #RubyOnRails
[10:40:44] gregf_: has joined #RubyOnRails
[10:45:59] blackmesa: has joined #RubyOnRails
[10:48:51] dionysus69: has joined #RubyOnRails
[10:55:43] User458764: has joined #RubyOnRails
[10:58:55] ferr: has joined #RubyOnRails
[11:06:58] patarr: has joined #RubyOnRails
[11:12:02] dionysus69: I have a project assigned and I wonder what's the proven way of formulating a project with a client, can anyone give me couple basic guidelines? what do I need to know and what do I ask a client?
[11:12:19] webdestroya: has joined #RubyOnRails
[11:14:07] ishahnaz: has joined #RubyOnRails
[11:20:10] bronson: has joined #RubyOnRails
[11:28:56] HoierM: has joined #RubyOnRails
[11:31:52] dminuoso: jlebrech: The problem is just that you begin to experience issues.
[11:32:06] romeoh: has joined #RubyOnRails
[11:32:08] dminuoso: jlebrech: Lets say you want login/role based routing. Now you are pretty much screwed.
[11:32:21] dminuoso: jlebrech: The more you try and fix things, the more you end up separating them.
[11:32:54] dminuoso: jlebrech: Another issue is this "two frameworks" logic has serious issues when it comes to design and i18n.
[11:33:10] arBmind: has joined #RubyOnRails
[11:33:25] jlebrech: yeah, i need to write so much more stuff when i18n comes along
[11:33:34] dminuoso: Because lets face it, bootstrap is getting old and it does not fit well into the concept of modern JS frameworks.
[11:33:50] jlebrech: guess it will have to be .erb to do i18n
[11:33:58] dminuoso: jlebrech: And your angular portion?
[11:34:27] jlebrech: those templates will have to be in erb :S
[11:34:34] wethu: has joined #RubyOnRails
[11:35:07] jlebrech: rails should have gone the volt-framework route
[11:35:42] dminuoso: jlebrech: Nothing stops you from using Opal.
[11:36:02] dminuoso: But honestly it's ugly hacks because you just avoid JavaScript (which is actually quite elegant if used correctly)
[11:36:07] jlebrech: sure, but in that case i'm just using opal instead of angular
[11:36:33] dminuoso: I just cant see the advantages of Opal
[11:36:46] jlebrech: the whole mvc needs to be reimagined now there are spas
[11:37:03] dminuoso: jlebrech: For a pure API backend its perfectly adequate
[11:37:09] jlebrech: it's more like MVCCMV
[11:37:12] dminuoso: And as a pure API backend it fits well into the scheme of SPA
[11:37:29] yaw: has joined #RubyOnRails
[11:37:32] dminuoso: (Because data and data-related business logic should really be separated from representation)
[11:38:18] jlebrech: that's fine, I think i'll have to make an angular-template-controller that puts i18n into the template
[11:38:39] dminuoso: jlebrech: I guess its a little different for me as a React dev.
[11:38:42] jlebrech: a rails controller to write the angular views
[11:39:12] dminuoso: Here my SPA is a separate webpack-only project, it does not know about Rails at all.
[11:39:19] jlebrech: dminuoso: too right, you can sprinkle a tiny bit of reacts and get immediate results
[11:39:34] dminuoso: jlebrech: Heh, sadly that is so misleading.
[11:39:50] dminuoso: I started out with the tutorial and after 30 minutes I was like "wait.. thats it?"
[11:41:06] jlebrech: it's does the same stuff as advanced jquery
[11:41:13] dminuoso: And then I had to learn about react-router, redux, react-redux, react-router-redux, redux-saga, immutable.js, babel, babel plugins, webpack configuration, flowtype, eslint, lodash...
[11:41:32] dminuoso: I mean in the end Im glad, but that tutorial really didn't prepare me for the scope of it.
[11:41:36] jlebrech: yeah, i'm using rails to rid myself of routers
[11:41:48] jlebrech: i already know that
[11:42:11] dminuoso: jlebrech: Oh Im actually happy with react-router, in particular because of how I can bolt asynchronously loaded components, reducers and sagas into it.
[11:42:23] dminuoso: Chunking for the win.
[11:48:02] jlebrech: think i might put the angular templates in erb so I can put i18n stuff in there later. I think with session I can also bypass some angularjs code that just places text somewhere. but then i'll get cache busting problems
[11:51:07] conta: has joined #RubyOnRails
[12:03:39] dionysus69: has joined #RubyOnRails
[12:05:09] dangerousdave: has joined #RubyOnRails
[12:05:35] crst_: has joined #RubyOnRails
[12:07:38] crst_: jlebrech: sorry, been busy. Not just that particular case, I mean that I want to write multiline code within <% ...and... %> like <?php ...code... ?> I don't like to write <% for each new line
[12:08:50] jlebrech: i think content_tag is the way to do it.
[12:10:33] randomswede: has joined #RubyOnRails
[12:11:59] randomswede: Im trying to 301 redirect a rails app to a new domain. Im using AWS Elastic Beanstalk with a load balancer. How do i do this in the best way? Is this something to be done on the application level, at the loadbalancer? Using Rack?
[12:13:01] armyriad: has joined #RubyOnRails
[12:14:19] ishahnaz: has joined #RubyOnRails
[12:15:21] arup_r: has joined #RubyOnRails
[12:23:38] Trynemjoel: has joined #RubyOnRails
[12:27:30] chouhoulis: has joined #RubyOnRails
[12:31:04] dangerousdave: has joined #RubyOnRails
[12:38:01] marr: has joined #RubyOnRails
[12:42:40] cek: has joined #RubyOnRails
[12:43:06] northfurr: has joined #RubyOnRails
[12:43:08] cek: any ideas on how to apply rails app config in activejob definition?
[12:44:26] tbuehlmann: cek: I don't understand. what are you trying to do?
[12:44:46] cek: configure rails environment, but for a job.
[12:46:37] randomswede: If i want to 301 redirect a ruby app to a new domain, whats the best way to do this? Is rack-rewrite gem a viable option? Or should i do this at the load balancer level?
[12:48:07] tbuehlmann: cek: I don't get it yet. do you have an example?
[12:48:53] cek: class TestJob < ApplicationJob; Rails.application.configure { config.some_setting = :blah }; end
[12:52:17] jlebrech: has joined #RubyOnRails
[12:53:54] pupsicle: randomswede: I'd do that at the webserver/loadbalancer level
[12:54:57] jphase: has joined #RubyOnRails
[12:55:04] dminuoso: tbuehlmann: Im back to normal!
[12:55:13] dminuoso: Been venting off some steam today already.
[12:55:15] dminuoso: In here in fact.
[12:55:48] dminuoso: randomswede: It depends. Is your project dockerized?
[12:55:56] arup_r: has joined #RubyOnRails
[12:56:30] dminuoso: randomswede: I would ensure that no matter how you do it, the redirect is bolted into your repository somehow (either because its in the docker container, or maybe your configuration management draws some partial configuration from some public/nginx folder or the like)
[12:58:39] tbuehlmann: cek: that is highly unusual, why do you want that? and what's the setting?
[12:58:46] tbuehlmann: dminuoso: I saw!
[12:59:55] cek: I just want to have a separate config for jobs. I guess I'll have to create another env setting.
[13:07:01] deur-: has joined #RubyOnRails
[13:07:58] Jameser: has joined #RubyOnRails
[13:09:34] conta: has joined #RubyOnRails
[13:11:18] waseem_: has joined #RubyOnRails
[13:12:05] dangerousdave: has joined #RubyOnRails
[13:21:00] bronson: has joined #RubyOnRails
[13:21:16] fmcgeough: has joined #RubyOnRails
[13:24:40] Ellimist: has joined #RubyOnRails
[13:27:13] jlebrech: webpack makes very small files :)
[13:27:35] ErhardtMundt: has joined #RubyOnRails
[13:30:04] conta: has joined #RubyOnRails
[13:34:24] DLSteve: has joined #RubyOnRails
[13:38:25] DLSteve: has joined #RubyOnRails
[13:46:38] patarr: has joined #RubyOnRails
[13:50:08] quirkycoders: has joined #RubyOnRails
[13:50:48] Jameser: has joined #RubyOnRails
[13:53:14] EXCHGR: has joined #RubyOnRails
[13:55:34] Pumukel: has joined #RubyOnRails
[13:59:43] ErhardtMundt: has joined #RubyOnRails
[14:02:05] dangerousdave: has joined #RubyOnRails
[14:05:28] chouhoulis: has joined #RubyOnRails
[14:05:57] crst_: jlebrech: man, I converted my whole project to slim just for being able making multi line comments
[14:06:30] jlebrech: crst_: slim is nice
[14:06:34] tbuehlmann: <% if false %>…<% end %> \o/
[14:07:11] jphase: has joined #RubyOnRails
[14:08:07] crst_: jlebrech: yeah, it's really nice working with but you can run into issues for it not being the standard language
[14:08:26] crst_: tbuehlmann: that sucks, actually :P
[14:09:13] tbuehlmann: actually that's pretty neat
[14:09:34] crst_: tbuehlmann: I find it so annoying :)
[14:10:26] theunraveler: has joined #RubyOnRails
[14:12:14] crst_: Another general question. How can you combine the two concatenated ruby codes?
[14:12:15] crst_: <title><%= data.website.title %><%= ' - ' + current_article.title unless current_article.nil? %></title>
[14:23:58] futilegames: has joined #RubyOnRails
[14:25:45] cek: reconnect: true not working, still saying mysql gone after mysqld restart
[14:26:23] lupine: crst_: extract to a helper method
[14:27:55] User458764: has joined #RubyOnRails
[14:28:37] crst_: lupine: Thanks. I don't want to complicate things, only have everything within one <%= ...combined... %> instead of two, if possible.
[14:28:59] Jameser: has joined #RubyOnRails
[14:33:07] lupine: yep, and you want that to look something like <%= combined_article_title(website, current_article) %>
[14:33:32] lupine: you want as little as possible inside erb blocks
[14:36:20] choke: has joined #RubyOnRails
[14:38:24] conta: has joined #RubyOnRails
[14:39:36] cek: has left #RubyOnRails: ()
[14:40:56] crst_: lupine: in that particular case it's probably better to just leave it as it is, I suppose. or would you write the helper for this?
[14:41:43] lupine: consider it an exercise for the reader
[14:43:40] creature: biox: Sorry I had to run off last night. To answer your question ~12 hours later: off and on for ~10 years, mostly focusing on it for ~4.
[14:51:03] ErhardtMundt: has joined #RubyOnRails
[14:52:08] Meow-J: has joined #RubyOnRails
[14:54:08] hobodave: has joined #RubyOnRails
[15:00:16] polishdub: has joined #RubyOnRails
[15:03:52] patarr1: has joined #RubyOnRails
[15:06:58] jfpoole: has joined #RubyOnRails
[15:08:25] rjungemann: has joined #RubyOnRails
[15:09:17] northfurr: has joined #RubyOnRails
[15:10:58] irishfromua: has joined #RubyOnRails
[15:16:14] Voxxit: has joined #RubyOnRails
[15:17:05] ErhardtMundt: has joined #RubyOnRails
[15:21:56] conta: has joined #RubyOnRails
[15:22:00] bronson: has joined #RubyOnRails
[15:28:13] imanc: has joined #RubyOnRails
[15:31:05] crankharder: given a string of css "body{display:none;}" -- how can I use Sass to compress/minify that string directly in ruby?
[15:39:26] gaucheph: has joined #RubyOnRails
[15:41:27] brent__: has joined #RubyOnRails
[15:43:38] Dbugger: has joined #RubyOnRails
[15:43:40] Dbugger: Hey everyone
[15:43:47] hobodave: has joined #RubyOnRails
[15:44:01] Dbugger: I have a small problem. I am deploying with capistrano to my server, but my css does not seem to be re compiling... Does anyone know what I can do??
[15:47:18] Voxxit: has joined #RubyOnRails
[15:47:59] iamdevnul: has joined #RubyOnRails
[15:48:59] patarr: has joined #RubyOnRails
[15:54:38] hobodave_: has joined #RubyOnRails
[15:54:55] mikecmpbll: has joined #RubyOnRails
[15:55:25] chouhoulis: has joined #RubyOnRails
[15:55:35] bronson: has joined #RubyOnRails
[15:57:30] mikecmpbll: this is driving me insane. why isn't the session cookie being set on the client from an ajax response with Set-Cookie header, with the default HttpOnly=true ?
[15:57:50] mikecmpbll: if i explicitly set httponly: false in my session_store initialisation, the problem is alleviated.
[15:59:09] mikecmpbll: i can't find _anything_ online that explicitly explains httponly stops the client writing a cookie for ajax
[16:01:20] blackmesa: has joined #RubyOnRails
[16:01:29] [Butch]: has joined #RubyOnRails
[16:04:03] AzaToth: has joined #RubyOnRails
[16:13:03] patarr: has joined #RubyOnRails
[16:14:29] Archrover: has joined #RubyOnRails
[16:15:05] tomasm-: has joined #RubyOnRails
[16:18:57] tomasm-: hey if I were to use something like wordpress for a marketing site for my rails app, how would those two generally get integrated? not sure whether to map everything under a folder to my app or have a separate subdomain (which may not work since I may have it work as universal subdomains)....
[16:21:07] xall_: has joined #RubyOnRails
[16:21:35] nickenchuggets: has joined #RubyOnRails
[16:26:47] bronson: has joined #RubyOnRails
[16:27:46] fernandomm: has joined #RubyOnRails
[16:29:17] gusrub: has joined #RubyOnRails
[16:34:03] zarubin: has joined #RubyOnRails
[16:39:52] cseder: has joined #RubyOnRails
[16:40:28] conta2: has joined #RubyOnRails
[16:42:00] hobodave: has joined #RubyOnRails
[17:00:05] jphase: has joined #RubyOnRails
[17:01:56] jphase_: has joined #RubyOnRails
[17:04:56] gusrub: has joined #RubyOnRails
[17:05:21] crst_: lupine: lol :D
[17:05:44] Fridtjof: has joined #RubyOnRails
[17:10:36] gusrub: has joined #RubyOnRails
[17:11:50] tycoon177: has joined #RubyOnRails
[17:14:29] joeyk: has joined #RubyOnRails
[17:15:06] northfurr: has joined #RubyOnRails
[17:16:20] joeyk: so, I have prod database that's oracle and requires table[:field], but a development/test database that's mysql that seems to require table[:FIELD]. Is there a clean way to set it such that rails uses uppercase or lowercase field names?
[17:20:09] User458764: has joined #RubyOnRails
[17:20:11] am55: I'm working through Metz-Object Oriented Programming, and I keep wondering how things like SRP, inheritance, classes only talking to immediate neighbors--basically everything--relates to database normalization. I keep reading Class as Table because thus far that's how I'm working. That's my vague question, any hints appreciated.
[17:23:15] jphase: has joined #RubyOnRails
[17:27:23] baweaver: They don't 1 to 1 map to eachother
[17:31:42] quirkycoders: has joined #RubyOnRails
[17:37:31] srinidhi: has joined #RubyOnRails
[17:39:15] robnester: question: Does anyone here have experience with uploading files to a rest API?
[17:39:30] robnester: trying to figure out how best to do so.
[17:39:57] baweaver: https://github.com/thoughtbot/paperclip
[17:41:56] robnester: baweaver: is it possible to upload without using a form for paperclip?
[17:42:21] baweaver: I'd have to look into it though
[17:43:15] robnester: basically I don't want to store the model or the attachment, but would rather work in cache instead... I'm trying out the rails 5 api mode, so no forms :/
[17:44:07] robnester: trying to base64 encode the file produces a size that outstrips the header length :/
[17:44:31] baweaver: https://www.pluralsight.com/guides/ruby-ruby-on-rails/handling-file-upload-using-ruby-on-rails-5-api
[17:45:29] robnester: baweaver: yeah, i was reading that earlier, but the issue I run into is that some of the json files are 5mb+ and base64 encoding them results in larger than allowed headers :/
[17:47:11] quirkycoders: has joined #RubyOnRails
[17:47:24] Fridtjof: has joined #RubyOnRails
[17:48:09] baweaver: Then why not post them in body?
[17:48:23] baweaver: JSON you can just send as form data in the body
[17:48:46] robnester: i'll look at that...
[17:53:05] crst: has joined #RubyOnRails
[17:57:00] defsdoor: has joined #RubyOnRails
[18:07:44] rkellermeyer: has joined #RubyOnRails
[18:11:34] machty: has joined #RubyOnRails
[18:13:17] cseder: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[18:15:56] tlarevo: has joined #RubyOnRails
[18:24:26] Lloyd: has joined #RubyOnRails
[18:34:42] netzfisch: has joined #RubyOnRails
[18:35:21] tercenya: has joined #RubyOnRails
[18:41:44] gheegh: has joined #RubyOnRails
[18:42:40] bronson: has joined #RubyOnRails
[18:43:44] gheegh: Hey all.. question. I'm running a rails 5.1 app and i have written many of my jobs with ActiveJob. how do I get the jobs to run inline? They don't seem to want to do that.. They seem to be running async.. (or both at the same time).. concurrently..
[18:48:14] hobodave: has joined #RubyOnRails
[18:56:31] auv: has joined #RubyOnRails
[18:59:56] Fridtjof: has joined #RubyOnRails
[19:09:47] lxsameer: has joined #RubyOnRails
[19:10:58] gheegh: so, to ask my thing a different way.. is there a way in ActiveJob to access the jobs and control running them in Rspec?
[19:11:09] tlarevo: has left #RubyOnRails: ()
[19:13:26] gheegh: in my old version of a haccked up Resque, i could pop and run X jobs off the queue.. and do it in my tests so I could control just what got run in testing..
[19:13:57] tbuehlmann: there's a matcher for jobs, see https://relishapp.com/rspec/rspec-rails/v/3-6/docs/matchers/have-enqueued-job-matcher
[19:14:05] gheegh: testing inline isn't working.. as it does a VERY weird "wrapping" where a job that queues another job, the job that is created in teh middle gets run, before the first job completes.
[19:14:22] tbuehlmann: ah, so you just want to run jobs inline?
[19:14:24] gheegh: its not about the testing.. its about how the jobs are running..
[19:14:26] Pumukel: has joined #RubyOnRails
[19:14:40] gheegh: no, inline seems to run a job "inside" another job.. if one job creates another one
[19:15:16] gheegh: for example, this is my output: each perform has 1 line of working code.. and a Before and after for that code..
[19:15:44] tbuehlmann: well, that's expected behaviour, right? I'd expect the inner job to be called inside the outer job
[19:17:13] gheegh: yeah, but it seems to do it before the work in the perform is done. .
[19:17:16] gheegh: https://gist.github.com/wflanagan/9177dc491fbbc8a83aa9f1f71f8debb9
[19:17:26] gheegh: let me tee up a gist with code.
[19:19:42] ishahnaz: has joined #RubyOnRails
[19:21:58] Fridtjof: has joined #RubyOnRails
[19:24:06] arup_r: has joined #RubyOnRails
[19:27:27] gheegh: https://gist.github.com/wflanagan/b160632e3c7fd0e23f7a9cbe1aa94c60
[19:28:12] gheegh: so, the net is that it seems it might be an issue with the Cequel gem. in an after_create callback, i queue the job, and it performs it inline
[19:28:41] gheegh: at this point, when any job tries to perform the work, it can't find the event in cassandra..
[19:28:55] gheegh: but after the "after_create" completes, the record is findable.
[19:29:25] srinidhi: has joined #RubyOnRails
[19:29:36] tbuehlmann: I've no idea what cequel does, but might there be an after_commit equivalent?
[19:36:06] gheegh: nope.. after_create, but not after_commit.. and it seems to not return a valid record until these complete..
[19:37:30] cagomez: has joined #RubyOnRails
[19:37:32] tbuehlmann: I can't help then, sorry
[19:37:52] gheegh: yep.. its only relevant in a test world
[19:38:33] northfurr: has joined #RubyOnRails
[19:42:24] bronson: has joined #RubyOnRails
[19:46:40] sandstrom: has joined #RubyOnRails
[19:50:35] cagomez: has joined #RubyOnRails
[19:54:14] patarr: What is the best rails configuration gem? Something that would support mult-environment, host-overrides, and even perhaps live changes?
[19:56:08] fryguy: patarr: consider dotenv
[20:05:01] nickenchuggets: I'm trying to configure rack-attack, is this the correct way to write config/initializers/rack-attack.rb?
[20:05:02] nickenchuggets: https://hastebin.com/owacesucen.rb
[20:05:51] ishahnaz: has joined #RubyOnRails
[20:09:25] brkkyk: has joined #RubyOnRails
[20:09:31] brkkyk: hello everyone
[20:10:02] brkkyk: how actioncable act like under pressure?
[20:11:51] netzfisch: has joined #RubyOnRails
[20:11:54] hobodave: has joined #RubyOnRails
[20:15:56] brkkyk: any thought??
[20:16:01] gthank: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[20:19:44] dionysus69: has joined #RubyOnRails
[20:21:09] gusrub: has joined #RubyOnRails
[20:22:47] arup_r: brkkyk: read the bad parts https://blog.ably.io/rails-5-actioncable-the-good-and-bad-parts-1b56c3b31404 :)
[20:24:00] brkkyk: i've read this article before but the point is this articles writed quite days ago
[20:24:15] kallisti5: <spam>If you're interested in keeping Net Neutrality (ISP's Under FCC Title II) to ensure they can't selectively charge you more for services like NetFlix and YouTube, please fill in a comment at http://gofccyourself.com . It only takes a few seconds. Thanks! </spam>
[20:24:39] brkkyk: so i'm curious about as version rails 5.1, actioncable is still bad?
[20:26:03] northfurr: has joined #RubyOnRails
[20:26:11] dps: has joined #RubyOnRails
[20:28:39] arup_r: the things he said as bad, still exist.
[20:29:55] cagomez: has joined #RubyOnRails
[20:34:11] username1: has joined #RubyOnRails
[20:39:49] manzo: has joined #RubyOnRails
[20:43:46] sagax: has joined #RubyOnRails
[21:08:20] patarr: Is find_in_batches broken in Rails 5... It tries ordering by empty string...
[21:13:18] duderonomy: has joined #RubyOnRails
[21:14:08] patarr: How does Rails know what the PK of a model is?
[21:14:56] patarr: ACTION just gives up and accepts the futility
[21:24:09] Pumukel: has joined #RubyOnRails
[21:29:21] northfurr: has joined #RubyOnRails
[21:30:31] brent__: has joined #RubyOnRails
[21:41:04] ResidentBiscuit: has joined #RubyOnRails
[21:41:29] ResidentBiscuit: has joined #RubyOnRails
[21:41:54] ResidentBiscuit: has joined #RubyOnRails
[21:42:19] ResidentBiscuit: has joined #RubyOnRails
[21:43:35] bronson: has joined #RubyOnRails
[21:46:05] dps: has joined #RubyOnRails
[21:48:48] northfurr: has joined #RubyOnRails
[21:50:08] roamingdog: has joined #RubyOnRails
[22:00:52] cagomez: has joined #RubyOnRails
[22:00:58] cagomez: has joined #RubyOnRails
[22:02:20] dps: has joined #RubyOnRails
[22:03:47] roamingdog: has joined #RubyOnRails
[22:05:50] cagomez: has joined #RubyOnRails
[22:13:05] ResidentBiscuit: has joined #RubyOnRails
[22:15:21] lxsameer: has joined #RubyOnRails
[22:20:30] gaucheph: has joined #RubyOnRails
[22:24:39] Pumukel: has joined #RubyOnRails
[22:32:12] Radar: GOOD MORNING
[22:32:30] francuz: good morning wherever you live
[22:32:47] cagomez: has joined #RubyOnRails
[22:33:02] Radar: patarr: steps to reproduce please.
[22:34:28] michael_mbp: I'm curious as to how Rails internally handles a file-upload
[22:34:46] michael_mbp: is there any default middleware that handles this?
[22:35:57] northfurr: has joined #RubyOnRails
[22:37:00] quirkycoders: has joined #RubyOnRails
[22:42:46] mikecmpbll: has joined #RubyOnRails
[22:43:54] lupine: carrierwave is popular
[22:45:32] ishahnaz: has joined #RubyOnRails
[22:51:22] francuz: do you know of any https://www.skipper18.com/ equivalent for rails ? if not, do you think rails' user would be interested by a utilitie like it ? coworkers need it, so i'm thinking about something basic if nothing exists already,
[22:52:03] lupine: well, the idea of rails is to not write them down at all
[22:55:01] francuz: you mean : because the generator does it for us? if yes : that's why I think it would be simple to write a gui to do this kind of things, as the generators are already great,
[22:56:35] francuz: (yet, some people are really not good at using even the simplest console commands, and almost everyone would have better vision in a gui than in schema.rb)
[23:03:24] brent__: has joined #RubyOnRails
[23:07:51] wethu: has joined #RubyOnRails
[23:25:37] Pumukel: has joined #RubyOnRails
[23:27:16] aajjbb: has joined #RubyOnRails
[23:29:08] patarr: has joined #RubyOnRails
[23:35:08] northfurr: has joined #RubyOnRails
[23:35:24] patarr: has joined #RubyOnRails
[23:44:42] bronson: has joined #RubyOnRails
[23:47:01] DLSteve: has joined #RubyOnRails
[23:52:42] patarr: has joined #RubyOnRails
[23:54:55] northfurr: has joined #RubyOnRails
[23:56:14] cagomez: has joined #RubyOnRails