« Back to channel list

#RubyOnRails - 14 June 2019

« Back 1 day Forward 1 day »
[00:29:43] bradleyprice: has joined #RubyOnRails
[00:32:38] tdy: has joined #RubyOnRails
[00:35:15] Exuma: has joined #RubyOnRails
[00:50:38] brool: has joined #RubyOnRails
[01:05:58] NeXTSUN: has joined #RubyOnRails
[01:09:38] fragamus: has joined #RubyOnRails
[01:17:46] Guest83989: has joined #RubyOnRails
[01:32:39] duderonomy: has joined #RubyOnRails
[02:28:11] ebsen: has joined #RubyOnRails
[02:30:15] Exuma: has joined #RubyOnRails
[02:36:30] chimkan: has joined #RubyOnRails
[02:45:20] bradleyprice: has joined #RubyOnRails
[02:55:42] Xiti`: has joined #RubyOnRails
[02:56:20] sevenseacat: has joined #RubyOnRails
[02:57:32] sevenseacat: your daily reminder that sprockets is still a pain in the ass
[03:07:25] helpa: has joined #RubyOnRails
[03:08:55] Haydos: has joined #RubyOnRails
[03:10:42] braincrash: has joined #RubyOnRails
[03:13:19] helpa: has joined #RubyOnRails
[03:24:18] dtzuzu: has joined #RubyOnRails
[03:30:43] Technodrome: has joined #RubyOnRails
[03:34:39] sevenseacat: https://stackoverflow.com/questions/56591052/creating-a-new-stylesheet-during-a-request-and-then-immediately-requiring-it-giv if anyone knows about sprockets internals
[03:38:01] russt: has joined #RubyOnRails
[03:38:01] universa1: has joined #RubyOnRails
[03:38:01] lupine: has joined #RubyOnRails
[03:38:01] mjacob: has joined #RubyOnRails
[03:38:01] Quintasan: has joined #RubyOnRails
[03:38:02] arathald: has joined #RubyOnRails
[03:38:02] Momentum: has joined #RubyOnRails
[03:38:46] Haydos: has joined #RubyOnRails
[03:38:46] shtirlic: has joined #RubyOnRails
[03:38:46] szulak: has joined #RubyOnRails
[03:38:46] Cork: has joined #RubyOnRails
[03:38:46] planigan: has joined #RubyOnRails
[03:38:46] marahin: has joined #RubyOnRails
[03:41:08] oreja55: has joined #RubyOnRails
[03:44:01] Technodrome: has joined #RubyOnRails
[03:44:50] timdotrb: has joined #RubyOnRails
[04:00:26] quazimodo: has joined #RubyOnRails
[04:25:13] ariedler: has joined #RubyOnRails
[04:34:20] bradleyprice: has joined #RubyOnRails
[04:42:53] srinidhi: has joined #RubyOnRails
[04:46:08] MrCrackPotBuilde: NL3limin4t0r_afk, does this look right to you. my create controller https://pastebin.com/raw/BWEwdeJW
[04:46:43] MrCrackPotBuilde: ive ran the migrations made all the settings needed
[04:46:56] MrCrackPotBuilde: but still im getting that damn invalid signature error
[04:47:59] MrCrackPotBuilde: am i missing something do i need to add a column in the user table ??
[04:57:33] LtHummus: has joined #RubyOnRails
[05:05:01] ariedler: has joined #RubyOnRails
[05:15:02] bradleyprice: has joined #RubyOnRails
[05:33:19] hnanon: has joined #RubyOnRails
[05:34:01] hnanon: Is there any documentation for editing the trix toolbar when using actiontext and 6.0rc?
[05:34:54] conta: has joined #RubyOnRails
[05:35:24] xco: has joined #RubyOnRails
[05:38:45] bradleyprice: has joined #RubyOnRails
[06:12:10] Exuma: has joined #RubyOnRails
[06:29:30] conta: has joined #RubyOnRails
[06:37:07] lxsameer: has joined #RubyOnRails
[06:40:30] MrCrackPotBuilde: The annoying thing is ive created another branch created a polymorphic model image added this to the user and created a nested attributes just like i did with address. and it works fine
[06:40:55] MrCrackPotBuilde: but this means im sotring the image in a column in my db which is bad practice
[06:45:44] timdotrb_: has joined #RubyOnRails
[06:51:22] liKe2k1: Why is link_to called twice? I read about turbolinks and disabled it via data { turbolinks: false } but it has no affect.
[06:52:00] liKe2k1: In my erb template I have a lnk_to to an controller action
[06:53:33] sevenseacat: okay and what about it is a problem?
[06:53:56] liKe2k1: If I click on the Link, the controller action called two times.
[06:54:57] sevenseacat: can you show us the code?
[06:55:04] liKe2k1: I have no custom javascript or anything else. I found a few sites, where the problem is described and the problem was identified in the javascript library turbolink.
[06:55:11] liKe2k1: Yea please give me a second.
[06:55:13] sevenseacat: sounds plausible
[06:56:09] liKe2k1: http://dpaste.com/1Y5RP59
[06:56:33] liKe2k1: I've also added a data turbolinks: false .. but it has no affect.
[06:56:56] liKe2k1: I'f i call the target contrller directly the request called, as expected, one time.
[06:57:35] sevenseacat: it definitely sounds turbolinks-related
[06:58:25] sevenseacat: I usually remove it first thing from my projects so I'm not sure
[07:00:01] liKe2k1: The wierd thing is, in my application.js I have added //= require turbolinks
[07:12:19] schne1der: has joined #RubyOnRails
[07:18:28] conta1: has joined #RubyOnRails
[07:29:31] NL3limin4t0r: MrCrackPotBuilde: I don't have a lot of experience using active storage, but from a plain RoR perspective it looks fine.
[07:38:02] morozovm: has joined #RubyOnRails
[07:39:19] MrCrackPotBuilde: It seems active storage really only works with multi form data
[07:39:35] MrCrackPotBuilde: and my api doesnt accept multi-form
[07:40:16] crankharder: has joined #RubyOnRails
[07:41:06] bradleyprice: has joined #RubyOnRails
[07:42:02] MrCrackPotBuilde: so somehow i need to recreate a multi form request in json or come up with a complete new way of handling this. I could try a direct uplaod from the mobile app to cloud ActiveStorage then wait for a reply from the finished upload with a url. then inside the database add a column called pic url and load the user through that.
[07:42:37] MrCrackPotBuilde: load the pic through that sorry
[07:43:09] MrCrackPotBuilde: as all i really need if i understand active storage right is a public url in the database.
[07:43:55] MrCrackPotBuilde: id probably want a bit more actually so im able to find images using say image_loc column or in the storage have a column with a uniq identifier
[07:45:24] MrCrackPotBuilde: this way im not storing the image in the app but it means registering a user will take a while. it'll need to wait for the image and then wait for the post request to create the user. but resource wise its all on the device as the cloud handles the heavy lifting keeping the actual api light on resourcess
[07:58:06] ZAJDAN: MrCrack...nice things what you are doing
[08:03:12] tdy: has joined #RubyOnRails
[08:03:30] ZAJDAN: ....I have view where is used 'each' to fill table ( <% @commission.each do |kw| %> ) but in the moment when I access the URL ...value of the @commission is nil ....so it breaks on line <% @commission.each do |kw| %>
[08:04:16] Technodrome: has joined #RubyOnRails
[08:05:54] ZAJDAN: is any way how to render such form? the form contains just one INPUT a button(search).....the goal is pass into the INPUT value and via search Button send it to ActiveRecord which should return result and in same view generate table via 'each'
[08:08:02] crankharder: add 'if @commission' somewhere
[08:08:34] crankharder: or, change <% @commission.each do |kw| %> to <% Array(@commission).each do |kw| %>
[08:09:55] bradleyprice: has joined #RubyOnRails
[08:09:59] ZAJDAN: Thank YOu
[08:17:14] shtirlic: has joined #RubyOnRails
[08:28:57] tdy1: has joined #RubyOnRails
[08:35:19] shtirlic: has joined #RubyOnRails
[08:37:25] ZAJDAN: what could be the problem?...in controller I have Active record for model Commission, but it goes to model User.....https://termbin.com/2uyw
[08:43:32] xco: has joined #RubyOnRails
[08:47:48] crankharder: dont see 'commission' in the list of Parameters there
[08:49:13] srinidhi: has joined #RubyOnRails
[08:50:03] ZAJDAN: crankharder ..do you mean declare the parameter commission in the method?
[08:50:49] Ergo: has joined #RubyOnRails
[08:52:23] ZAJDAN: I thought the parameter is set in the ActiveRecord
[09:09:42] drale2k_: has joined #RubyOnRails
[09:15:36] ZAJDAN: I am confuse....as greenhorn with rails I have problem understand what is the difference between 'arguments' and 'parameters'
[09:22:32] NL3limin4t0r: ZAJDAN: In RoR context parameters mostly refers to `params` in the controller. Whereas arguments are simply values passed to a method.
[09:25:12] ZAJDAN: NL3...thnx
[09:26:43] crankharder: has joined #RubyOnRails
[09:27:41] ZAJDAN: and in method when I call ActiveRecord ...something like this: @commission = Commission.where(:kw => params[:commission][:kw]).all ...it is not enought information about the params ?
[09:28:20] ZAJDAN: it except that such params I will declare somewhere?
[09:29:00] khanchi97_: has joined #RubyOnRails
[09:35:02] ZAJDAN: or the params itself in the Activerecord is enought?
[09:39:15] conta: has joined #RubyOnRails
[09:45:35] NL3limin4t0r: ZAJDAN: `params` is only avaible in the controller, views and the view helpers. If you need the value of an parameter in the controller you should pass it as an argument.
[09:46:50] mello: has joined #RubyOnRails
[09:47:22] NL3limin4t0r: For example let's say I have the scope `scope color, ->(color) { where(color: color) }` in the controller I can do `Bike.color(params[:color])` (assuming the color parameter is present).
[09:51:13] NL3limin4t0r: So you should ask yourself, why do you need to access the request parameters in the model at all?
[09:52:52] ZAJDAN: I am old machine and together greenhorn...I need imagine the abstract as real things, so that I could understand
[09:55:57] ZAJDAN: if you can look here please: https://termbin.com/zmxcp
[09:57:01] ZAJDAN: in controller method I speak about model Commission ...why I see in puma server that the request has been sent to model User ..?
[09:59:35] ellcs: has joined #RubyOnRails
[09:59:57] lunarkitty7: has joined #RubyOnRails
[10:03:42] conta: has joined #RubyOnRails
[10:07:25] srinidhi: has joined #RubyOnRails
[10:09:31] uksio: has joined #RubyOnRails
[10:13:01] crankharder: has joined #RubyOnRails
[10:16:38] ghormoon: has joined #RubyOnRails
[10:24:15] Saukk: has joined #RubyOnRails
[10:38:14] xco: has joined #RubyOnRails
[10:55:08] ariedler: has joined #RubyOnRails
[10:59:48] ellcs: has joined #RubyOnRails
[11:00:35] lankanmon: has joined #RubyOnRails
[11:00:48] NL3limin4t0r: ZAJDAN: In the controller you do `params.try(:commission).try(:kw)` which would be similar to `params.commission.kw` which is not what you want.
[11:02:37] NL3limin4t0r: ZAJDAN: That should be `params[:commission][:kw]` or `params.require(:commission).require(:kw)` or `params.dig(:commission, :kw)`.
[11:03:25] ZAJDAN: ok ok...gonna try
[11:04:17] NL3limin4t0r: `params.commission` doesn't exists and would normaly raise a NoMethod exception, so `params.try(:commission)` will always return `nil`.
[11:06:01] ZAJDAN: do I understand corectlly that in that way I will not need in the metfod condition IF ?
[11:21:58] crankharder: has joined #RubyOnRails
[11:26:36] gb_away: has joined #RubyOnRails
[11:35:39] ZAJDAN: but somehow i have to prepare the method when the parameter will arrive with 'nil'
[11:41:46] NL3limin4t0r: ZAJDAN: You can still do so `kw = params.dig(:commission, :kw); if kw; ... else; ... end`
[11:43:03] ZAJDAN: such syntax is nonsens : if params.require(:commission).require(:kw).nil? ...?
[11:45:25] drale2k_: has joined #RubyOnRails
[11:59:08] NL3limin4t0r: If you use `require` you can assume that the parameters are provided. Otherwise a ActionController::ParameterMissing exception will be raised.
[11:59:54] conta2: has joined #RubyOnRails
[12:13:59] ZAJDAN: NL3: https://termbin.com/186f
[12:16:53] ZAJDAN: but seems to be , that the ActiveRecord is not triggered
[12:25:43] NL3limin4t0r: From you other link (https://termbin.com/2uyw) it seems that you don't submit the parameter in nested context. You should simply use `params.require(:kq)` or `params[:kw]`.
[12:26:03] NL3limin4t0r: Or change the view to match the expected structure.
[12:27:44] GodFather: has joined #RubyOnRails
[12:29:59] ZAJDAN: yeees..now I see it in the view: <input id="kw-block1" value="25" type="text" name="kw"> ... it should be ....<input id="kw-block1" value="25" type="text" name="commission[kw]">
[12:30:35] ZAJDAN: or probably <input id="kw-block1" value="25" type="text" name="commission[commission_kw]">
[12:43:50] drale2k_: has joined #RubyOnRails
[12:46:54] ZAJDAN: but why the form doesnt genereate: name="commission[kw]" ....?
[12:48:16] ZAJDAN: and genereates just: name="kw"
[12:49:11] ZAJDAN: could be that cause I trigger the URL manually in a browser?
[13:04:26] MrCrackPotBuilde: grrr why doesnt active storage just accept json pmsl
[13:04:52] drale2k_: has joined #RubyOnRails
[13:05:00] conta: has joined #RubyOnRails
[13:10:01] apparition: has joined #RubyOnRails
[13:33:40] GodFather: has joined #RubyOnRails
[13:49:40] conta: has joined #RubyOnRails
[13:58:04] NL3limin4t0r: ¯\_(ツ)_/¯
[14:08:55] deathwishdave: has joined #RubyOnRails
[14:10:27] Saukk: has joined #RubyOnRails
[14:26:09] ZAJDAN: NoMethodError in Commissions#prodstat undefined method `to_model' ..... <%= form_with model: @commission, local: true, :html => {:id => "prod-manage"} do |f| %>
[14:27:56] Dr_MDMA_MD: has joined #RubyOnRails
[14:28:40] Exuma: has joined #RubyOnRails
[14:39:36] powerbit: has joined #RubyOnRails
[14:56:39] Exuma: has joined #RubyOnRails
[14:58:51] lato_1: has joined #RubyOnRails
[14:59:21] Inside: has joined #RubyOnRails
[15:00:52] Inside: so many errors after updating from 5.1 to 5.2 c_C
[15:09:54] ZAJDAN: I have also many many errors ...but because of my low knowleadge :_) :(
[15:15:21] Inside: fix your stuff from last night?
[15:20:37] ZAJDAN: something yes, but something else I am facing
[15:27:40] Inside: I have a feeling that my low test coverage is about to bite me in the ass
[15:31:14] bradleyprice: has joined #RubyOnRails
[15:32:06] deathwishdave: has joined #RubyOnRails
[15:36:07] ZAJDAN: I have also many many errors ...but because of my low knowleadge :_) :(
[15:36:33] ZAJDAN: sorry pasted old
[15:37:37] NL3limin4t0r: Inside: Errors or warnings? Deprecation warnings aren't errors.
[15:38:17] yoshie902a: has joined #RubyOnRails
[15:38:49] NL3limin4t0r: The largest issue I faced upgrading 5.1 to 5.2 was the fact that the `attribute_changed?`, `attribute_was` and `changes` behave differently after save.
[15:39:39] yoshie902a: Could use an opinion. I havr a class named Dropdown, to namespace all my models associationed with my Form Dropdowns, checkboxes, mult-selects. I wanted to change the name something more general. Any recommendations?
[15:40:34] NL3limin4t0r: They are now `saved_changes_to_attribute?`, `attribute_before_last_save` and `saved_changes` respectively.
[15:42:19] yoshie902a: FormCollections? Collection? InputSelects?, what would be most understandable
[15:44:57] NL3limin4t0r: yoshie902a: What is the usage of the instances of the model? "associationed with my Form Form Dropdowns checkboxes, mult-selects" isn't really specific. Are they used to build the form elements?
[15:47:29] yoshie902a: Yes, they are used to build the form elements, however, this is a top namespace for my other name spaces, for exame, Dropdown::Car:Color.all, or Dropdown::Truck::LoadSize.all, etc
[15:47:53] yoshie902a: Dropdown::Address:Country.all
[15:48:04] Vaevictus: i'm converting a cli script to a little sinatra app... how should i replace my "exit" calls (for quitting after an error, for example?)
[15:48:29] xco: has joined #RubyOnRails
[15:48:49] yoshie902a: So there will be multiple sub-namespaces based on topic, but just trying to get the overall namespace to make sense for others
[15:49:02] agent_white: has joined #RubyOnRails
[15:54:20] Vaevictus: (found my answer, it's "halt")
[15:56:01] ZAJDAN: is difference when I forward to controller method from form via button with JS instead of native RoR button actions?
[15:56:51] uksio: has joined #RubyOnRails
[15:57:48] ZAJDAN: https://termbin.com/sbgy
[15:58:34] fragamus: has joined #RubyOnRails
[16:06:14] Inside: NL3limin4t0r: actual errors because I was still running belongs_to is optional
[16:06:30] Inside: and apparently having multiple new_Framework_defaults made it so that one of the files wouldn't load, etcetc
[16:06:39] Inside: anyway - it's all been monkey patched
[16:13:54] ZAJDAN: <%= form_with model: @commissions ...why here it have tu be PLURAL ...?
[16:14:17] ZAJDAN: <% Array(@commission).each do |kw| %> ...and here SINGULAR
[16:14:22] Inside: because that's the variable you used in your controller
[16:14:42] Inside: you can name it @omg_banana if you wanted to
[16:14:58] ZAJDAN: such small things took me 2 days...omg
[16:15:38] ZAJDAN: in controller I have the variable SINGULAR
[16:17:13] ZAJDAN: could be a problem that : <%= form_with model: @commission and <%= form_with model: @commission ..use same variable?
[16:17:39] ZAJDAN: in my case it was actually the problem
[16:18:23] Inside: you'll need to paste code for us to do anything
[16:19:39] ZAJDAN: Inside: https://termbin.com/zmxcp
[16:20:30] Inside: so what's the problem?
[16:20:44] ZAJDAN: I was not able to find the problem....after that I changed in the view/form <%= form_with model: @commission ...to .... <%= form_with model: @IamHollow ..it worrks
[16:21:42] ZAJDAN: same variable name in: <%= form_with model: @commission ......and .....<% Array(@commission).each do |kw| %> ...makes problem
[16:25:00] Inside: I don't understand your code
[16:25:04] Inside: but in your prodstat action
[16:25:19] Inside: you basically render prodstat.html.erb 100% of the time
[16:26:57] ZAJDAN: Inside: http://pasteall.org/pic/show.php?id=ed0ead118a80992e743a7a804fd651b0
[16:27:05] ZAJDAN: this all means my code
[16:27:08] Inside: can you use gist.github.com :)?
[16:27:27] ZAJDAN: yes why not..I listen it firstlly
[16:27:36] Inside: I still don't understand
[16:27:38] Inside: do you have a problem?
[16:28:07] ZAJDAN: after that I chnaged the variable name in <%= form_with model: @IamHollow ..it worrks
[16:29:00] ZAJDAN: what means the variable in the <%=form_with ....?
[16:30:18] ZAJDAN: actually I do not need the variable there....but Iam confuse why I have put it there
[16:30:55] ZAJDAN: and to avoid same problems in the future I would like to know why sometime is need to place the variable there and sometime not
[16:31:45] ZAJDAN: without understand the logic/meaning ...I will do same stupid problems
[16:34:45] tdy1: has joined #RubyOnRails
[16:36:26] duderonomy: has joined #RubyOnRails
[16:38:45] bradleyprice_: has joined #RubyOnRails
[16:44:56] xco: has joined #RubyOnRails
[16:45:53] drale2k_: has joined #RubyOnRails
[16:48:11] schne1der: has joined #RubyOnRails
[16:52:50] bradleyprice: has joined #RubyOnRails
[16:52:54] NL3limin4t0r: yoshie902a: If they're all form helpers. I would say go for something like FormHelper::Dropdown::Car or FormHelper::Collection::Car
[16:53:39] yoshie902a: They are Models that contain my dropdown/checklist data lists
[16:54:00] orbyt_: has joined #RubyOnRails
[16:54:31] yoshie902a: So currently, I have app/models/dropdown/car/color.rb, app/models/dropdown/car/size.rb
[16:55:23] yoshie902a: I am trying to replace Dropdown with something more general, but specific enough that people now what they are used for
[16:55:46] NL3limin4t0r: FormCollection ?
[16:56:19] yoshie902a: Is rails convention FormCollections, or FormCollection ?
[16:56:49] yoshie902a: I was tending toward, FormCollection, but something bothers me about it.
[16:57:13] yoshie902a: why is naming objects so hard
[16:57:30] NL3limin4t0r: I just saw you already proposed that name before. But I'll have a quick look for you in their source about plural or sigular form.
[17:01:12] NL3limin4t0r: Rails mostly uses plural form. eg. ActiveRecord::Associations::Association, ActiveRecord::Associaions::HasManyAssociation, ActiveRecord::Validations::Presence, etc.
[17:04:46] deathwishdave: has joined #RubyOnRails
[17:05:39] Inside: ok.. upgraded to rails 5.2
[17:05:44] Inside: also published.
[17:05:48] Inside: ACTION waits for error reports to come in.
[17:05:52] Inside: ACTION twiddles thumbs.
[17:09:00] NL3limin4t0r: ZAJDAN: Rails works pretty simple. A request comes in at a sertain url, that url will be handled by a certain controller (visible through `bundle exec rails routes`). The action that handles the request sets the instance variables that carry over to the view. If no view is specified the default view is used (for users#index (UsersController) that would be views/users/index).
[17:10:57] NL3limin4t0r: ZAJDAN: Instance variables (@some_name) also carry over to partial, but I would reccomend against the use of those variables there. Instead pass the instance variables as locals, so you can use other names in other controller actions.
[17:12:20] NL3limin4t0r: ZAJDAN: When rendering a partial use something like (users#index) `render 'users/user_table', users: @users`.
[17:13:35] NL3limin4t0r: ^ The above should be in the view. When using ERB this would become `<%= render 'users/user_table', users: @users %>`
[17:14:25] ZAJDAN: I have in table boolean columns which returns false/true....I would like to display it in the view as 0 or 1 ...for this I must use JS?
[17:14:44] ZAJDAN: NL3 ...thank You
[17:16:05] NL3limin4t0r: I mostly use the checkmark (✓) for booleans. `<%= '✓' if instance.your_boolean_attribute %>`
[17:16:53] NL3limin4t0r: But you can use 1 and 0 if you like. `<%= instance.your_boolean_attribute ? 1 : 0 %>`
[17:17:50] ZAJDAN: wooow..super ..tthank You
[17:18:54] duderonomy: has joined #RubyOnRails
[17:19:39] NL3limin4t0r: ACTION looks curious in the direction of Inside
[17:22:56] tdy: has joined #RubyOnRails
[17:23:47] ZAJDAN: no matter where I will place <%= '✓' if instance.your_boolean_attribute %> in the view?
[17:24:44] NL3limin4t0r: Assuming that you have `instance` in the whole view, yes.
[17:25:49] ZAJDAN: Iam trying: <%= '✓' if instance.cad %> ...but NameError in Commissions
[17:26:26] NL3limin4t0r: You mustn't take the `instance` literal. Replace it with your variable.
[17:27:04] NL3limin4t0r: For example `<%= '✓' if @commission.cad %>`
[17:27:40] ZAJDAN: it expect 'true' to handle it for the '✓' ?
[17:28:38] NL3limin4t0r: Sort of, all truthy values will output the checkmark while falsy values won't output anything.
[17:28:54] uks: has joined #RubyOnRails
[17:29:19] ZAJDAN: <%= '✓' if @commission.cad %> ...still returns NoMethodError in Commissions#prodstat undefined method `cad' for #<Commission::ActiveRecord_Relation:0x007fa9dc2cee98>
[17:31:54] NL3limin4t0r: ZAJDAN: You're calling it upon a collection. It seems like you @commission accually holds multiple commissions.
[17:32:33] NL3limin4t0r: Loop though them and handle them one by one, or make sure you have a single instance to start with.
[17:32:41] ZAJDAN: <%= '✓' if @commission.cad %> <% Array(@commission).each do |kw| %>
[17:33:10] ZAJDAN: ActiveRecord return collection/array ...yes
[17:33:31] NL3limin4t0r: In that case you should do `<%= '✓' if kw.cad %>` inside the #each block.
[17:33:49] ZAJDAN: aha! ..okok thank You
[17:34:26] orbyt_: has joined #RubyOnRails
[17:35:24] fyber: What's the easiest way to deploy rails apps? I'm okay with using a commercial service (I looked at nanobox but they're closed for new signups).
[17:35:47] yoshie902a: fyber: Heroku
[17:37:01] fyber: yoshie902a: You get kinda a garbage server for $25/month though, right?
[17:37:14] fyber: Same spec box is almost 10x less on DigitalOcean or Vultr
[17:37:38] yoshie902a: You said easist, not cheapest
[17:37:55] fyber: is there something less easy but not as expensive?
[17:38:05] yoshie902a: You can look at AWS Beanstalk, but it’s not as easy
[17:38:30] yoshie902a: It’s Amazon’s version of Heroku
[17:38:38] yoshie902a: but without the markup
[17:39:23] yoshie902a: Last I checked Heroku is 30% more then AWS, as heroku is hosted on AWS
[17:39:31] fyber: makes sense
[17:40:33] yoshie902a: unless you are a big firm, I highly recommend you use a heroku like service, and do not try to use AWS directly, you do not want to manage ops.
[17:40:50] yoshie902a: BeanStalk would fit the bill
[17:42:21] fyber: right now we're using Docker, but deploying a new image with Docker is actually time consuming and error-prone
[17:42:30] sameerynho: has joined #RubyOnRails
[17:42:48] yoshie902a: I find Heroku to be worth the extra money for small apps
[17:43:16] yoshie902a: I have no ops to deal with and deloying staging is awesome too
[17:44:25] yoshie902a: I have head of Clever Cloud, but have never use it.
[17:45:31] yoshie902a: and Google App engine, might also be a solution for you,but again, never used it
[17:45:58] NL3limin4t0r: fyber: Maybe less easy, but you could use your own (or digital oceans) server in combination with capistrano. I've not mutch experience with the setup (that's done by somebody else) but I simply type `cap production deploy` to deploy the application.
[17:46:38] fyber: oh, that sounds good
[17:46:45] ZAJDAN: NL3....the checkmark appears above the table
[17:47:08] ZAJDAN: not in the right <td>
[17:49:16] NL3limin4t0r: fyber: The setup is definitly not the "easiest way to deploy rails apps", but re-deploying is pretty easy.
[17:50:16] fyber: yeah the re-deploying part is more what I'm worried about
[17:50:34] fyber: of course less first time setup would be nice
[17:50:42] fyber: but if that's what it takes...
[17:51:28] ZAJDAN: NL3...solved: <td><%= '✓' if kweek.cad %></td>
[17:52:00] NL3limin4t0r: ZAJDAN: I was about to say. You'll have to place the ERB code in the right spot.
[17:52:11] ZAJDAN: thank You
[17:55:40] NL3limin4t0r: fyber: https://github.com/capistrano/rails
[17:56:38] NL3limin4t0r: fyber: https://github.com/capistrano/rvm
[17:58:10] NL3limin4t0r: ACTION looks at the time and realizes he has to go
[17:58:58] yoshie902a: Fyber: capistrano is fine when things do not change,but you’ll have to update your scripts when updates happen, so there is more maintence too
[18:01:40] yoshie902a: has left #RubyOnRails: ()
[18:01:48] NL3limin4t0r_afk: It depends on the type of updates. The only time I need to change something is when the Ruby version changes. It backups the old codebase, pulls the new one from git, runs bundle install and migrations etc.
[18:02:15] NL3limin4t0r_afk: And starts the server.
[18:02:38] NL3limin4t0r_afk: But I'm gone for real now. GL fyber
[18:15:24] GodFather: has joined #RubyOnRails
[18:41:29] Inside: I run capistrano
[18:41:30] Inside: it's pretty good
[18:41:45] Inside: the only downside is that it works so well most of the time that I forget how to deploy things without it.
[19:13:58] bradleyprice: has joined #RubyOnRails
[19:27:32] bradleyprice: has joined #RubyOnRails
[19:35:20] bradleyprice: has joined #RubyOnRails
[19:59:04] s2013: has joined #RubyOnRails
[20:01:20] GodFather: has joined #RubyOnRails
[20:01:51] kapilp: has joined #RubyOnRails
[20:24:16] shansen: has joined #RubyOnRails
[20:33:39] tdy: has joined #RubyOnRails
[20:35:02] SteenJobs: has joined #RubyOnRails
[20:37:20] Inside: how does one create a clustered index on a table?
[20:43:54] bradleyprice: has joined #RubyOnRails
[20:47:14] dviola: has joined #RubyOnRails
[20:53:38] bradleyprice: has joined #RubyOnRails
[20:57:50] duleja: has joined #RubyOnRails
[20:58:21] duleja: so many people here...
[20:58:45] Inside: so many crickets
[20:58:49] duleja: hi Inside
[20:59:18] duleja: maybe you can share some good tutoriala with image upload with rails without gems?
[21:00:11] duleja: I am having some issues with has_many and permiting nested form ... So if you maybe have something on that it would be great :) I always find paperclip or activestorage documentation...
[21:01:19] ZAJDAN: in view I generate form and I do not know whyt and beyond defined <td> it generates one empty which should not be there
[21:03:32] duleja: hi ZAJDAN
[21:03:51] duleja: Not sure that I am following you
[21:04:15] duleja: I am wondering what is the best approach with file_field in forms (nested or not)
[21:05:32] duleja: You submit file to controller through params and you can access it and, you can build your image (or whatever the file is) in the controller but should I permit that file in the strong parameters? I need later file.original_name as a path and to store file in my file store with File.open, etc...
[21:06:56] ZAJDAN: duleja: Iam greenhorn with RoR..just 3 week I am trying create small app
[21:07:04] duleja: oh sorry...
[21:07:40] ZAJDAN: same app which I completely made in(PHP,AJAX,JS) Iam creating now in RoR
[21:07:49] duleja: is it going ok?
[21:07:50] Inside: duleja: what's wrong with active storage?
[21:08:15] Inside: active storage is probably the best/easiest file upload method right now
[21:08:28] ZAJDAN: duleja: for me not....RoR is for me something from universe
[21:08:45] duleja: nothing... I just want to create something like User and Image and to save image in the local store and only path to that image in the images table
[21:09:01] Inside: active storage does exactly that ;)
[21:09:03] duleja: you don't like RoR?
[21:09:09] duleja: I know Inside :)
[21:09:17] Inside: okay so - how can I help you? :P
[21:09:30] duleja: thanks for your time :)
[21:09:44] ZAJDAN: duleja: like...but Iam older machine and not profesional programmer..not easy for me....and also Iam not native english speaker :(
[21:10:13] duleja: and like I said lets say we have two tables, User and UserImages... I would like to store only filenames to UserImages (this will be a path to my local store folder)
[21:10:37] duleja: I have hard time figuring out what should I permit in the controller in the form, since I will pass
[21:10:39] duleja: file_filed
[21:10:43] duleja: that will hold an image
[21:11:00] Caly`: has joined #RubyOnRails
[21:11:00] duleja: and I should accept nested parameters for example... Or should I create attr_accessor in the model
[21:11:02] Inside: duleja: Okay so, active_storage has a local file store
[21:11:21] Inside: or are you specifically trying to not use it?
[21:11:33] duleja: i would like to go without any gems with this
[21:11:48] Inside: do you want rails to just store the filename, or do you want it to actually copy the file over?
[21:12:07] Inside: (use #1 would be for a local-only application of limited use)
[21:12:15] duleja: both, store image_name from the image in the images table
[21:12:25] duleja: and File.open ... to create it localy
[21:12:52] duleja: and I am ok with that I know how to create file on the machine but I am trying to figure out the strong params part
[21:12:53] Inside: duleja: so that you understand, what you are asking is about 100x harder than just using activestorage
[21:12:56] Inside: are you ok with that?
[21:13:23] duleja: only thing I have an issue with is like I said
[21:13:30] duleja: what should I add inside strong params
[21:13:33] duleja: since I am passing a file
[21:13:50] duleja: and I will take file and do like params[:file].original_filename
[21:13:52] Inside: are you able to get it to pop up a file selection dialog?
[21:14:06] Inside: in the browser?
[21:14:10] duleja: selection dialog?
[21:14:13] duleja: not sure what is that
[21:14:26] Inside: the.. "SELECT A FILE.." file browser whenever you click upload
[21:14:38] duleja: I can send it to controller
[21:14:46] duleja: as a file or whathever I name the file_field...
[21:15:02] duleja: but my table has only "path" as a string
[21:15:11] duleja: where i will save params[:file].original_filename
[21:15:45] duleja: so I am not sure what should I permit inside strong params in the create action for that User since I am building image for user
[21:15:55] duleja: how you go with this?
[21:16:12] Inside: can you paste some code?
[21:16:57] duleja: def user_params params.require(:user).permit(:email, :name, user_images_attributes:[:title]) end
[21:17:19] duleja: params.require(:user).permit(:email, :name, user_images_attributes:[:title])
[21:17:25] duleja: these are the params
[21:17:51] duleja: so here I am permiting only title since title will be used for storign the path to the image on my local computer
[21:18:06] duleja: but from the form I am sending file_field named :file
[21:20:37] duleja: So I am passing file in the params but i will later take original_filename from that file and assign it to :title
[21:22:09] Inside: so far so good
[21:22:46] duleja: I am not sure if I should even to some user_images_attributes in the strong params
[21:23:08] duleja: since I can access the file I can just take from it what I need and pass build an association in the controller
[21:23:28] duleja: that is maybe also ok
[21:24:34] duleja: sorry, I am not sure if I should even add "user_image_attributes: [:title]" inside strong params
[21:25:05] duleja: I could just pass a file from the form and build associated object through user taking filename from file and assigning it to the user_image
[21:25:14] duleja: I am not sure it that should be ok though...
[21:34:48] duleja: well I guess that I was doing ok
[21:34:48] duleja: https://stackoverflow.com/questions/23977780/how-can-i-use-strong-parameters-for-a-file-field-that-is-not-directly-in-the-dat
[21:40:37] SteenJobs: has joined #RubyOnRails
[21:43:43] duleja: hah, still not sure how to do it
[21:43:47] duleja: but anyway Inside
[21:43:52] duleja: thank you for your time!
[21:49:31] ZAJDAN: is possible change css in generated form according to boolean value?
[21:49:39] ZAJDAN: without JS
[21:50:16] duleja: change css in the views?
[21:50:24] duleja: load different class
[21:50:46] duleja: you can do that.. just add if else inside view
[21:51:04] ZAJDAN: <td><%= '✓' if kweek.cad %></td> if true set class 'someClass'
[21:52:11] duleja: go with this
[21:53:07] duleja: <td class="<%= kweek.cad ? 'someClass' : 'someOtherClass' %>" >
[21:53:36] ZAJDAN: ok gonna try it
[21:56:40] ZAJDAN: thanks...works
[21:56:59] duleja: no problem ZAJDAN
[21:57:03] duleja: glad to help
[21:57:09] ZAJDAN: and how to combine with : '✓' if
[22:00:04] ZAJDAN: or put the '✓' via css ?
[22:00:37] duleja: try to go with regular if else
[22:00:44] duleja: <%- if kweek.cad %>
[22:00:49] duleja: <td class="SomeClass"%> "✓"</td>
[22:00:55] duleja: <%- else %>
[22:00:59] duleja: <td class="SomeOtherClass"> "some text" </td>
[22:01:03] duleja: <%- end %>
[22:01:14] ZAJDAN: ufff gonna try
[22:03:17] ZAJDAN: but I fill the table dynamically via each do
[22:04:22] ZAJDAN: woooow! works
[22:04:33] ZAJDAN: you put spell on it :_)
[22:04:40] ZAJDAN: thank You
[22:05:42] duleja: that is a basic if else statement, glad it worked
[22:07:24] ZAJDAN: duleja: Are You from Serbia?
[22:08:12] ZAJDAN: nice I am from Czech republic....at year 2000 I was 8 months as soldier at Bosnia
[22:08:41] ZAJDAN: DonjaLubia, BanjaLuka, Sarajevo
[22:08:44] duleja: hmmm okay :)
[22:08:54] duleja: but war was in 90's
[22:09:14] ZAJDAN: KOSOVO is still hot topic
[22:09:49] ZAJDAN: 3 months before I listened song 'Serbia strong' :_)
[22:10:11] ZAJDAN: it was big hit on internet
[22:10:33] duleja: what were you doing in Bosnia?
[22:11:08] ZAJDAN: as soldier....telecomunication battalion
[22:11:42] duleja: well soldier in the peace time :)
[22:11:52] ZAJDAN: was 20 years young boy without knowleadge about politics
[22:12:00] ZAJDAN: yes I was SFOR
[22:12:13] duleja: and now you are doing ROR :)
[22:12:21] ZAJDAN: yes :_) funny
[22:13:00] ZAJDAN: I do not want to be connected to Army anymore
[22:13:10] ZAJDAN: I hate politics and all arround it
[22:13:50] ZAJDAN: but fortunately Czech and Serbian are Slavs
[22:14:00] ZAJDAN: so we was welcome there
[22:14:34] duleja: bosnians are slavs also but just who cares...
[22:14:52] ZAJDAN: mainly Serbian are Slavs
[22:15:08] duleja: really :)
[22:15:15] ZAJDAN: of course
[22:15:25] duleja: if you say so :) :) :) :)
[22:15:33] ZAJDAN: it is fact :_)
[22:15:51] duleja: and others are?
[22:16:36] ZAJDAN: serbian as Slavs are Mojority
[22:17:21] ZAJDAN: Proto-Slavic root
[22:23:52] ZAJDAN: gonna fishing....get power for next derailment :_)
[22:24:43] duleja: I am still looking how to solve my issue
[22:24:53] duleja: friday 00:24
[22:25:01] duleja: once I was normal person...
[22:25:16] ZAJDAN: I would like to help You, but Iam beginner
[22:27:03] duleja: learn ruby stay out of trouble :)
[22:29:00] orbyt_: has joined #RubyOnRails
[22:35:13] bradleyprice_: has joined #RubyOnRails
[22:45:22] tdy: has joined #RubyOnRails
[22:48:29] LtHummus: has joined #RubyOnRails
[23:01:59] _aeris_: has joined #RubyOnRails
[23:07:06] Exagone313: has joined #RubyOnRails
[23:17:24] brool: has joined #RubyOnRails
[23:32:36] dviola: has joined #RubyOnRails
[23:37:20] Xiti: has joined #RubyOnRails
[23:44:51] ur5us: has joined #RubyOnRails