« Back to channel list

#RubyOnRails - 26 May 2018

« Back 1 day Forward 1 day »
[00:14:10] darkhanb: has joined #RubyOnRails
[00:15:59] apeiros: render the text as svg "painting instructions". it'll be huge, tho.
[00:16:20] mroutis: has joined #RubyOnRails
[00:16:45] apeiros: (I'm only half serious - I hate it when pages pull shit like this)
[00:34:05] Ericx2x: has joined #RubyOnRails
[00:36:00] orbyt_: has joined #RubyOnRails
[00:40:29] mices: has joined #RubyOnRails
[00:40:51] mices: how do i make locale "en" only available in development
[00:43:09] mices: i see, "available_locales"
[00:44:20] jane_booty_doe: has joined #RubyOnRails
[00:44:26] jane_booty_doe2: has joined #RubyOnRails
[00:52:25] atrius: has joined #RubyOnRails
[01:01:35] CuriousMind: has joined #RubyOnRails
[01:02:03] CuriousMind: Hi. What `local: true` means for the `form_with` method?
[01:02:23] CuriousMind: I referred to this doc (http://api.rubyonrails.org/v5.1/classes/ActionView/Helpers/FormHelper.html#method-i-form_with) which says `:local - By default form submits are remote and unobstrusive XHRs. Disable remote submits with local: true.`
[01:02:52] CuriousMind: I didn't understand what XHR was so I researched that. After doing all this, I think `local: true` means that when the form is submitted it won't create a XmlHttpRequest. Am I correct?
[01:04:45] CuriousMind: jtperreault: Ok thank you
[01:05:06] jtperreault: CuriousMind: you're welcome
[01:08:53] Ericx2x: has joined #RubyOnRails
[01:14:25] Technodrome: has joined #RubyOnRails
[01:16:04] tdy: has joined #RubyOnRails
[01:20:43] atrius: has joined #RubyOnRails
[01:22:06] darkhanb: has joined #RubyOnRails
[01:37:38] fragamus: has joined #RubyOnRails
[01:56:03] ur5us: has joined #RubyOnRails
[02:22:30] apeiros: has joined #RubyOnRails
[02:22:35] big_reggie: has joined #RubyOnRails
[02:23:20] big_reggie: using react app + rails JSON API for SPA
[02:23:58] big_reggie: better to use webpack-dev-server or have rails take care of the initial routing for the entry point?
[02:35:04] kapil___: has joined #RubyOnRails
[02:42:29] fragamus: has joined #RubyOnRails
[02:50:17] Technodrome: has joined #RubyOnRails
[02:57:56] big_reggie: anyone played around with devise_token_auth?
[02:58:12] big_reggie: im not sure i see the benefit over just regular cookies since it uses sessions anyways..
[02:58:41] big_reggie: it says it uses tokens but it seems like its just a glorified cookie at the end of the day, not really a token
[03:13:03] nickjj_: has joined #RubyOnRails
[03:14:06] braincrash: has joined #RubyOnRails
[03:15:09] Dimik: has joined #RubyOnRails
[03:24:05] ur5us: has joined #RubyOnRails
[03:50:19] duderonomy: has joined #RubyOnRails
[03:51:36] CuriousMind: has joined #RubyOnRails
[03:53:41] dbugger_: has joined #RubyOnRails
[04:07:03] tacoboy: has joined #RubyOnRails
[04:16:10] mtkd: has joined #RubyOnRails
[04:26:47] CuriousMind: Is there a command will return form helpers?
[05:05:27] chouhoulis: has joined #RubyOnRails
[05:28:02] conta: has joined #RubyOnRails
[05:42:36] duderonomy: has joined #RubyOnRails
[05:49:20] Saukk: has joined #RubyOnRails
[06:09:29] conta: has joined #RubyOnRails
[06:20:38] JZA: has joined #RubyOnRails
[06:21:02] JZA: hi I got an issue, most of the tutorials talk about new projects, what happened if I want to import a project I took from github for example
[06:23:42] nickenchuggets: has joined #RubyOnRails
[06:25:30] reber: has joined #RubyOnRails
[06:27:16] blackcross_: has joined #RubyOnRails
[06:49:07] kapil___: has joined #RubyOnRails
[06:53:39] xuyuheng: has joined #RubyOnRails
[07:23:14] conta: has joined #RubyOnRails
[07:23:57] jrm: has joined #RubyOnRails
[07:25:10] mtkd: has joined #RubyOnRails
[07:26:21] reber: has left #RubyOnRails: ("Leaving")
[07:29:28] reber: has joined #RubyOnRails
[07:32:41] psychoslave: has joined #RubyOnRails
[07:39:10] mtkd: has joined #RubyOnRails
[07:40:52] LightStalker: has joined #RubyOnRails
[08:06:03] mtkd: has joined #RubyOnRails
[08:16:36] marr: has joined #RubyOnRails
[08:21:24] srinidhi: has joined #RubyOnRails
[08:27:07] srinidhi: has joined #RubyOnRails
[08:42:29] apparition: has joined #RubyOnRails
[08:52:35] tbuehlmann: JZA: what's the issue?
[08:53:15] JZA: well most tutorials create new projects but what happened when I want to get the running project from github
[08:53:46] JZA: also I reboot and seems that it complains about not finding the right version of rubby, I am on arch using ruby 2.5
[08:53:52] JZA: but rvm wants 2.3.1
[08:54:05] tbuehlmann: best case: you clone the repository, cd into it and run `bin/setup` followed by `bin/rails server`
[08:54:36] tbuehlmann: if the application requires a certain version of ruby, you should install that version
[08:57:12] JZA: humm I dont see setup
[08:57:33] JZA: bundle rails rake spring
[08:57:37] JZA: on bin/
[08:57:52] tbuehlmann: have a link to the repo?
[08:58:15] JZA: https://github.com/SmartCash/SmartCash-Voting
[08:59:51] tbuehlmann: right, then just go with `bundle install`, `bin/rake db:setup` and `bin/rails server`
[09:00:25] tbuehlmann: bundle install installs the gem dependencies for the application, bin/rake db:setup creates the database, migrates and seeds it. bin/rails server starts the server
[09:00:34] tbuehlmann: or just go with the docker instructions from the readme, if you're into that
[09:00:47] mtkd: has joined #RubyOnRails
[09:01:44] xuyuheng: has joined #RubyOnRails
[09:07:58] apeiros: has joined #RubyOnRails
[09:08:24] xuyuheng: has joined #RubyOnRails
[09:13:59] JZA: Your Ruby version is 2.5.1, but your Gemfile specified 2.3.1
[09:14:07] JZA: maybe I need to get the rvm first up
[09:15:39] JZA: $ rvm install ruby-2.3.1 ?
[09:18:08] tbuehlmann: are you using rvm?
[09:20:37] roshanavand: has joined #RubyOnRails
[09:24:38] JZA: [jza@kudu bin]$ ./bundle install
[09:24:39] JZA: /home/jza/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
[09:24:41] JZA: from /home/jza/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:259:in `bin_path'
[09:24:42] JZA: from ./bundle:3:in `<main>'
[09:26:46] tbuehlmann: great, just install the bundler gem: gem install bundler
[09:32:08] apeiros: has joined #RubyOnRails
[09:32:38] JZA: https://pastebin.mozilla.org/9086360
[09:33:13] tbuehlmann: what OS are you on?
[09:33:15] lxsameer: has joined #RubyOnRails
[09:33:20] JZA: archlinux
[09:34:17] tbuehlmann: google told me you can try `pacman -S postgresql-libs` for that
[09:35:38] kapil___: has joined #RubyOnRails
[09:39:02] xuyuheng: has joined #RubyOnRails
[09:39:47] duderono_: has joined #RubyOnRails
[09:40:41] JZA: ok will try again
[09:41:40] JZA: https://pastebin.mozilla.org/9086362
[09:42:31] JZA: somehere in puma navie extension
[09:45:32] xuyuheng: has joined #RubyOnRails
[09:50:14] tbuehlmann: phew, no idea. you could try running `bundle update puma`
[09:53:02] JZA: I was able to install other puma versions but didnt work when I re-try bundle install
[09:53:14] JZA: https://bbs.archlinux.org/viewtopic.php?pid=1752455#p1752455
[09:54:53] crankharder: has joined #RubyOnRails
[09:57:12] belluzj: has joined #RubyOnRails
[09:57:28] tbuehlmann: think I can't help here
[10:00:49] tbuehlmann: JZA: oh, pg is only used for production
[10:01:02] yottanami: has joined #RubyOnRails
[10:01:09] tbuehlmann: you should be able to just comment https://github.com/SmartCash/SmartCash-Voting/blob/891b74dd111245816c5fc2da216a6a0b5d444661/Gemfile#L11 and run bundle install
[10:07:14] yottanami: I am trying to authenticate user by text message, using `active_model_otp` gem now I want know is it safe to put user id in cookie to remember login?
[10:14:04] Fernando-Basso: has joined #RubyOnRails
[10:14:31] conta: has joined #RubyOnRails
[10:16:54] xuyuheng: has joined #RubyOnRails
[10:32:49] yottanami: has joined #RubyOnRails
[10:37:23] xuyuheng: has joined #RubyOnRails
[10:40:16] tbuehlmann: yottanami: that works, but remember that a user could simply copy and paste a cookie, so a replay attack is possible
[10:46:35] yottanami: tbuehlmann, What about create a hash for each user and put it in database? and use it as user token?
[10:48:05] tbuehlmann: unless that token changes, it'd be same story: the user could copy the cookie and use it later
[10:48:49] yottanami: tbuehlmann, So how can I make it secure?
[10:49:26] tbuehlmann: not only remember the user id but also the date the session was created, so you can expire it
[10:50:41] yottanami: tbuehlmann, even if the expire time is long? for example more than 30 days?
[10:51:12] tbuehlmann: if you don't have some kind of expiration in place, a cookie is reusable
[10:53:28] tbuehlmann: also, make sure the cookie is encrypted so a user can't tamper with it
[10:54:14] yottanami: tbuehlmann, Should I use an specific encryption method?
[10:54:43] tbuehlmann: if you use the cookie session store, you just have to use the #session helper method
[10:55:03] yottanami: tbuehlmann, and how check it when it is encrypted and is not encoded? how figure out the user id?
[10:55:29] tbuehlmann: rails will decrypt it for you, you just use #session like a hash
[10:57:10] yottanami: tbuehlmann, Sorry, I can not understand what do you mean by #session? do you mean using ActionDispatch::Session::CookieStore ?
[10:57:30] yottanami: tbuehlmann, Is it diffrent from cookie['']
[10:57:44] xuyuheng: has joined #RubyOnRails
[10:58:04] tbuehlmann: just use the cookie session store and instead of cookie[] use session[]
[10:58:14] tbuehlmann: I think that's the most simple solution
[10:59:11] yottanami: tbuehlmann, As I know session will save on server and I can not use it for long term, is it right?
[10:59:35] tbuehlmann: when using the cookie session store, the session is saved in the cookie and not on your server
[11:03:27] yottanami: tbuehlmann, So if it will encrypt it automatically and has a expire date by default should I just set session[user.id]
[11:03:33] yottanami: Am I right?
[11:04:21] tbuehlmann: it doesn't expire per default, so you should also save the creation date
[11:07:20] mtkd: has joined #RubyOnRails
[11:07:57] tbuehlmann: I mean, the cookie could, but that doesn't mean a user couldn't just save and reuse the cookie
[11:08:00] yottanami: tbuehlmann, In this tutorial I can not understand why it used cookie https://github.com/lvnilesh/rails-tutorial-markdown/blob/master/8-sign-in-sign-out.md#821-remember-me
[11:13:29] yottanami: has joined #RubyOnRails
[11:15:06] yottanami: tbuehlmann, You mentioned I can handle `remember me` by using session but it that example mentioned that if need to remember password you should use cookie['']
[11:18:02] xuyuheng: has joined #RubyOnRails
[11:20:26] jottr: has joined #RubyOnRails
[11:23:39] tbuehlmann: "remember me" is a different feature
[11:25:36] xuyuheng: has joined #RubyOnRails
[11:26:11] ur5us: has joined #RubyOnRails
[11:26:45] yottanami: tbuehlmann, What is the different when session can store for long time?
[11:29:26] tbuehlmann: I'm not sure the articles uses remember_me as the real remember me feature or the simple "let's remember the id"
[11:29:33] tbuehlmann: what's the problem right now?
[11:38:45] Saukk: has joined #RubyOnRails
[11:44:06] yottanami: has joined #RubyOnRails
[11:46:07] ellcs: has joined #RubyOnRails
[11:49:16] mtkd: has joined #RubyOnRails
[11:56:47] jottr: has joined #RubyOnRails
[11:57:34] wethu: has joined #RubyOnRails
[12:06:30] mroutis: has joined #RubyOnRails
[12:07:49] johndunn: has joined #RubyOnRails
[12:10:43] xuyuheng: has joined #RubyOnRails
[12:19:46] Puffball: has joined #RubyOnRails
[12:23:05] duderonomy: has joined #RubyOnRails
[12:23:41] mtkd: has joined #RubyOnRails
[12:31:09] xuyuheng: has joined #RubyOnRails
[12:37:01] Saukk: has joined #RubyOnRails
[12:38:26] jarnalyrkar: has joined #RubyOnRails
[12:43:07] xuyuheng: has joined #RubyOnRails
[12:44:53] jarnalyrkar: has joined #RubyOnRails
[12:45:09] johndunn: has left #RubyOnRails: ()
[12:45:26] roshanavand: has joined #RubyOnRails
[12:49:09] CuriousMind: has joined #RubyOnRails
[12:51:20] conta: has joined #RubyOnRails
[12:53:18] xuyuheng: has joined #RubyOnRails
[12:56:57] mroutis: has joined #RubyOnRails
[12:59:15] xuyuheng: has joined #RubyOnRails
[12:59:23] Technodrome: has joined #RubyOnRails
[13:07:24] johndunn: has joined #RubyOnRails
[13:18:18] xuyuheng: has joined #RubyOnRails
[13:24:03] xuyuheng: has joined #RubyOnRails
[13:25:47] wethu: has joined #RubyOnRails
[13:26:37] jottr: has joined #RubyOnRails
[13:29:34] ellcs: has joined #RubyOnRails
[13:32:41] lupine: has joined #RubyOnRails
[14:01:18] kapil___: has joined #RubyOnRails
[14:29:44] apparition: has joined #RubyOnRails
[14:31:17] jane_booty_doe: has joined #RubyOnRails
[14:41:25] jottr: has joined #RubyOnRails
[14:46:44] conta: has joined #RubyOnRails
[14:47:34] Puffball: has joined #RubyOnRails
[14:57:40] mices: has joined #RubyOnRails
[14:58:00] mices: how do i set an environment variable from within production.rb
[15:01:58] johndunn: has left #RubyOnRails: ()
[15:10:40] orbyt_: has joined #RubyOnRails
[15:20:49] jottr: has joined #RubyOnRails
[15:32:18] JZA: has left #RubyOnRails: ("Konversation terminated!")
[15:34:17] havenwood: ENV['VAR'] = 'mices'
[15:41:42] CuriousMind: has joined #RubyOnRails
[15:44:08] schneider: has joined #RubyOnRails
[15:49:16] CuriousMind: Hi. I am following the ruby on rails guide (http://guides.rubyonrails.org/getting_started.html) - "5.6 Saving data in the controller". My question is about `@article = Article.new(params[:article])`. What does `:article` mean in `params[:article]`? Does it capture all of the parts from the form such as title, text?
[15:50:29] lupine: CuriousMind: `params` gives you a hash full of key => value attributes. the value may be a string, a number, or another hash. it ultimately comes from what the web browser sends. in this case, `:article` is a key that will probably give you a hash full of attributes like title and text
[15:51:01] lupine: if in the view you have `form_for @article do |f| ... f.text_field :title end` then that will certainly be the case
[15:52:04] jottr: has joined #RubyOnRails
[15:52:37] CuriousMind: lupine: I see
[15:53:48] fragamus: has joined #RubyOnRails
[15:53:49] mtkd: has joined #RubyOnRails
[15:53:59] lupine: if you check the generated html you'll likely see something like `<input id="article_title" name="article[title]"...>`. The name gets sent in the POST when you hit the submit button, and rails restructures it into the hash for you
[15:54:56] CuriousMind: That makes sense ok I see
[15:56:02] CuriousMind: lupine: lupine: I did research on params and I learned that params can be in the URL or from the form. How can I see what is inside params so that I can understand. This can be done in rails console or something right?
[15:58:07] lupine: not easily. you don't really have access to the controllers handling the requests in a rails console
[15:58:22] lupine: you can generally get information about the requests happening in log/{development,production,test}.log
[15:58:50] lupine: it won't include the request body by default, but it will include the query string and the parsed params
[15:59:16] lupine: you might be able to use pry to dig into a request as it happens, but it's not something I'm familiar with
[16:00:50] CuriousMind: lupine: I see. Ok no problem, thank you
[16:00:53] duderonomy: has joined #RubyOnRails
[16:18:54] mtkd: has joined #RubyOnRails
[16:19:28] conta: has joined #RubyOnRails
[16:29:54] jottr: has joined #RubyOnRails
[16:31:52] mtkd: has joined #RubyOnRails
[16:42:23] KeyJoo: has joined #RubyOnRails
[16:43:16] KeyJoo: has joined #RubyOnRails
[16:44:21] sandstrom: has joined #RubyOnRails
[16:58:42] gambl0re: has joined #RubyOnRails
[17:07:03] ellcs: has joined #RubyOnRails
[17:29:08] Dimik: has joined #RubyOnRails
[17:36:59] srinidhi: has joined #RubyOnRails
[17:46:38] srinidhi: has joined #RubyOnRails
[17:58:02] srinidhi: has joined #RubyOnRails
[18:06:13] apeiros: has joined #RubyOnRails
[18:30:42] jottr: has joined #RubyOnRails
[18:57:11] apeiros: has joined #RubyOnRails
[19:00:06] apeiros: has joined #RubyOnRails
[19:00:13] mroutis: has joined #RubyOnRails
[19:01:04] mices: has joined #RubyOnRails
[19:01:33] mices: does putting adsense ads on my site help people find my site
[19:01:49] mices: will it bring traffic to a new launch
[19:24:52] johndunn: has joined #RubyOnRails
[19:30:39] matt_d: has joined #RubyOnRails
[19:33:26] matt_d: Can someone point me in the right direction? I'm using webpacker and activestorage. Active storage is working just fine. However, I have addEventListener("direct-uploads:end") in a loaded javascript file, however it is not firing. I see it registered in Firefox's inspector, but it is not firing. I am obviosuly missing something, any direction would be appreciated!
[19:38:33] johndunn: has joined #RubyOnRails
[19:40:30] mroutis_: has joined #RubyOnRails
[19:49:34] Ryzokuken: has joined #RubyOnRails
[20:07:42] nickenchuggets: has joined #RubyOnRails
[20:11:37] orbyt_: has joined #RubyOnRails
[20:22:40] roshanavand: has joined #RubyOnRails
[20:25:15] starseed00: has joined #RubyOnRails
[20:25:41] starseed00: Anyone have a guess as to why my rspec scenario would be printing [object Object] to the console instead of the success "." ?
[20:35:43] mostlybadfly: has joined #RubyOnRails
[21:00:08] mtkd: has joined #RubyOnRails
[21:03:54] dviola: has joined #RubyOnRails
[21:13:52] fragamus: has joined #RubyOnRails
[21:28:46] dviola: has joined #RubyOnRails
[21:34:46] marr: has joined #RubyOnRails
[21:45:22] desperek: has joined #RubyOnRails
[21:53:30] mroutis: has joined #RubyOnRails
[22:10:54] roshanavand: has joined #RubyOnRails
[22:24:23] fragamus: has joined #RubyOnRails
[22:33:49] mroutis_: has joined #RubyOnRails
[22:34:18] armyriad: has joined #RubyOnRails
[22:54:05] uksio: has joined #RubyOnRails
[22:59:58] larissa: has joined #RubyOnRails
[23:38:22] Technodrome: has joined #RubyOnRails
[23:42:43] Ericx2x: has joined #RubyOnRails
[23:45:42] zwliew: has joined #RubyOnRails