Andr3as

Activity Graph

Page 1 of 7 | Next »

2019-04-09

[07:55:49] Andr3as: Remote host closed the connection

2019-03-13

[17:55:25] Andr3as: has joined #RubyOnRails
[18:07:17] Andr3as: hi all.. i've got an issue with running the command: rake webpacker:compile RAILS_ENV=staging which results in a
[18:07:25] Andr3as: TypeError: no implicit conversion of nil into String
[18:08:01] Andr3as: i did quite an extensive google search but i havent been able to come up with a hint on how to track that down.. anyone an idea how to find out where it dies?
[18:08:22] Andr3as: dev env compiles just fine
[18:11:43] Andr3as: i am on 5.2.2.1
[18:12:24] Andr3as: havent touched the app in a while, it worked great before.. went from linux to windows, pulled it out of my gitlab, did some updates and now boom
[18:12:51] Andr3as: updates as in "bundle update" and some minor bug fixes in the code.. totally unrelated to that error
[18:13:28] Andr3as: will give that a try, havenwood.. thank you
[18:14:26] Andr3as: ha, that "fixes" it
[18:14:39] Andr3as: thanks a lot!! i googled for like hours

2019-02-11

[23:46:47] Andr3as: *.net *.split

2019-02-03

[18:27:27] Andr3as: hi all.. i am having an API and it works as expected.. however, a third party wants to request a json reply of my "identity".. that req in the browser works fine, though wen the 3rd party app asks for it, i get an ActionController::UnknownFormat error
[18:27:52] Andr3as: as the req format seems to be html (request.formats: ["text/html"])
[18:28:14] Andr3as: is there a way to tell rails to serve json no matter what? kinda like ignore that the req asks for html?
[18:29:43] Andr3as: fwiw, that's my controlelr which serves the json https://gist.github.com/awunder/b7521d4db9df5cacd5bba349bced83f5
[18:30:33] Andr3as: its a bit of a test right now, so dont focus on the missing auth and what not..
[18:31:17] Andr3as: thing is, it already defaults on json
[18:31:25] Andr3as: lemme post the error
[18:31:45] Andr3as: trade added
[18:33:06] Andr3as: so, that 3rd party seems to specifically requests html (for whatever reason)
[18:34:17] Andr3as: so you still think that "format: :json" might fix that?
[18:35:48] Andr3as: will try.. its a bit of an open heart surgery on the staging env.. have that 3rd party app nowhere else..
[18:35:53] Andr3as: thank god for capistrano
[18:40:30] Andr3as: i dont get that far.. throws the error right away.. probably even before it executes the method
[18:47:30] Andr3as: yes, as this is an api.. i just try to disguise html as json now.. lets see what happens
[19:07:02] Andr3as: i put the default format into the routes.. the error is gone but it doesnt serve what its supposed to do
[19:07:06] Andr3as: https://gist.github.com/awunder/3387050b3c2005da863e95bc337a2aa9
[19:07:26] Andr3as: first req is made be the 3rd party app.. it serves :no_content
[19:07:49] Andr3as: 2nd req is made by me in the browser, it serves what i expect it to
[19:11:09] Andr3as: sh*t .. i gotta go..

2019-01-21

[15:35:59] Andr3as: hi all.. i have a text field where users should set a timecode in the format of MM:SS.. that timecode should be converted into seconds before i save it to the database as there is an integer field to hold it..
[15:36:30] Andr3as: in order to set that field correct i had to write a setter message timecode= with write_attribute :timecode, time.split(':').inject(0){|m, s| m = m * 60 + s.to_i}
[15:37:02] Andr3as: so far so good, i am now stuck with a validation coz i wnat that the user input will be validated if the format is correct..
[15:37:29] Andr3as: but as it gets converted when set, i cant validate, can i?
[15:38:06] Andr3as: if i dont do that setter method, user inputs of like "01:08" will be set to 1 when i do the Topic.new(topic_params) thing..
[15:38:13] Andr3as: any hint is highly welcome

2019-01-19

[11:35:35] Andr3as: morning all.. pretty noob question but i have this youtube api playlist item.. all i want is to put that content of @data into another hash.. but i dont seem to get @data out of the item.. anyone a hint how to get it? https://gist.github.com/awunder/453f31940422560f6082dd09ce788bda
[11:36:54] Andr3as: argh.. sometimes it needs a question somewhere.. i totally missed @snippet
[11:37:04] Andr3as: so .snippet.data does the trick

2019-01-06

[11:34:12] Andr3as: has joined #RubyOnRails

2019-01-04

[07:52:30] Andr3as: Remote host closed the connection

2018-12-26

[17:04:32] Andr3as: hello all.. i wonder what i do wrong here.. i cannot seem to have a fontwaesome icon in a button_to call..? it ends up rendering as text
[17:04:37] Andr3as: anyone an idea whats going on?
[17:07:18] Andr3as: the left one is using link_to, the right one uses the button_to https://abload.de/img/2018-12-26_12-06mrcub.png
[17:10:00] Andr3as: tbuehlmann: <%= button_to icon('far', 'eye'), new_signal_read_path, remote: true, class: 'read-link' %>
[17:10:43] Andr3as: no, passt..
[17:14:27] Andr3as: tbuehlmann: just to clearify.. i meant i am using the button_to method as above.. and it aint working.. i cant find my mistake..
[17:15:33] Andr3as: same thing.. doesnt work.. i even tried raw(icon('foo', 'bar'))
[17:15:46] Andr3as: i give this one a shot
[17:16:37] Andr3as: the block systax does the trick
[17:17:35] Andr3as: that method is part of the fontawesome gem
[17:18:37] Andr3as: https://github.com/FortAwesome/font-awesome-sass/blob/master/lib/font_awesome/sass/rails/helpers.rb
[17:29:49] Andr3as: ah, and thanks, as walways, tbuehlmann
[17:42:25] Andr3as: yeah, but they stopped at 4.7'ish or something.. i thought, i new project deserves the newest icons ;)
[17:42:35] Andr3as: *a new project

2018-12-25

[09:18:41] Andr3as: is it really called "file.rb"?
[09:19:28] Andr3as: and.. define "not working"..
[09:25:41] Andr3as: => "cat's are really nice sometimes, we give them good cat ."
[09:25:41] Andr3as: 2.5.3 :004 > line.gsub!(/food/, '') if line.start_with?('cat', 'dog')
[09:25:53] Andr3as: line = "cat's are really nice sometimes, we give them good cat food."
[09:26:11] Andr3as: so, your code works to me..?
[09:26:54] Andr3as: that loop though..
[09:30:17] Andr3as: you might wanna try map
[09:30:20] Andr3as: lines.map {|l| l.gsub(/food/, '') if line.start_with?('cat', 'dog')}
[09:30:43] Andr3as: or if you wanna replace the text inside the array try map! {...
[09:31:55] Andr3as: if l-start_with, obviously
[09:32:02] Andr3as: *l.start_with?

2018-12-15

[12:07:47] Andr3as: has joined #RubyOnRails

2018-12-14

[03:47:42] Andr3as: Ping timeout: 252 seconds

2018-12-09

[09:36:41] Andr3as: i do that quite often
[09:37:31] Andr3as: though, for lots of data (big table rows or something) it proves to be slow using partials
[09:37:45] Andr3as: *big tables and a row partial
[09:39:58] Andr3as: ah, good tip, nevre thought abt using helpers for that

2018-12-08

[09:26:34] Andr3as: i have a string like 'ESZ8-CME' and i have a model where i want to store a string "pattern" like 'ES??-CME' .. what i want to achieve is to find the corresponding element when i query for 'ESZ8-CME'
[09:28:48] Andr3as: there are other strings as well like "NQZ8-CME" or "@ESZ18"
[09:30:32] Andr3as: anyone with a hint on how to achieve that?
[12:35:31] Andr3as: could someone pls take a look at that gist? https://gist.github.com/awunder/b9492a5182272a7260edb2929bef95c6
[12:35:53] Andr3as: i'm going crazy and wonder why i cant iterate through the elements..(?)
[12:37:07] Andr3as: sevenseacat: am still at that issue above..
[12:37:32] Andr3as: even a puts r.id doesnt "work"
[12:38:24] Andr3as: see updated gist
[12:38:29] Andr3as: same output as without
[12:40:54] Andr3as: sevenseacat: at the end of the day i want to get the BrokerInstrument whose symbol "match" (e.g.) "CLZ8-CME"
[12:41:59] Andr3as: well.. i thought i simplify the gist
[12:47:09] Andr3as: sevenseacat: i did another update.. this time with my poor attempt to get the id
[12:48:56] Andr3as: ok.. so map... i will read a bit
[12:52:29] Andr3as: sevenseacat: you think broker_instruments.map {|bi| bi.id if trade_executions[r][2].match bi.symbol }.first sounds good?
[12:54:34] Andr3as: hmm, it gives me 1 which is the id of the BrokerInstrument i'd expect it to return
[12:57:11] Andr3as: the thing is, i have a "pattern" stored in the DB.. like "ES..-CME" and when i import a file, i have a string "ESZ8-CME"
[12:59:04] Andr3as: hmm, i though find needs an id but i do not have an id?
[13:00:14] Andr3as: but thanks for the heads up, if i change the string its more like [nil, 5] - so my above code def wont work
[13:02:45] Andr3as: sevenseacat: select might do what i need...
[13:02:50] Andr3as: https://stackoverflow.com/a/13485482/6844761
[13:03:35] Andr3as: broker_instruments.select {|bi| bi.id if trade_executions[r][2].match bi.symbol }.first.instrument

2018-12-06

[17:26:33] Andr3as: hi all.. i have a string like 'ESZ8-CME' and i have a model where i want to store a string "pattern" like 'ES??-CME' .. what i want to achieve is to find the corresponding element when i query for 'ESZ8-CME'
[17:27:02] Andr3as: anyone a tip how to approach that? i did some google research but am stuck, somewhat..
[17:53:09] Andr3as: i found the match method..
[17:53:27] Andr3as: when i change the pattern to like ES..-CME it should do the trick
[17:53:37] Andr3as: with something like BrokerInstrument.where(broker: broker).each {|bi| puts bi.id if te[1][2].match(bi.symbol) }

2018-11-25

[08:30:11] Andr3as: i import them in my scss file and thats it
[08:30:15] Andr3as: @elcontrastador
[08:43:35] Andr3as: @import "bootstrap";
[08:43:35] Andr3as: cat alphatrade_reloaded/app/assets/stylesheets/application.scss
[08:44:17] Andr3as: i import 'em directly in application.scss (renamed it to scss from css)
[08:45:48] Andr3as: elcontrastador:
[08:46:46] Andr3as: idk.. never did it like that.. i always used the bootstrap gem
[08:47:31] Andr3as: so, you're using weback then? elcontrastador
[08:48:54] Andr3as: found this via google.. they even use bootstrap as example: http://nithinbekal.com/posts/yarn-rails/
[08:49:56] Andr3as: what rails version do you use?
[08:52:20] Andr3as: maybe you can figure it out with a starter app? https://github.com/diowa/ruby2-rails5-bootstrap-heroku
[08:53:18] Andr3as: here's another.. well... guide https://medium.com/@coorasse/goodbye-sprockets-welcome-webpacker-3-0-ff877fb8fa79
[12:26:51] Andr3as: gemfile.lock might get an update
[12:27:03] Andr3as: *Gemfile.lock

2018-11-04

[08:30:16] Andr3as: i'd go with pundit
[08:30:23] Andr3as: and rolify @elcontrastador
[08:33:09] Andr3as: nothing specific, i just started with it and found it very clean and organized
[08:33:33] Andr3as: i guess i wouldnt switch in the middle of the "project" though

2018-11-03

[08:13:50] Andr3as: good morning.. i have a simple_form inside a modal / reveal and when i submit invalid data it does not show validation errors inside the form.. the controller correctly responds with a 422 and json data with the error message.. i was under the impression that simple_form does show the errors automagically...(?) - it does do so in a non remote form but not in this case.. here's the stackoverflow q i posted a while back but no soltion in sight..
[08:13:51] Andr3as: https://stackoverflow.com/questions/53014228/rails-simple-form-remote-true-dos-not-show-validation-errors
[08:13:59] Andr3as: any help is appreciated

2018-10-25

[15:29:49] Andr3as: has joined #RubyOnRails
[15:31:13] Andr3as: hello all.. i have a little issue with an "after_create".. i need to create associations (has_many through) when i create a certain element.. thats working great.. now i started to implement paper_trail to have an undo function
[15:31:51] Andr3as: i was able to get it working with associations too.. though that after_create is a bit wrong in that case as the associations will be recreated by paper_trail
[15:32:23] Andr3as: how would you guys prevent the firing of that after_create in that case?
[15:33:09] Andr3as: determining the "caller"? (e.g. which controller called for the (re)creation of that element?)

2018-10-07

[12:28:04] Andr3as: has joined #RubyOnRails

2018-10-06

[08:01:29] Andr3as: Remote host closed the connection

2018-08-31

[07:17:24] Andr3as: maybe dump it, change the table names in the sql file and reload it?
[07:17:37] Andr3as: if the other table is empty, obviously
[07:24:48] Andr3as: so, you basically have to skip those id's which are presnet in both tables
[07:27:13] Andr3as: what about some sql magic? like a full outer join?
[07:27:46] Andr3as: or iner join (i think)
[07:30:13] Andr3as: This variant of the full outer join (sometimes abbreviated to full join) returns all rows from both tables named in the ON condition where the join condition is not met (excluding NULL values).
[07:30:13] Andr3as: Full [Outer] Join without Intersection
[07:30:37] Andr3as: if i understood it correctly, thats the sql join you could use
[07:31:10] Andr3as: and create the records if they arent already existing
[07:31:25] Andr3as: This join is a variant on the basic right outer join, but instead, it returns all rows from the right-hand table specified in the ON condition that also meets the join condition and none of the rows from the left-hand table that match the join condition.
[07:31:25] Andr3as: or even better the Right [Outer] Join without Intersection
[07:31:48] Andr3as: that gives you only the missing records.. take those and create them
[07:33:20] Andr3as: here's a pic and stuff https://stackoverflow.com/questions/42553844/right-join-without-intersection-and-another-condition
[07:35:26] Andr3as: well, you get the records which are missing
[07:36:58] Andr3as: yes, and the outer join excludes those from the production table
[13:49:35] Andr3as: mices: http://bfy.tw/Jfe7

2018-08-30

[06:36:26] Andr3as: anyone ever had this issue with rails and js? https://stackoverflow.com/questions/52000505/rails-render-as-js-toggle-modal-unrecognized-expression
[06:38:30] Andr3as: i've tried to boil it down to the minimum without losing infos..
[06:39:51] Andr3as: well, at the end of the day it sends this $('#mainModal').modal('toggle'); in the update.js.erb and chrome argues Uncaught Error: Syntax error, unrecognized expression:
[06:40:18] Andr3as: and i dont know why.. i can execute the same thing from the console and it does work just fine
[06:44:51] Andr3as: no, i say the exact same code which does not work from within update.js.erb work when i post it into the console
[06:45:37] Andr3as: i wanted to make it easier to read.. and omited the rest of the code which also works
[06:45:57] Andr3as: "from the console
[06:46:40] Andr3as: and it also works from within the update.js.erb but it still throws that error and after the error, chrome wont deal with js anymore (as expected, unfortunately)..
[06:48:51] Andr3as: i've updated the post with the complete update.js.erb
[06:49:05] Andr3as: though its not that it adds any more value, actually..(?)
[06:49:50] Andr3as: coz it does not work with that modal toggle alone as well
[06:50:35] Andr3as: well, when it doesnt work with the toggle alone..(?) how could it matter how my final js.erb looks like?
[06:53:21] Andr3as: what shall i say to this... i just want to clearify that the whole thing does not work with the toggle alone.. to keep things simple.. you guys argue its too much code but ask for more.. anyway.. its ok.. i look somewhere else
[06:53:30] Andr3as: thanks for taking a look
[06:58:25] Andr3as: $("#mainModal").modal("toggle");
[07:00:50] Andr3as: dev tools network tab looking like this https://www.screencast.com/t/Mf79ZSiiKuAX
[07:02:23] Andr3as: no, i removed it
[07:02:30] Andr3as: to only have the toggle in it
[07:03:05] Andr3as: why overvcomplicate things when the easy stuff isnt working either
[07:05:47] Andr3as: i did that a thousand times... after that i took it out of the js.erb file, pasted it into the chrome console and it closes the modal without an issue
[07:06:00] Andr3as: no error message whatsoever
[07:09:49] Andr3as: see https://www.screencast.com/t/hZiXllnF
[07:09:55] Andr3as: i made a little video
[07:12:22] Andr3as: fwiw, the error in the rubymine server console is an old one.. i scrolled up earlier and it doesnt scroll down automatically
[08:42:16] Andr3as: i tried a console.log("Hello"); https://www.screencast.com/t/QENqhKsUGB

2018-08-21

[09:22:43] Andr3as: does a counter_cache always "just counts"? or could i use it for do some calculations as well? like when a trade has many executions and each execution has a size field which could be positive or negative and i wanna calculate the position size with adding up all the sizes of each execution
[09:23:42] Andr3as: i see, thx sevenseacat
[09:25:05] Andr3as: every gem installed?
[09:25:19] Andr3as: *for staging
[10:30:25] Andr3as: Quit: No Ping reply in 180 seconds.

2018-08-19

[05:43:11] Andr3as: fwiw, i found a solution for the "location with number sign paths"
[05:43:15] Andr3as: location: admin_index_path(anchor: 'instrument_templates')
[05:43:50] Andr3as: ah, and: morning
[11:01:39] Andr3as: is it possible to call a helper method to alter the pluck output? if not, anyone with a hint how to achieve it otherwise? here's a gist of what the situation is and what i need https://gist.github.com/awunder/ff822ca99458e215bdedff15faa11386
[11:08:00] Andr3as: i tried it but it maps the $ to USD.. havent found a way to have them both in it
[11:08:02] Andr3as: sevenseacat
[11:08:32] Andr3as: and its prretty tough to google, actually
[11:08:49] Andr3as: so an array.. that makes sense
[11:08:54] Andr3as: thanks a lot! (again)
[11:09:05] Andr3as: yes, it is
[11:09:35] Andr3as: i thought coz map already gave back an array..
[11:09:47] Andr3as: well, i dont know what i thought coz i always would need a 2d array

2018-08-18

[08:42:46] Andr3as: morning.. i never created an admin section like this before.. so i made a namespace :admin and put my stuff in a "do / end".. routes are working fin, index actions too though i have a bit of a struggle with a "new" action...
[08:42:55] Andr3as: this is a gist https://gist.github.com/awunder/e143b80d85dd1e9a6feaea0b60513148 of it
[08:43:16] Andr3as: as a teaser, i am getting "NameError - uninitialized constant Admin::InstrumentTemplatesController::InstrumentTemplate:"
[08:43:23] Andr3as: anyone with a hint?
[08:49:41] Andr3as: sevenseacat: yes
[08:50:33] Andr3as: forget it.. typo.. argh
[08:50:51] Andr3as: thx a ton.. saved my day
[09:22:29] Andr3as: dont ask to ask, just ask
[09:23:43] Andr3as: i have another one as well.. am using the responders gem with a "location" redirect.. i do it like this respond_modal_with @instrument_template, location: "/admin#instrument_templates"
[09:24:33] Andr3as: if i use a location "/admin" it does just fine "/admin#instrument_templates" isnt working though.. no errors either.. anyone an idea how to redirect to urls / paths like this?
[09:30:54] Andr3as: sevenseacat: real quick, you have maybe a hint re my redirect problem?
[09:31:34] Andr3as: Code_[24]: i'd go for the thing sevenseacat has mentioned.. let there be an entry for each occurence a book has been borrowed.. kinda l ike a "registration for borrowings"
[09:32:15] Andr3as: that even stores a history which you can do some stats on, later
[09:32:27] Andr3as: sevenseacat: sh.t

2018-08-09

[09:52:16] Andr3as: sunya7a: what does the server log say when you create a child?
[09:54:42] Andr3as: so you create the child and at your byebug the values are empty, if you move on the values are there?

2018-08-03

[16:58:31] Andr3as: hi all.. i gave devise a shot and am already regretting it... in my production / staging env when trying to register i get a "ActionController::InvalidAuthenticityToken in Devise::RegistrationsController#create" with google chrome.. i can register with ms edge though.. googling brought up nothing substantial.. anyone an idea where to look at? am trying to fix it for hours with no luck...
[16:58:53] Andr3as: am not sure what you guys need in a gist..
[16:59:18] Andr3as: pls let me know.. i am more than happy to provide anything needed
[17:15:02] Andr3as: Caerus: it totally works in dev and i am exclusively use chrome.. edge was just a test...
[17:15:23] Andr3as: i gave chrome incognito mode a shot, doesnt work either.. cleared all the cookies and chache, doesnt fix it
[17:18:15] Andr3as: just tested to sign in, same issue just different contorller (SessionsController) - can login with Edge
[17:19:55] Andr3as: fwiw, i am not using turbolinks
[17:30:54] Andr3as: Caerus: 5.2.0
[17:39:41] Andr3as: sure https://gist.github.com/awunder/f4146b09c5b43a386556c4bf2c8e3ea7 - thanks for looking into this
[17:40:00] Andr3as: its pretty empty right now.. have just started with a new app
[18:25:48] Andr3as: Caerus: i tried that already.. the error is gone but it doesnt process the registration.. it renders the form again after submitting but empty
[18:26:21] Andr3as: also tried protect_from_forgery with: :null_session / protect_from_forgery / protect_from_forgery with: :exception
[18:30:47] Andr3as: for testing purposes - skip_before_action :verify_authenticity_token does "work"
[18:30:55] Andr3as: though thats nothing i would really consider
[18:31:25] Andr3as: i give this gist a shot, hang on
[18:32:33] Andr3as: nope, doesnt work
[18:40:43] Andr3as: Caerus: i have not.. am on apache... will digg a bit to come up with an apache setting
[18:40:52] Andr3as: in the meantime i have set it to "skip_before_action :verify_authenticity_token, if: :devise_controller?"
[18:41:12] Andr3as: to at least not have it wide open
[18:44:11] Andr3as: well, right now i do not have an authenticate before filter
[18:44:40] Andr3as: not that its particulary difficult to add ;) - but i just havent added it yet
[18:53:16] Andr3as: anyway, i'm calling it... thanks a lot, Caerus - good night

2018-08-02

[08:44:06] Andr3as: morning all.. i am aware of the possibility to "override" ActionView::Base.field_error_proc to get a more bootstrap like class settings...
[08:44:30] Andr3as: is there something to set the class for fields without error?
[08:45:13] Andr3as: after a validation brought up some other fields with an error, obviously
[09:48:59] Andr3as: syndikate: if you have a validation and it fails it wraps the field with the error in a div with a class "field_with_error" when it renders the view again
[09:49:22] Andr3as: you can change that behavier when you change ActionView::Base.field_error_proc
[09:50:37] Andr3as: i did it and it works as expected
[09:51:03] Andr3as: what i would like to have though is that it wraps fields without an error as well.. with a different class though
[09:51:21] Andr3as: to kinda show correct fields in green and fields with error in red
[10:45:37] Andr3as: syndikate: yeah, maybe thats what i have to do.. i just thought if there's a "field_with_error" there may be a way for a field without error too
[10:45:42] Andr3as: from within rails

2018-07-30

[16:34:16] Andr3as: has joined #RubyOnRails

2018-07-23

[15:21:02] Andr3as: Ping timeout: 256 seconds

2018-07-20

[00:07:23] Andr3as: *.net *.split
[00:15:28] Andr3as: has joined #RubyOnRails

2018-07-18

[17:53:26] Andr3as: can you inspect the customer and update the gist?
[18:09:28] Andr3as: maybe try the "better_errors" gem? its pretty awesome