« Back to channel list

#RubyOnRails - 06 November 2018

« Back 1 day Forward 1 day »
[00:25:37] borodin: has joined #RubyOnRails
[00:27:17] za1b1tsu: has joined #RubyOnRails
[00:54:09] eckhardt: has joined #RubyOnRails
[00:55:55] mangold: has joined #RubyOnRails
[01:00:40] sevenseacat: has joined #RubyOnRails
[01:04:26] Cork: has joined #RubyOnRails
[01:09:58] arathald: has joined #RubyOnRails
[01:18:20] mangold: has joined #RubyOnRails
[01:33:57] weaksauce: has joined #RubyOnRails
[01:37:58] tdy: has joined #RubyOnRails
[01:41:02] mangold: has joined #RubyOnRails
[01:48:50] orbyt_: has joined #RubyOnRails
[02:07:24] tpendragon: has joined #RubyOnRails
[02:15:18] za1b1tsu: has joined #RubyOnRails
[02:16:45] kapil____: has joined #RubyOnRails
[02:17:26] mangold: has joined #RubyOnRails
[02:26:33] DTZUZO: has joined #RubyOnRails
[02:32:23] bga57: has joined #RubyOnRails
[02:35:53] ivanskie: has joined #RubyOnRails
[03:16:27] SteenJobs: has joined #RubyOnRails
[03:21:12] za1b1tsu: has joined #RubyOnRails
[03:34:59] mangold: has joined #RubyOnRails
[03:36:59] Cork: has joined #RubyOnRails
[04:08:48] braincrash: has joined #RubyOnRails
[04:10:10] darkhanb: has joined #RubyOnRails
[04:33:34] mangold: has joined #RubyOnRails
[05:22:33] SteenJobs: has joined #RubyOnRails
[05:33:13] ivanskie: has joined #RubyOnRails
[05:48:38] Dbugger: has joined #RubyOnRails
[05:50:57] ivanskie: has joined #RubyOnRails
[06:02:32] reber: has joined #RubyOnRails
[06:21:10] OrangeManBad: has joined #RubyOnRails
[06:27:13] dionysus69: So, I decided to go with GKE (google k8s engine) for now, since it relatively simply solves many headaches associated with scaling. If anyone of you doesn't agree, let's discuss ^.^
[06:28:22] dionysus69: And from the exploration I have done, it is cheaper than Heroku.
[06:35:57] conta: has joined #RubyOnRails
[06:36:35] eckhardt: has joined #RubyOnRails
[06:56:37] xall: has joined #RubyOnRails
[07:31:57] drale2k_: has joined #RubyOnRails
[07:57:40] sameerynho: has joined #RubyOnRails
[08:05:44] otherj: has joined #RubyOnRails
[08:07:36] otherj: anyone remember how things work with rails 2.3? I am trying to use a version of attachment_fu which claims to work with 2.3, but am having a bit of trouble actually installing it. this legacy app with which I am playing uses an older version in vendor/plugin. I'm trying to remove that and install it via bundler using :git =>. first problem: it doesn't show up under installed gems when I do that. is it better to just put it vendor/gems? any idea
[08:07:36] otherj: how to proceed?
[08:08:53] kapil____: has joined #RubyOnRails
[08:23:32] ariedler: has joined #RubyOnRails
[08:33:31] srinidhi: has joined #RubyOnRails
[08:54:48] lexileo: has joined #RubyOnRails
[09:08:38] sameerynho: has joined #RubyOnRails
[09:18:30] lxsameer: has joined #RubyOnRails
[09:19:08] Ergo: has joined #RubyOnRails
[09:22:08] yaw: has joined #RubyOnRails
[09:24:47] Ergo: has joined #RubyOnRails
[09:38:33] mangold: has joined #RubyOnRails
[09:40:40] drale2k_: has joined #RubyOnRails
[09:48:24] drale2k_: Does anyone know if ActiveSupport::TimeZone[+1] will return the same as ActiveSupport::TimeZone[+2] during Daylight Savings ?
[09:49:07] drale2k_: Or does ActiveSupport::TimeZone[+1] always return the same, independent of DST or not
[09:51:02] Radar: drale2k_: literally, ActiveSupport::TimeZone[+1] ?
[09:51:22] drale2k_: Radar: no that's just an example. Generally asking
[09:51:40] Radar: okay. I wasn't sure if that was some made-up syntax or some Rails feature I didn't know of.
[09:52:01] drale2k_: well the syntax works, it will return a timezone
[09:52:12] Radar: drale2k_: iirc, the daylight savings timezones are distinct from the non-daylight savings ones. For instance, we have AEST and AEDT where I am. There's also PST + PDT.
[09:52:32] Radar: drale2k_: TIL
[09:52:52] drale2k_: but what i want to know is if i can rely on ActiveSupport::TimeZone[UTC_OFFSET] always returning the correct timezone which would mean it knows about DST
[09:53:08] Radar: drale2k_: I can tell you now, it won't.
[09:53:42] Radar: On my machine, ActiveSupport::TimeZone[+10] returns Brisbane. Which wouldn't be a problem... except Brisbane does not do Daylight Savings. Melbourne (where I am, does)
[09:54:13] Radar: Google says Melbourne's timezone is +11, so really I should be doing that, but then that gives me Asia/Magadan as the timezone. Not ideal.
[09:54:43] drale2k_: but Asia/Magadan is +11 so it got the ofset correct
[09:55:06] Radar: Yeah, that's right. The offset is correct, but +11 is not always going to be _my_ offset. It's going to be either +10 or +11, depending on the time of year.
[09:55:15] Radar: drale2k_: what problem are you aiming to solve with this? Timezones are pretty tricky.
[09:56:53] drale2k_: i have a client windows app which will send the UTC time and the UTC offset. I want to store that properly in rails for each record, so later i can show the time in the context of that PC. I would use start_time.in_time_zone("Asia/Magadan") which i would get when the records comes in, using ActiveSupport::TimeZone[UTC_OFFSET]
[09:58:22] Radar: Different regions transition to + from DST at different times. I think this might be tricky if you only have the UTC offset?
[09:59:59] drale2k_: hm, do you have a suggestion? Should i store the utc offset (instead of the region string like "Asia/Magadan") + if DST applies at that moment ?
[10:00:09] sevenseacat: https://www.youtube.com/watch?v=-5wpm-gesOY
[10:01:15] Radar: drale2k_: well, you can store a UTC time with the relative offset at that point in time, if you've got that information.
[10:01:54] Radar: drale2k_: psql has a "timestamp with time zone" type that would be good for that.
[10:02:07] Radar: I suspect Rails datetime fields use that type already
[10:02:52] drale2k_: ok so you would store UTC + offset in a single field, in my case the "start_time" field
[10:02:58] drale2k_: instead of having a separate field with the timezone
[10:03:00] Radar: yeah, that's right.
[10:03:10] Radar: db supports it so no real reason it should be 2 separate fields imo
[10:13:32] drale2k_: Rails' default created_at and updated_at fields are "timestamp without time zone". At least for me locally
[10:21:07] Radar: There's probably a Rails helper to create a similar field _with_ the timezone.
[10:24:13] ariedler: has joined #RubyOnRails
[10:49:10] atrius: has joined #RubyOnRails
[11:11:25] conta: has joined #RubyOnRails
[11:25:49] G: has joined #RubyOnRails
[11:35:07] ss942: has joined #RubyOnRails
[11:38:14] ss942: http://redmine.mydomain.something/wkcrmaccount/edit?account_id=2708&address_id=14127&sort_Zgłoszenia+firmy_by=updated_on-asc
[11:38:14] ss942: Is url were I put form_tag(search engine), but when I do it redirects to:
[11:38:14] ss942: http://redmine.mydomain.something/wkcrmaccount/edit?utf8=%E2%9C%93&searchlist=Zg%C5%82oszenia+firmy&cfName=&cfName=&linkTo=
[11:38:14] ss942: while it should add these params to previous link, how do I do that?
[11:46:21] noob69: has joined #RubyOnRails
[11:46:32] mangold: has joined #RubyOnRails
[11:46:47] noob69: Hi, how can I have multiple indexes on searchkick?
[11:46:51] noob69: *multiple indexes for same model
[11:51:21] noob69: Any suggestions on a report generation tool?
[11:55:07] ariedler: has joined #RubyOnRails
[12:04:12] lankanmon: has joined #RubyOnRails
[12:22:49] dbugger_: has joined #RubyOnRails
[13:01:36] apparition: has joined #RubyOnRails
[13:12:48] JamieD: has joined #RubyOnRails
[13:28:21] Dbugger: has joined #RubyOnRails
[13:30:23] dbugger_: has joined #RubyOnRails
[13:36:31] dbugger__: has joined #RubyOnRails
[13:43:26] Dbugger: has joined #RubyOnRails
[13:48:57] dbugger_: has joined #RubyOnRails
[14:06:15] ariedler: has joined #RubyOnRails
[14:10:48] hadifarnoud: has joined #RubyOnRails
[14:15:10] dachi: has joined #RubyOnRails
[14:17:38] mangold: has joined #RubyOnRails
[14:34:38] conta: has joined #RubyOnRails
[14:34:47] dustinm`: has joined #RubyOnRails
[14:52:01] GodFather: has joined #RubyOnRails
[15:02:09] srinidhi: has joined #RubyOnRails
[15:03:27] tycoon177: is there a way to get rack-mini-profiler to work with sql server? i only see postgres and mysql mentioned in the readme, but we use sqlserver and have a route that is misbehaving
[15:09:18] lxsameer: has joined #RubyOnRails
[15:16:50] cxl: has joined #RubyOnRails
[15:22:06] mangold: has joined #RubyOnRails
[15:24:05] hadifarnoud: has joined #RubyOnRails
[15:24:56] hadifarnoud: has joined #RubyOnRails
[15:42:00] Saukk: has joined #RubyOnRails
[15:42:30] roshanavand: has joined #RubyOnRails
[15:46:53] eddof13: has joined #RubyOnRails
[15:47:38] eddof13: has joined #RubyOnRails
[15:50:07] conta: has joined #RubyOnRails
[15:53:28] Saukk: has joined #RubyOnRails
[15:57:45] OrangeManBad: has joined #RubyOnRails
[15:58:08] lxsameer: has joined #RubyOnRails
[15:59:30] endemic: has joined #RubyOnRails
[16:00:36] eddof13: has joined #RubyOnRails
[16:07:05] ariedler: has joined #RubyOnRails
[16:07:10] ivanskie: has joined #RubyOnRails
[16:08:45] kapil____: has joined #RubyOnRails
[16:14:30] CGibsonmm: has joined #RubyOnRails
[16:20:36] CGibsonmm: when calling a remote: true from a form where is it looking for the file, say i have a file structure of threads/posts/likes/_create.js. if the create link in in the posts show the create is proscessed correct but the js response is not found. how can i point the remote true to point to the likes/_create
[16:21:27] Inside: not really following
[16:22:38] CGibsonmm: No template found for ForumThreads::ForumPosts::LikesController#create, rendering head :no_content
[16:23:07] CGibsonmm: this is the error i get from the server
[16:23:11] Inside: def create respond_to do |format| format.json {... } end
[16:24:02] CGibsonmm: I have a respond to format.js
[16:24:12] Inside: your action needs a call to render
[16:24:23] Inside: or do a redirect of some sort
[16:24:38] CGibsonmm: respond_to do |format|
[16:24:38] CGibsonmm: format.html { redirect_to @forum_thread}
[16:25:53] Inside: What do you want LikesController#create to do?
[16:27:26] Inside: I'm guessing you have a button (or something) in your form which uses javascript to make a POST to LikesController#create
[16:27:54] CGibsonmm: i want it to add a like, then remove the like link from the page and replace it with delete like, i have all the js written its just not finding that js file witch is in forum_posts/links
[16:27:55] Inside: Rails interally uses AJAX to make the call
[16:32:33] Inside: Er.. anyway, your webserver assumes that whenever you access a resource, you have an imaginary .html at the end
[16:32:57] Inside: ie: likes/234634 is internally thought of as requesting a view for likes/234624.html
[16:33:30] Inside: rails by default assumes that you want to render a .html document so it looks in app/views/likes/show.html (or whatever your action is)
[16:34:02] Inside: when you do a remote POST, it still is asking for an html response
[16:34:03] chouhoulis: has joined #RubyOnRails
[16:34:30] Inside: However, you don't HAVE to provide a specific type of response
[16:34:49] Inside: you could do render( json: {}, status: :created )
[16:35:27] Inside: So - I don't know why your create action has a format.html
[16:36:31] Inside: do you have a create.js.erb file?
[16:36:35] Inside: because it's trying to render that essentially
[16:36:54] CGibsonmm: and its not finding it
[16:37:11] CGibsonmm: its in post/like/create.js.erb
[16:38:18] Inside: shouldn't it be in [...]/likes/create.js.erb?
[16:39:00] CGibsonmm: yeah it is but on the create i am getting No template found for ForumThreads::ForumPosts::LikesController#create, rendering head :no_content
[16:39:28] CGibsonmm: yes it is likes/create that was just a typo here
[16:40:27] Inside: Can you physically visit likes/create.js in your browser?
[16:45:13] CGibsonmm: no routing error
[16:46:32] CGibsonmm: scratch that no i can not
[16:46:41] mostlybadfly: has joined #RubyOnRails
[16:46:56] Inside: how does your routes.rb look?
[16:48:43] CGibsonmm: resources :forum_posts, module: :forum_threads do
[16:48:43] CGibsonmm: resource :likes, module: :forum_posts
[16:51:09] Inside: rake routes | grep likes
[16:52:40] CGibsonmm: forum_posts/:forum_post_id/like/new(.:format) forum_threads/forum_posts/likes#new
[16:52:48] CGibsonmm: all is returned like normal
[16:53:41] CGibsonmm: POST /forum_posts/:forum_post_id/like(.:format) forum_threads/forum_posts/likes#create
[16:56:40] CGibsonmm: yeah i dont know why its not locating thenfile
[17:04:02] Inside: I'm confused too
[17:04:33] Inside: it should render whatever is in forum_threads/forum_posts/likes.js
[17:04:42] Inside: reboot/reinstall/reformat ;D
[17:05:37] CGibsonmm: haha! throw computer out window!
[17:05:54] CGibsonmm: nah i am gonna take it to stack overflow
[17:07:47] CGibsonmm: thank you, that just solved where its looking for the file
[17:18:42] blackmesa: has joined #RubyOnRails
[17:20:03] darkhanb: has joined #RubyOnRails
[17:26:35] SteenJobs: has joined #RubyOnRails
[17:36:54] orbyt_: has joined #RubyOnRails
[17:56:26] eckhardt: has joined #RubyOnRails
[18:07:53] ariedler: has joined #RubyOnRails
[18:13:07] lxsameer: has joined #RubyOnRails
[18:53:22] syndikate: Hey, can someone help me understand why this happens? https://github.com/rails/rails/blob/1353610ff2ab4d16d022d5c31d5b4e5d908e05a8/actionpack/lib/action_controller/metal/redirecting.rb#L38
[18:59:36] OrangeManBad: has joined #RubyOnRails
[19:40:55] macaronus: has joined #RubyOnRails
[19:54:02] CGibsonmm: has joined #RubyOnRails
[19:55:06] CGibsonmm: calling this js from my create $("#forum_posts_<%= @forum_post.id %>").html("<%=escape_javascript(render( partial: 'forum_posts/likes')) %>"); is working but is not changing the view
[19:55:57] CGibsonmm: #ids match it just wont update i am running rails 5 and have jquery3 and rails ujs
[19:56:07] ur5us: has joined #RubyOnRails
[20:04:51] za1b1tsu: has joined #RubyOnRails
[20:08:42] ariedler: has joined #RubyOnRails
[20:28:56] mochiyoda: has joined #RubyOnRails
[20:29:40] ss942: has left #RubyOnRails: ()
[20:31:27] iamvery: has joined #RubyOnRails
[20:32:22] iamvery: 👋 i'm doing a little research in preventing cookie replay attacks in rails. The rails guides (https://guides.rubyonrails.org/security.html#replay-attacks-for-cookiestore-sessions) mentions "Including a nonce (a random value) in the session solves replay attacks". Does anyone have an example of this for reference?
[20:32:45] roshanavand: has joined #RubyOnRails
[20:33:07] iamvery: I think I understand the idea, but it feels like a solution that may already exist.
[20:37:56] iamvery: oh, i should also mention that i think i understand that the "right" solution is to use a non-cookie session store, but alas i'm still interested in the cookie+nonce solution because reasons :D
[20:39:56] roshanavand: has joined #RubyOnRails
[20:42:40] hadifarnoud: has joined #RubyOnRails
[20:47:56] defsdoor: has joined #RubyOnRails
[20:54:22] dviola: has joined #RubyOnRails
[20:56:12] eddof13: has joined #RubyOnRails
[21:01:04] GodFather: has joined #RubyOnRails
[21:04:06] dtzuzu: has joined #RubyOnRails
[21:06:30] mochiyoda: has joined #RubyOnRails
[21:09:45] nicolasb: has joined #RubyOnRails
[21:13:28] za1b1tsu: has joined #RubyOnRails
[21:18:08] blackmesa: has joined #RubyOnRails
[21:32:21] dmgk: has joined #RubyOnRails
[21:35:57] marahin: What is the easiest way to implement ApplePay payments in my Rails app without involving Stripe (clients country is not supported)?
[21:36:00] segy: has joined #RubyOnRails
[21:38:07] Radar: marahin: does braintree support your client's country?
[21:38:41] marahin: Radar: thank you, forgot about Braintree payments!
[21:39:03] Radar: marahin: They have an API which is _almost_ as good as Stripe, so I'd recommend you go with them :)
[21:39:24] marahin: yes, I've worked with Braintree in some project like a year ago. I just forgot its even there :P been using Stripe ever since.
[21:39:26] marahin: Thank you!
[21:59:32] eckhardt: has joined #RubyOnRails
[22:07:08] mvensky: has joined #RubyOnRails
[22:22:00] reber: has joined #RubyOnRails
[22:22:37] kapil____: has joined #RubyOnRails
[22:23:05] reber__: has joined #RubyOnRails
[22:31:42] lypsis: has joined #RubyOnRails
[22:52:03] Inside: I'm feeling dejavu
[22:52:19] Inside: Code that was working that I'm pretty sure I didn't change is not working
[22:57:19] Inside: I could've sworn that this code would work just fine: https://gist.github.com/Insood/c7eafc28a600eafbdb5edf162146d56b
[23:04:06] eckhardt: has joined #RubyOnRails
[23:23:15] RiPuk: has joined #RubyOnRails
[23:25:48] gambl0re: has joined #RubyOnRails
[23:50:58] chouhoulis: has joined #RubyOnRails