« Back to channel list

#RubyOnRails - 13 June 2019

« Back 1 day Forward 1 day »
[00:11:15] brool: has joined #RubyOnRails
[00:56:20] tdy: has joined #RubyOnRails
[01:03:36] xco: has joined #RubyOnRails
[01:12:32] beholders_eye: has joined #RubyOnRails
[01:17:35] octos: has joined #RubyOnRails
[01:36:38] Roupi: has joined #RubyOnRails
[01:44:01] _dbugger: has joined #RubyOnRails
[01:56:12] uks: has joined #RubyOnRails
[01:58:11] uksio: has joined #RubyOnRails
[02:21:58] NeXTSUN: has joined #RubyOnRails
[02:35:00] Tempesta: has joined #RubyOnRails
[02:43:16] duderonomy: has joined #RubyOnRails
[02:56:02] Stabby: has joined #RubyOnRails
[03:07:32] Stabby: Still trying to strip IP from logs. I've been able to follow the thing I need to modify to here- https://github.com/rails/rails/blob/master/railties/lib/rails/rack/logger.rb
[03:08:06] Stabby: I need to modify Line 53 in that .rb file, somehow. I'm not sure how to do that.
[03:09:37] braincrash: has joined #RubyOnRails
[03:18:58] Stabby: Trying to modify log output to hide request IP.
[03:19:05] Stabby: Log output: Started GET "/" for 127.0.0.1 at 2019-06-12 01:33:56 -0300
[03:19:23] Stabby: Desired : Started GET "/" for [FILTERD] at 2019-06-12 01:33:56 -0300
[03:21:46] sevenseacat: has joined #RubyOnRails
[03:23:58] uks: has joined #RubyOnRails
[03:30:53] uks: has joined #RubyOnRails
[03:34:00] orbyt_: has joined #RubyOnRails
[04:01:48] Haydos: has joined #RubyOnRails
[04:04:15] sevenseacat: sprockets is totally infuriating
[04:10:14] bambanx: has joined #RubyOnRails
[04:17:42] Technodrome: has joined #RubyOnRails
[04:23:13] sevenseacat: it just doesn't like me writing a new file and requiring it, in a directive
[04:29:16] regedit: has joined #RubyOnRails
[04:44:14] srinidhi: has joined #RubyOnRails
[04:56:10] Stabby: Nevermind, figured out how to do it. See ya.
[05:14:17] conta: has joined #RubyOnRails
[05:53:54] srinidhi: has joined #RubyOnRails
[05:59:57] Caly`: has joined #RubyOnRails
[06:01:12] schne1der: has joined #RubyOnRails
[06:05:19] xco: has joined #RubyOnRails
[06:05:49] ZAJDAN: hi....according what I should decide if I need one or more controller?
[06:07:19] defsdoor: has joined #RubyOnRails
[06:08:49] Caerus: ZAJDAN, usually size, according to rubocop
[06:08:53] sevenseacat: you will always need more than one controller in an app.
[06:09:09] sevenseacat: size isn't a good way to look at it - discrete concepts is
[06:09:58] ZAJDAN: in my case one database+1model (I do not count models of gems/robots)
[06:10:09] sevenseacat: what is that model?
[06:10:58] ZAJDAN: from one view I will INSERT/UPDATE/SEARCH .....from second one view I will just display records acording one/two filters
[06:12:29] ZAJDAN: the view where users can INSERT/UPDATE/SEARCH..I open up via account
[06:13:07] ZAJDAN: the second one..lets say DisplayView ...it will be open for all users
[06:13:20] Caerus: call me crazy but whenever I'm doing a small app or learning app I usually constraint myself by using the rest actions that scaffold provides on the generator
[06:13:37] sevenseacat: that's a good rule of thumb
[06:15:54] ZAJDAN: when is in a controller ' before_action :authenticate_user!' it will affect all methods in the controller?
[06:16:09] sevenseacat: if you don't specify only/except, then yes
[06:16:39] ZAJDAN: so there is option specify for which methods it will be used?
[06:17:02] ZAJDAN: yes...now I see it..it is possible
[06:17:32] sevenseacat: https://guides.rubyonrails.org/action_controller_overview.html#filters
[06:20:20] syndikate: Is there any advantage for #1 over #2 https://dpaste.de/MA1t
[06:21:52] webdestroya: has joined #RubyOnRails
[06:22:50] sevenseacat: i'm not sure about those options, but I'd move your logic for checking account expiry and activity to the query itself
[06:24:23] syndikate: Okay, good point. I will see if that can be done - some of the conditions are derived from joining other tables and is easily made available via the model method, hence resorted to this way..
[06:25:02] syndikate: Although, currently I was asked why not use #find_each instead of #2 but from what I understood #2 happens underneath #1. So, except the syntactic sugar is there any advantage sevenseacat ?
[06:25:16] sevenseacat: I already said I'm not sure
[06:25:28] syndikate: Ooh, missed that.
[06:30:21] conta: has joined #RubyOnRails
[06:30:44] ZAJDAN: sevenseacat:::http://pasteall.org/pic/show.php?id=dd5d3e7022044e5a79823446eb4a0fa1
[06:31:31] sevenseacat: I'm not sure what you want me to do with that
[06:31:46] ZAJDAN: small APP where one group of user will add commissions and second one view can access anybody and search there
[06:32:25] ZAJDAN: and now I ask my self if one controller for one the view and next for the second one
[06:33:20] sevenseacat: if you're only dealing with one concept and basic CRUD actions on that one model, then one controller would be fine
[06:33:50] ZAJDAN: I also have same opinion...thnx
[06:36:21] Aherin: has joined #RubyOnRails
[06:56:22] MrCrackPotBuilde: has joined #RubyOnRails
[07:02:20] cgfbee: has joined #RubyOnRails
[07:03:01] ZAJDAN: is any convention how to name views?
[07:03:29] ZAJDAN: is wrong approach when I will name it 'prod-stat.html.erb' ...?
[07:10:41] lxsameer: has joined #RubyOnRails
[07:12:05] sevenseacat: name them to match the controller actions.
[07:14:24] ZAJDAN: now I see it can not contains symbol '-' ...in controller when I write render :prod-stat ...so the controller doesn't accept it
[07:15:29] prestorium: has joined #RubyOnRails
[07:17:23] srinidhi: has joined #RubyOnRails
[07:17:29] ur5us: has joined #RubyOnRails
[07:18:13] schne1der: has joined #RubyOnRails
[07:21:29] srinidhi: has joined #RubyOnRails
[07:31:09] ZAJDAN: in method SHOW....is possible render a few views according to from which URL it is triggered?
[07:31:33] sevenseacat: it should only be triggered by one URL
[07:34:13] ZAJDAN: I created view 'prod_stat.html.erb' in controller def prod_stat render :prod_stat ...when I access it via URL http://.../prod_stat ..it render the page via method show
[07:34:28] ZAJDAN: and in show I have render :history
[07:34:33] sevenseacat: did you add a route for that action?
[07:34:52] ZAJDAN: after add the route needs reboot server?
[07:39:42] ZAJDAN: sevenseacat:::https://termbin.com/wuf8
[07:40:08] ZAJDAN: there I added post 'prod_stat'
[07:40:17] sevenseacat: you've defined it as a post request, so just visiting the URL won't work
[07:40:23] sevenseacat: that makes a get request
[07:40:41] ZAJDAN: ashhhh...yes yes...
[07:41:04] ZAJDAN: fixed and works
[07:41:09] ZAJDAN: thank you
[07:54:12] conta: has joined #RubyOnRails
[07:56:39] mikecmpbll: has joined #RubyOnRails
[08:03:35] Ergo: has joined #RubyOnRails
[08:08:12] jefffrails35: has joined #RubyOnRails
[08:10:24] ellcs: has joined #RubyOnRails
[08:10:53] ellcs: has joined #RubyOnRails
[08:15:18] liKe2k1: has joined #RubyOnRails
[08:17:27] ZAJDAN: <%= form_with model: @somevariable ...here the variable has optional name or it must be same as model?
[08:17:47] crankharder: has joined #RubyOnRails
[08:30:06] bradleyprice: has joined #RubyOnRails
[08:38:28] drale2k_: has joined #RubyOnRails
[08:48:02] bradleyprice: has joined #RubyOnRails
[08:57:53] ellcs: has joined #RubyOnRails
[08:58:31] DylanJ: has joined #RubyOnRails
[09:27:31] SigizMG: has joined #RubyOnRails
[09:47:58] MrCrackPotBuilde: Hey im stuck with the new active storage. How do i send a image via json request. I've got a nest raw json request like so. { "User": { "name": "smith", "avatar": "base64:data..." } } but i keep getting invalid signature request
[09:48:53] MrCrackPotBuilde: ive followed a few tutorials from this guy https://www.youtube.com/watch?v=S-E2TNkXBV8 and a few others. i created a html template to test and im able to upload an image there but not via postman
[09:54:10] Skeezy: has joined #RubyOnRails
[10:00:02] tdy: has joined #RubyOnRails
[10:07:29] drale2k_: has joined #RubyOnRails
[10:11:08] conta: has joined #RubyOnRails
[10:18:29] drale2k_: has joined #RubyOnRails
[10:21:50] NL3limin4t0r: MrCrackPotBuilde: How do you upload the image via postman? I assume you've converted your image into a base64 string and added that to the JSON payload.
[10:22:12] NL3limin4t0r: Using something like https://www.base64encode.org/
[10:26:10] NL3limin4t0r: Scrap the above link, here is a better variant. https://www.base64encoder.io/image-to-base64-converter/
[10:32:22] MrCrackPotBuilde: thats what i did
[10:32:38] MrCrackPotBuilde: i just keep getting invalid signature
[10:38:03] MrCrackPotBuilde: NL3limin4t0r, https://pastebin.com/raw/MS65LYBd
[10:42:16] MrCrackPotBuilde: i have has_one_attached :avatar and :avatar in my strong params. if i leave the avatar out of the json request i get my avatar can not be blank error. if i use just avatar: "", i get error invalid string too
[10:53:43] conta: has joined #RubyOnRails
[11:00:46] lankanmon: has joined #RubyOnRails
[11:17:10] NL3limin4t0r: MrCrackPotBuilde: You're missing the type declaration. Check my previous link and copy the "Base64 Image source". This should start with something like "data:image/png;base64," followed by the actual data.
[11:18:28] NL3limin4t0r: You can test if it works by simply copying the string into the URL bar of your webbrowser. If all is correct the image should be displayed.
[11:48:14] arooni_team_b: has joined #RubyOnRails
[11:58:56] conta: has joined #RubyOnRails
[12:21:18] beholders_eye: has joined #RubyOnRails
[12:40:40] MrCrackPotBuilde: yep dont that still getting signature error
[12:54:23] conta: has joined #RubyOnRails
[13:01:45] NL3limin4t0r: MrCrackPotBuilde: I suggest capturing the request made by the form and compare it to the one you make using postman.
[13:02:28] NL3limin4t0r: I also found this SO question, which might be usefull https://stackoverflow.com/q/50483901/3982562
[13:07:03] uks: has joined #RubyOnRails
[13:23:47] MrCrackPotBuilde: NL3limin4t0r, thanks iv been using this earlier the problem i had when i tried this example is the format of the request it expects.
[13:25:10] MrCrackPotBuilde: ie my request has nested attributes and is also nested itself data: { auth: { user: { user_deatils_here }, user_auth_token: "token" } }
[13:25:37] MrCrackPotBuilde: or data: { live: { } }
[13:29:00] apparition: has joined #RubyOnRails
[13:29:18] srinidhi: has joined #RubyOnRails
[13:36:50] Dbugger: has joined #RubyOnRails
[14:29:59] shtirlic: has joined #RubyOnRails
[14:51:40] conta: has joined #RubyOnRails
[14:54:53] Dbugger: has joined #RubyOnRails
[14:57:58] dviola: has joined #RubyOnRails
[15:01:47] Technodrome: has joined #RubyOnRails
[15:07:33] bradleyprice: has joined #RubyOnRails
[15:11:35] xco: has joined #RubyOnRails
[15:25:10] RiPuk: has joined #RubyOnRails
[15:44:18] mikecmpbll: has joined #RubyOnRails
[15:46:38] Andr3as: has joined #RubyOnRails
[15:47:44] Andr3as: hi all... is someone aware of an "opposite" of time in words? if i enter like "5 years" or "3 months" it should come up with the number of days
[15:49:49] molly: has joined #RubyOnRails
[15:59:56] bradleyprice: has joined #RubyOnRails
[16:03:32] bradleyprice_: has joined #RubyOnRails
[16:05:18] drale2k_: has joined #RubyOnRails
[16:11:56] Guest83989: has joined #RubyOnRails
[16:22:58] bradleyprice: has joined #RubyOnRails
[16:23:09] shtirlic: has joined #RubyOnRails
[16:25:20] fyber: Andr3as: Months don't have a consistent number of days
[16:25:24] fyber: that would be impossible
[16:25:46] fyber: Maybe this is what you want? https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M002261
[16:28:38] orbyt_: has joined #RubyOnRails
[16:29:59] NL3limin4t0r: fyber: Although RoR uses a static value for the months. They simply take 1/12 of a year. `3.months` translates to 3/12 of a year. Whith the year being `365.2425` days.
[16:31:02] NL3limin4t0r: Which is pretty logical since nowhere is specified what months we're talking about.
[16:31:56] NL3limin4t0r: https://github.com/rails/rails/blob/5a8714e559dd4d4058d23bd0d427a9d3e6022617/activesupport/lib/active_support/duration.rb#L108-L113
[16:37:48] duderonomy: has joined #RubyOnRails
[16:43:58] morozovm: has joined #RubyOnRails
[16:50:56] conta: has joined #RubyOnRails
[16:56:43] bradleyprice: has joined #RubyOnRails
[16:57:55] timdotrb: has joined #RubyOnRails
[16:58:38] brendan-: has joined #RubyOnRails
[17:01:49] timdotrb: Morning, all
[17:02:20] timdotrb: Anyone know how to read a text file from S3? Everything I see online is using Kernel#open to open the S3 URL.. There has to be a better way than tha
[17:03:55] Xiti: has joined #RubyOnRails
[17:04:33] Exuma: has joined #RubyOnRails
[17:06:07] Exuma: is Time.now.utc ever wrong if it's called during a time with/without DST? Similar to how DateTime.parse will say -5:00 even though it should be -4:00 because of DST
[17:09:04] Saukk: has joined #RubyOnRails
[17:10:02] xco: hi. How do i check the value of a check_box in a model for example?
[17:11:09] havenwood: xco: check_box sounds like something in the view, not the model? say more?
[17:11:31] xco: yes but i want to run a validation only if a checkbox is checked
[17:11:39] xco: otherwise the validation should run
[17:12:22] xco: perhaps i could do it with params
[17:13:04] xco: like `validation if params[:checkbox_param][value] == ticked`
[17:15:07] Exuma: xco that shouldnt happen in a model, usually if you want to conditionally validate you would use if: Proc.new{|x| x.some_field?}
[17:15:19] Exuma: you could do it with a virtual attribute on the instance
[17:15:41] Exuma: validates :something, if: Proc.new{|x| x.some_field?}
[17:15:55] Exuma: validates :something, presence: true, if: Proc.new{|x| x.some_field?}
[17:16:26] xco: Exuma: what is “x”?
[17:16:34] Exuma: that will be the instance of the class
[17:17:14] Exuma: that is what gets passed into the block
[17:17:23] xco: but you said “that shouldnt happen in a model”
[17:17:34] Exuma: i meant working with params
[17:17:34] xco: but `validates :something, presence: true, if: Proc.new{|x| x.some_field?` is done in the model right?
[17:17:39] xco: that’s contradictory
[17:17:46] Exuma: i was referring to params only
[17:17:52] Exuma: which is what you asked
[17:17:55] xco: ah right
[17:18:14] Exuma: xco usually what i do when i have "one off" validations, is i wouldnt put it in the model at all
[17:18:21] Exuma: I find it to be a pain. i would just put this in the controller
[17:19:17] Exuma: raise 'You must enter a username if you check this box' if params[:checkbox].present && @user.username.blank?
[17:19:54] Exuma: replace raise with whatever you want to do, a flash or whathave you
[17:22:14] tdy: has joined #RubyOnRails
[17:22:47] xco: Exuma: thanks :)
[17:24:59] duderonomy: has joined #RubyOnRails
[17:38:13] Momentum: does it make sense to have "null: false" with a default value in an active migration?
[17:44:00] brendan-: has joined #RubyOnRails
[17:53:08] crankharder: has joined #RubyOnRails
[17:59:05] bradleyprice: has joined #RubyOnRails
[18:07:12] bradleyprice: has joined #RubyOnRails
[18:08:52] bradleyprice: has joined #RubyOnRails
[18:09:00] rikkipitt: has joined #RubyOnRails
[18:18:13] bradleyprice: has joined #RubyOnRails
[18:19:02] bradleyprice_: has joined #RubyOnRails
[18:22:47] Aherin: has joined #RubyOnRails
[18:23:23] brendan-: has joined #RubyOnRails
[19:05:31] DTZUZO: has joined #RubyOnRails
[19:07:40] uksio: has joined #RubyOnRails
[19:10:11] shtirlic: has joined #RubyOnRails
[19:11:14] shtirlic: has joined #RubyOnRails
[19:23:35] bradleyprice: has joined #RubyOnRails
[19:54:26] Caly`: has joined #RubyOnRails
[19:58:56] emachnic: has joined #RubyOnRails
[20:03:15] bradleyprice_: has joined #RubyOnRails
[20:03:38] Inside: has joined #RubyOnRails
[20:03:47] Inside: Q: activestorage, localstore
[20:03:59] Inside: How "performant" is RoR with 500,000 files?
[20:05:12] dviola: has joined #RubyOnRails
[20:05:34] Inside: Let's say that each file is 100kb and I need to store 500,000 files. Will there be issues with say.. querying 10 files and then looking at data within?
[20:07:18] havenwood: Inside: Do you have 1 MB of extra memory available?
[20:07:27] havenwood: Inside: Doesn't sound like a problem.
[20:07:31] Inside: RAM is expensive and hard to get these days: P
[20:07:45] Inside: Actually the thing I'm wondering about now is how I'm going to access this data once it's stored...
[20:08:37] Inside: Each file is a csv from a machine... sometimes I may need to push the stuff into python (RIP sciruby) for analysis
[20:08:57] morozovm: has joined #RubyOnRails
[20:09:12] LtHummus: has joined #RubyOnRails
[20:09:25] Inside: Crap, I am probably going to need to setup a separate application for managing all this data
[20:09:31] Inside: "microservice"
[20:17:48] powerbit: has joined #RubyOnRails
[20:19:13] tdy: has joined #RubyOnRails
[20:20:18] havenwood: Inside: Are you just going to be reading or writing while reading as well?
[20:21:53] Inside: write once, read once in a while
[20:22:20] Inside: https://stackoverflow.com/questions/56571103/storing-time-series-data-in-a-database
[20:22:29] Inside: my complete question
[20:23:11] Inside: what's the second icon?
[20:23:49] havenwood: Inside: Ah, it's a multiple codepoint grapheme. You must be seeing the two emoji's separately. It's just one.
[20:23:54] havenwood: Inside: (Skin tone.)
[20:26:34] schne1der: has joined #RubyOnRails
[20:27:03] havenwood: Inside: What kind of queries are you doing?
[20:27:18] Inside: I haven't built anything yet, this only lives on paper ;(
[20:28:04] havenwood: Inside: Let me give you more options! ;)
[20:28:16] Inside: The data will come in as a CSV (through serialport), then be pushed to the server with some information about where it came from.
[20:28:41] havenwood: Inside: Are you replacing one CSV with another or just adding new ones and leaving the old ones?
[20:28:51] havenwood: Inside: Do they change, or just get replaced in whole?
[20:28:56] Inside: The old CSVs will live forever and be immutable
[20:29:12] Inside: so it's a fairly simple problem
[20:29:18] havenwood: Do old ones keep getting queried?
[20:29:36] Inside: Yeah. Let me slap some sample data together really quick
[20:31:30] havenwood: Inside: My impulse is to advise you to import the CSV into your DB.
[20:32:09] havenwood: Inside: BULK INSERT FooDataSet FROM '/path/to/foo.csv' WITH ...
[20:32:34] havenwood: Inside: What would the downside be there?
[20:33:18] Inside: https://gist.github.com/Insood/affd6d920f7d100d372656fe0572cc7f
[20:33:46] NeXTSUN: has joined #RubyOnRails
[20:34:00] orbyt_: has joined #RubyOnRails
[20:34:41] Inside: Typical analysis situation would be - pull in all units of a certain type created in a certain time frame, with a specfic kind of test
[20:34:47] Inside: then pass that into numpy
[20:34:50] havenwood: https://www.codeproject.com/Articles/439843/Handling-BULK-Data-insert-from-CSV-to-SQL-Server
[20:34:51] SteenJobs: has joined #RubyOnRails
[20:35:35] Inside: So actually have this live directly in SQL without using activestorage would be nice
[20:35:41] mlt-: has joined #RubyOnRails
[20:35:44] Inside: since then I wouldn't have to touch the active storage tables /at all/ to pull the data out
[20:36:00] havenwood: then you don't have to worry about streaming the CSV so you don't go OOM
[20:36:02] havenwood: DBs are nice
[20:36:14] havenwood: also, the data will not get corrupted
[20:36:16] Inside: and the files will be fairly small (100kb tops)
[20:36:41] havenwood: what are your DB limits?
[20:36:48] Inside: I'm not sure
[20:37:06] havenwood: if huge, that sounds like a good way to go for data integrity, query speed, memory usage, etc.
[20:37:49] havenwood: a giant YAML::DBM or YAML::Store would also be an option, but meh - you already have a DB
[20:41:40] Inside: Lesse - the db server has 16GB w/ 4 processors, looks like at least 250GB free
[20:43:11] Inside: And I'm really only looking at ~6.5GB data per year
[20:43:13] Inside: ACTION rolls eyes.
[20:47:21] Inside: store rows or store the actual data?
[20:47:30] Inside: erm, store a blob or store tabular data
[20:49:21] havenwood: Inside: using DB tables makes sense to me. it's usually worth it to get data into a well-formed, queryable state
[20:49:49] Inside: yikes that will be a lot of rows then
[20:49:56] havenwood: Inside: Luckily bulk importing from CSV into tables is something your DB handles with aplomb
[20:50:13] Inside: That's like 40M rows/year
[20:51:13] havenwood: Inside: Rows per table are only limited by available storage
[20:51:33] Inside: I guess I would create an index then or something
[20:52:38] ellcs: has joined #RubyOnRails
[20:52:42] havenwood: Inside: Index memory is a good question. I'd try an import, add indexes and see where it stands.
[20:53:15] havenwood: Inside: Limits: https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server
[21:21:18] Inside: it's gonna take a while to generate all this sample data
[21:23:18] Inside: 3:30 for 1M rows >_>
[21:30:10] zojka: has joined #RubyOnRails
[21:31:30] zojka: firstly I am facing problem: undefined method `[]' for nil:NilClass ...could anybody point me what it means?
[21:31:46] Inside: somewhere in you are code you are doing the following:
[21:31:53] Inside: a = foo() # Foo is returning nil
[21:32:36] Inside: look at the line in the error message, look at the variable where you are trying to access the hash, then figure out why that variable is nil
[21:33:08] zojka: @commission = Commission.where(:kw => params[:commission][:kw]).all
[21:33:25] zojka: on this line it breaks
[21:33:42] Inside: ok, in the RoR console look at the params
[21:35:26] zojka: via which command I can look at the params?
[21:35:36] Inside: Processing by Commisions#show as HTML Parameters: {"id"=>"10002", "commision"=>{...}}
[21:35:40] Inside: just the output
[21:35:52] Inside: you can see which params your controller is receiving
[21:35:59] Inside: install byebug
[21:36:11] Inside: and then put 'byebug' right before you do there .where statement
[21:36:22] Inside: it'll drop you into the console and then you can just type at the byebug console 'print params'
[21:37:49] zojka: the whole line You send 'rocessing by Commisions#show as HTML Parameters: {"id"=>"10002", "commision"=>{...}}' ..I should launch in the console?
[21:38:41] Inside: while your application is running and you are interacting with it in the browser, you see all of the debug information in the background, right?
[21:39:11] zojka: I should see it in puma server console
[21:39:22] Inside: yes, exactly
[21:39:39] zojka: moment I will try to connect to remote machine where it runs
[21:40:48] Inside: you can also look at the log file..
[21:44:50] bradleyprice: has joined #RubyOnRails
[21:52:10] zojka: has joined #RubyOnRails
[21:53:35] zojka: Inside: https://termbin.com/lpne4
[21:54:31] zojka: in the method which is callen is query to model commission and I see on the server user...strange
[21:55:38] Inside: I didn't quite get any of that
[21:56:16] Inside: Can you post some more code?
[21:56:20] zojka: https://termbin.com/27k9
[21:56:47] Inside: ok, how about a little bit of your commisions controller function?
[21:58:18] zojka: https://termbin.com/zban
[21:59:05] zojka: it should forward to Commission and not User as we see in the server query
[22:00:08] Inside: params[:commission] == nil
[22:00:55] Inside: it looks like should do
[22:01:14] Inside: redirect_to new_commision_url if params.try(:commission).try(:kw).nil?
[22:01:30] Inside: @commision = Commission.where(... your code... )
[22:02:03] Inside: I'm fairly sure you don't need to call rneder 'render :prodstat' since RoR will render whatever matches the action name (which is prodstat)
[22:07:34] ZAJDAN: in this way? https://termbin.com/dcjh
[22:12:27] sameerynho: has joined #RubyOnRails
[22:12:40] havenwood: ZAJDAN: if params.dig(:commission, :kw).nil?
[22:13:25] havenwood: ACTION reads the backlog
[22:14:46] havenwood: No need for that #all.
[22:14:55] zojka: boys...could be a problem, that I trigger the url directly in Browser http://.../commission/prodstat ...?
[22:15:40] zojka: and in the view/form is not value which should be send to the method 'prodstat'
[22:15:42] havenwood: I'd suggest: kw = params.dig :commission, :kw
[22:15:55] havenwood: redirect_to new_commision_url unless kw
[22:16:03] havenwood: @commission = Commission.where kw: kw
[22:16:17] havenwood: i was lazy and didn't read the backlog >.>
[22:18:28] Stabby: has joined #RubyOnRails
[22:19:04] zojka: view: https://termbin.com/3xtm
[22:19:42] zojka: and this view I trigger manually in browser http://..../commission/prodstat
[22:20:23] zojka: will in this way triggered the method in controller?
[22:21:51] zojka: if yes.....logically it will fails cause the value is empty
[22:22:20] phon: has joined #RubyOnRails
[22:23:30] zojka: so the ActiveRecord in controller will cry about the nil
[22:29:17] phon: has joined #RubyOnRails
[22:30:53] ZAJDAN: I do not know how to render directly the view where is used 'each' ...it wants iterate but so far has been not passed value for ActiveRecord
[22:32:05] ZAJDAN: probably I have to divide it into two views
[22:32:47] ZAJDAN: from one I will pass the value for ActiveRecord and controler will render it into second one view ...what do You think?
[22:44:56] kristofferR: has joined #RubyOnRails
[22:49:04] tdy: has joined #RubyOnRails
[23:08:37] kristoff_: has joined #RubyOnRails
[23:12:29] kristofferR: has joined #RubyOnRails
[23:15:53] benlieb: has joined #RubyOnRails
[23:30:26] bradleyprice: has joined #RubyOnRails
[23:45:52] Haydos: has joined #RubyOnRails
[23:56:16] bambanx: has joined #RubyOnRails