#RubyOnRails - 05 September 2015
« Back 1 day Forward 1 day »
[01:19:02] pontiki: adam| and others: fyi: i am currently running the monthly rails newbie meeting here in minneapolis, minnesota.
[01:19:53] adam|: pontiki: cool! how's turnout been? I'm doing a "Your first 15 minutes of Ruby/Rails talk" to a bunch of polyglots a few weeks from now. Any suggestions?
[01:20:35] pontiki: we get btn 20-25 people, sometimes half that number have never even installed ruby
[01:24:44] pontiki: if you ever (and i am most assuredly not recommending this) watch an undubbed version of the movie "Fargo", that would be it
[01:26:37] pontiki: adam|: that absolute hardest part of your talk for me would be "the first 15 minutes". i don't know what i'd say at all
[01:31:44] adam|: pontiki: It's gonna be live coding. I'll likely flesh out first route, first controller, first model/migration, first view. With any luck, I'll have time to drop in some ruby. I dunno.
[01:47:57] Radar: adam|: I have since resolved to never ever ever publish another book with them ever EVER again :D
[07:28:10] arup_r: any body use here Mysql in Rails. I am not able to up the mysql server.. so seeking for a help
[07:57:06] arup_r: It was working 5 months back. After that I was using Postgresql.. Now I need again Mysql, and when I tried found these issues.
[08:00:23] sevenseacat: I don't know where it says you should run those commands, or why you think those commands should work
[08:00:47] sevenseacat: so right now I'll chalk it up to 'you making things up and being surprised when they don't work'
[08:01:29] arup_r: Ok. When I try to run the `mysql` and it gave me the error http://stackoverflow.com/questions/4448467/cant-connect-to-local-mysql-server-through-socket-var-lib-mysql-mysql-sock
[08:03:01] arup_r: Yes. I reached to the Gist from the error as SO shows .. That I encountered first
[08:06:00] sevenseacat: honestly, I dont care what SO says in this instance, because the error can be caused by so many different things. what makes you think that your server is down?
[08:06:59] arup_r: sevenseacat: https://gist.github.com/aruprakshit/d5d1a6b6e27b21609661#file-log-txt-L1
[08:47:23] arup_r: I am not able to drop my db using rake db:drop . https://gist.github.com/aruprakshit/6c049cc46bf59a94a656
[08:47:43] arup_r: I never saw such an error - "Mysql2::Error: Table './mysql/proc' is marked as crashed and should be repaired:"
[08:51:25] jhass: sqlite - the database for all your datatypes, even those that don't exist anywhere!
[08:52:45] chipotle: so i have mainly been a drupaler and it's pretty easy to get 50-75/hr C2C freelancing gigs (from a week long to 6 months). even remote will pay in that same range, although on the lower end. i want to learn ruby and RoR but how does the freelance market for ruby and RoR compare?
[09:03:44] strcmp1: yeah getting your foot in the door is always the hard part when you have no prior experience
[09:06:21] strcmp1: chipotle, without prior experience/recommendation it can be hard though. you might find something that can mix your drupal/PHP/wordpress(?) skills with ruby,i saw one exact job like that on weworkremotely a while ago actually. so i wouldnt worry too much.
[09:06:58] chipotle: when can i sufficiently say i am a jr ruby/ror dev so i can start looking for jobs?
[09:46:10] sevenseacat: just learn one thing at a time. it sounds like you have a roadmap to start with
[09:47:04] pontiki: you're on the right track, as long as you're applying what you're reading, not just reading
[09:47:19] strcmp1: idk if i agree that it is hard or not. it has concepts that can be hard to grasp, and it doesn't give any kind of crash course for those concepts (back when i learnt it).
[09:47:30] chipotle: i don't know how much time i should spend on ruby, js and sql each day (and i guess also css)
[09:47:58] pontiki: "hard" obviously means different things to different people. it's hard because there is a lot to learn, but it's not hard because the concepts of difficult to grasp
[09:49:16] strcmp1: i cant remember how i learnt rails, i know i learnt ruby first and was way more interested in that. rails felt like a breeze after that, just APIs, and learning wtf MVC is.
[09:50:52] pontiki: but after learning over 20-ish languages, a huge number of projects of all different sizes and kinds, picking up ruby and rails was not difficult at all *for me*.
[09:51:28] sevenseacat: I didn't find it difficult either, but I had many years of building full-stack MVC webapps in PHP beforehand
[09:51:29] pontiki: because i had most of that tree well covered already; coming at it where you're learning most of that tree, it looks hard
[09:52:21] strcmp1: i actually think the people who would find it hardest would be PHP programmers, because i imagine most arent familiar with any comp sci concepts and just wanted something quick+dirty+easy(PHP)
[09:54:04] strcmp1: when i learnt ruby/rails i wasnt familiar with anything but perl + weird sh hacks. i found rails to be too much, so i focused on ruby and came back. then it was easy.
[10:09:57] sevenseacat: if you want to do console.log("Hello world") then sure it's a really easy language
[10:13:17] chipotle: but i thought js is used to extend a RoR app? js is pretty common on webpages these days, it's like html5/css3 and js go together....
[10:13:42] pontiki: but i also have to say it sounds like you're spending a lot of time thinking about what to learn first, then second, then third
[10:14:41] pontiki: it might be just my learning style, but for me it's reading some basics and jumping in to try it out
[14:30:44] Papierkorb: Can I somehow make the authenticity token of rails be allowed to be used cross domain?
[15:10:32] jyraff: pontiki: i'm working on calendar app. It has events and every 'event' has start time. User receive notification about this event 15 minutes before start time. So, if user delete 'event', email notification should dequeue from sidekiq queue.
[15:13:47] pontiki: i have to say, i have no idea how to delete a single job that is already queued in sidekiq
[15:13:52] Cancerguy: So if you cant access params/session data in models, are you meant to make custom functions like new/create to pass those in?
[15:18:45] Cancerguy: pontiki, And where should I put the logic that, for example, determines if the logged_in user gets put into the seat1 or seat2 column?
[15:29:56] Cancerguy: pontiki, yeah I added the errors.add() after moving it to the model, but I have no access to current_user there
[15:32:23] pontiki: something about the thing seems off still -- you create a new match for every user?
[15:33:40] Cancerguy: True, however a user can just manually type in the link to host/join it's own game, for example
[15:37:44] Cancerguy: a POST request to /matches which is routed to match#create, and to join is send a post request to /join/:match_id
[15:38:26] pontiki: so you have two very distinct routes, and you know which of those users is the host and which is the other
[15:39:10] pontiki: so you really only need to validate that the match host is not the same as the match opponent
[15:42:01] Cancerguy: pontiki, So basically, set the match.opponent/host in the controller, and let the model validate it before saving?
[15:42:03] pontiki: in the join action, you check if the match is already full and respond appropriately
[16:46:49] pontiki: http://www.w3.org/2010/Talks/01-08-steven-ten-euro-computer/FortranCodingForm.png
[17:22:30] gambl0re: theres also a @recipe = Recipe.find(params[:id]) in the begenning of the function
[17:45:09] shapeshifter: Gemfile http://ix.io/kDL Capfile http://ix.io/kDM capistrano output when building assets http://lpaste.net/687490209570357248 and for example, all.css isn't getting served/built. If I look for it in current, this is all I find: http://lpaste.net/2083613541528502272
[18:03:29] shapeshifter: rhizome: well there are some things in public/assets, but not everything: http://lpaste.net/3139573067051696128
[18:07:17] gambl0re: but the redirect url in the url bar is http://localhost:3000/recipes/7?description=cool&title=alksdfjaslk%3Bdj
[18:08:21] shapeshifter: I don't quite understand how rails links to assets in general. If I just run rails server locally (dev env), for example, all.css is linked as ttp://localhost:3000/assets/spree/frontend/all.self-33fc4a513acb9a5f3fd4ba26b89c94184e5d028c4bd40eee6736d3ccfea5c140.css?body=1 while on the server (staging) when I access the main page, all.css is linked as https://www.example.org/stylesheets/spree/fronte
[18:08:43] rhizome: well, it seems you have something weird going on with @recipe in your update action
[18:10:04] gambl0re: there you go my friend...full controller. https://gist.github.com/anonymous/2285e859dd7f5fa14d92
[18:10:44] shapeshifter: so one is ./assets/spree/frontend/all... and the other is ./stylesheets/spree/frontend/all... Plus, in the spree deployment guide (https://guides.spreecommerce.com/developer/manual-ubuntu.html#setting-up-nginx) , they say that the nginx config should include location ~ ^/(system|assets|spree)/ to serve static files - *but* that doesn't even include ./stylesheets - so how would nginx even serve th
[18:11:33] shapeshifter: rhizome: I don't think so. In any case, I can run RAILS_ENV=staging bundle exec rake assets:precompile on the staging server in current and it has no effect. Same goes for bundle exec cap staging deploy:assets:precompile (it builds the stuff I linked previously, but not everything)
[18:23:56] shapeshifter: rhizome: I tried removing public/assets on the server and running RAILS_ENV=staging bundle exec rake assets:precompile - it compiled the same assets again (output: http://lpaste.net/140340). When you say to see if I checked in public/assets, you mean into git? The repo doesn't contain public/assets, rather public/spree/products/<bunch of numbers>. The files that are missing would be in app/assets
[18:29:35] shapeshifter: rhizome: To be honest I don't know. I followed the official install guide for spree best as possible (since it's outdated in several regards). If I run it locally (dev env) it seems to work fine. But if I deploy it, most assets aren't there.
[18:31:55] shapeshifter: rhizome: https://guides.spreecommerce.com/developer/manual-ubuntu.html but it's using capistrano 2 among other things.
[18:36:28] rhizome: shapeshifter: that's a deployment guide with some server stuff, nothing about applications themselves.
[18:37:32] maokomioko: Can someone tell me please how to properly display flash[:something] with cyrillic letters?
[18:37:40] rhizome: it assumes the application already exists and works. it's in the first sentence, "your Spree application."
[18:37:58] maokomioko: I'm getting "????????????????????????" despite using i18n. Already tried .encode('utf-8')
[18:38:24] shapeshifter: rhizome: it does work locally, as I said. I can run rails server and get a working spree application locally.
[18:47:46] rhizome: you need the asset pipeline to see all.css, which i'm assuming is your custom css. the standard way of doing this is to include it in application.css
[18:48:15] shapeshifter: rhizome: no, it's not a custom css. It's included in spree. In the repo, it's contained in ./vendor/assets/stylesheets/spree/frontend/all.css
[19:53:22] hydrozen: is there a way to convert an expression to either true or false without using the double negation?
[20:15:42] pwnd_nsfw: gambl0re, my suggestion is to never have to access the bootstrap stylesheet...
[20:16:55] slash_nick: that's right... you'd typically compile the bootstrap stylesheet, and later, if there's something you want to tweak, override it...
[20:17:59] pwnd_nsfw: And he messed up the syntax quite a bit. There was like... 10 lines there were like color: "##......."
[20:18:30] pwnd_nsfw: And it took a while because upload to heroku, it doesn't give you the line number in the specific file
[20:19:00] pwnd_nsfw: and I wasn't receiving any errors when doing it on my local machine... for whatever reason *shrugs*
[20:19:25] pwnd_nsfw: So, I was checking every file except that. I told him I like to load it from the cdn, and he changed his ways
[20:20:51] slash_nick: pwnd_nsfw: plus... if you need/want to upgrade bootstrap (bug fixed that affects you, major release), any overrides you've made are difficult to suss out
[20:22:08] pwnd_nsfw: and that was the only way to mkae it look the way he wanted. Or, rather, I didn't have the time to do it because I had a million other things to do
[20:22:53] pwnd_nsfw: I made some hacky fix for it in js, then next day client was like NAH DONT WANT THAT ANYMORE
[20:25:40] arup_r: I know a designer in our team, who put the error message code inside the <head> tag. And asked you have backend issue
[20:25:40] slash_nick: i lump look-and-feel, design, UX, UI all together... i'd expect someone writing css to have an understanding of html and js as well
[20:26:33] pwnd_nsfw: He's pretty good at responsive design, he just doesn't know jack about the developer end of it.
[20:27:59] pwnd_nsfw: I know he has it, he's just been swamped with design work. He found me in a bootcamp we were doing together. He initially asked me to take a look at someone's PHP site. Vietnamese company had wrote it initially
[20:30:43] pwnd_nsfw: It's terrible when a client doesn't really know what they want out of their business... And has you revise it every step of the way. If I was on hourly, I would've loved it. That's job security there, pretty much haha
[20:34:28] turbo_MaCk: you can still work on as intern... much better than being in client - whatever relationship
[20:47:08] slash_nick: show-source, exit, and exit-program represents the extent of my knowledge of pry
[21:52:39] mices: for development, it says (not in context of development but rather in production) that actionmailer allows the use of a remote mail server, so if i were to use that for development, how would i have the remote server (in my case a machine on my lan) forward the mail to my application which is on another machine on the lan
[22:06:08] bootstrappm: hey all. I generated a scaffold with `rails g scaffold company name:string country:references` kind of thing and app/views/companies/_form.html.slim has the field for country as a text_field ??? is that normal?
[22:18:02] VeryBewitching: bootstrappm: I use this https://github.com/mlitwiniuk/localized_country_select
[22:50:27] mices: if i build a mailer app to receive and parse mail i can test it without actually receiving mail?
[22:52:01] mices: if i use mailman in pop mode that would seemingly solve the problem in development but then after deployment i'd be gathering mail by pop on the same machine the mail server is running on
[23:03:49] mices: from reading the one page user guide to mailman it doesn't seem to give you all the mail object attributes that actionmailer does, with actionmail i get everything nice and neat email.body, email.subject, email.attachment ... where is all that in mailman?
[23:55:50] mices: so i can configure let's says popa3d to send mail to a user to a database instead of waiting for the user to gather it?
[23:57:49] mices: emails sent to my address are put into a database with columns for each email field to,from,subject,body,attachments