Page 1 of 2 | Next »
[11:43:31] hightower4: Hey, what string helpers can I use to 1) strip all HTML out of string, and 2) remove all newlines in it?
[14:04:05] hightower4: Why does full_sanitizer.sanitize(string) produce some non-ascii character when the input contains , but it passess all other entities like & untouched?
[10:43:29] hightower4: Hey, I install rails 5.2.0 specifically and run "rails new -d postgresql --skip-turbolinks myapp". But, as part of this, rails invokes bundler and it installs rails 5.2.1 among some other 5.2.1 things. How can I stop this from happening and keep rails 5.2.0?
[11:11:14] hightower4: Radar, same thing: I run 'gem list' and see "rails (5.2.0)", so surely only rails 5.2.0 is installed. rails -v also reports 5.2.0. But when I run 'rails _5.2.0_ new -d postgresql --skip-turbolinks myapp', in the gems list resulting from bundle install I see: fetching/installing activesupport 5.2.1, actionpack 5.2.1, and so on
[11:17:09] hightower4: Because I want to add 'solidus' gem which brings in some dependencies which are broken on 5.2.1 (the polyamorous gem and some other things)
[11:20:33] hightower4: (from a cursory look at the bug report, polyamorous and ransack fail with 5.2.1. I've taken care of that migrations issue by just commenting the offending part which I didn't need anyway, but then ran into other issues somewhere else)
[11:25:28] hightower4: via gems, yes. I am not sure if the versions are set correctly in their Gemfiles or not, but the install path of install ruby, install rails, add solidus gem, run bundle, doesn't work
[11:29:01] hightower4: Right, saw it. Ok, great, thanks for the discussion and help. (In the meantime I got it working by preventing automatic bundle install and setting rails version in Gemfile to 5.2.0 specifically)
[05:01:03] hightower4: Based on http://stackoverflow.com/questions/27349583/change-an-instance-of-a-parent-class-into-a-child-class, looks like no offhand way
[16:11:05] hightower4: Hey, why when I run ruby program as root it works, but when I run it as a regular user it says: "Ignoring curb-0.8.8 because its extensions are not built. Try: gem pristine curb --version 0.8.8"
[18:43:08] hightower4: Hey, when compiling Ruby, how do I specify extra gems that I want built/installed along with Ruby? I assume it has to be something with 'bundled gems'
[19:06:59] hightower4: drbrain, right, that's what I did but it had no effect. I ran make clean, repeated configure and re-ran make install, but only the default "default" and "bundled" gems were installed, not the ones I added
[19:13:42] hightower4: drbrain, hm, maybe 'make clean' wasn't enough to trigger reinstall, ok, thanks for double checking
[00:39:34] hightower4: Hey, when rails is searching for a view template, it also searches for :v10, :v9, :v8 etc.. How could I disable search by version?
[13:33:55] hightower4: Hey, is there a practical difference in saying class X < Y ... end versus X = Class.new Y do ... end ?
[00:52:55] hightower4: Hey, did someone successfully read keyboard input from /dev/input/eventXX and if so, how?
[00:57:12] hightower4: adaedra, well, I am reading input from a device that emulates a keyboard (letters, numbers, newline). How would you read it?
[01:00:56] hightower4: Papierkorb, because it must not act as a system keyboard. I need to be able to open it as a separate device
[01:04:06] hightower4: Reading from /dev/input seems more trivial than using libusb, since the data is almost ready for use. The example in C which works is http://www.thelinuxdaily.com/2010/05/grab-raw-keyboard-input-from-event-device-node-devinputevent/
[01:04:38] hightower4: It must be comparably simple in Ruby, but I was trying with libevdev gem, and I wasn't getting good data out from it
[17:13:35] hightower4: Hey, I'm using the libevdev gem to read /dev/input/eventXX, and it is producing correct results, but the events are buffering somewhere and even though my loop is just fine: "loop do; Libevdev.next_event(evdev, Libevdev::READ_FLAG_NORMAL, event.pointer)", the next_event() function is blocking even though events are already available, and I need to generate even more events to cause next_event() to continue and process them all. Any ideas?
[15:28:11] hightower4: Hey, I'm using devise and when I create a new user, only email is saved into the user record and not other fields (name, surname) which were filled in. Where do I tell devise to check and save those too?
[15:33:05] hightower4: tbuehlmann, not really, I do have those params added there, and I'm not receiving any error - it's just that the fields are not saved when a new registration is created, but they are saved if I later go to edit and update the profile
[22:29:37] hightower4: Hey, how would I match words with two identical, repeating letters, like 'aa' or 'egg'?
[22:30:16] hightower4: kiki_lamb, just a match or no-match, so that I can remove those words from the list
[16:44:55] hightower4: Hey, in a rails app, if I want to store basic info somewhere, like the site name, phone number, email etc., what's the convenient way to store and display that info?
[03:22:54] hightower4: Hey, within an extension, is there a variable/location containing the extension's name? (E.g. in an install generator)
[01:18:06] hightower4: Hey gents, I'm looking to hire a rails/spree/solidus developer. If interested, please privmsg me, thanks.
[01:23:27] hightower4: It's a figure of speech when one is addressing unspecific audience. But I did not want to add noise to the channel, so given my thanks for your correction, I would assume that we'd be OK with dropping the subject.
[01:25:17] hightower4: Radar, yes, I did and actually made some contributions myself, but they seemed too busy with other projects to help in a way that'd assume some commitment beyond IRC help
[01:26:22] hightower4: Radar, Oh yes, I asked specifically and got referred to one specific person, which replied after 7+ days and didn't seem too available
[01:28:50] hightower4: What's the best way to go about serving a generally static file, such as /test.js, but after being parsed with ERB? (E.g. if I would want a request for /test.js to go /test.js.erb and parsed into final .js before delivering, what's the optimal way to do it?)
[09:28:11] hightower4: Hey, if I would want request for e.g. /test.js to go directly to some file under an arbitrary path, like /somewhere/my/test.js, what should I specify in config/routes.rb?
[09:30:15] hightower4: arup_r, right, I mean how would I add a currently non-existing route (for /test.js), and make it return a file from an arbitrary location on the disk?
[09:31:38] hightower4: arup_r, right, static file, /test.js to return contents of e.g. /my/file/test.js
[09:32:12] hightower4: arup_r, oh right, I thought I had to have a route for that as well. Certainly, thanks
[09:37:06] hightower4: arup_r, although I see now my files are not exactly static, they are supposed to go through a handler before being delivered, so I'll have to add some routes to help that
[00:37:23] hightower4: Hey, when I have f.field_container and the form is shown, existing values are already pre-filled. How can I manually retrieve the current value of a field to modify its actual value: before display?
[00:38:17] hightower4: (Like, for the purpose of a dropdown -- I would like to retain current selection, or select a default entry if no current value exists)
[01:32:13] hightower4: Hey, how do I retrieve the current URL in a rails app, or more specifically, how would I change the locale? E.g. if the user is on /en/profile/show and wants to switch to locale "de", how would I redirect him to /de/profiles/show?
[01:37:18] hightower4: pontiki, right, I was hoping there would be some more automated way, but this will certainly do. Thanks
[01:39:01] hightower4: Sigma00, right, sure, but I need to replace the current locale with a new one, while not redirecting the user to the main page but reloading the page they are currently on
[01:42:30] hightower4: pontiki, yes, right, the issue is that I use a method with /LL/path instead of path?locale=LL, and so if I append ?locale=LL at the end of the URL, the /LL setting takes precedence and makes ?locale=LL ineffective. So I do need to find out the current path (which I'll do with request.fullpath), and replace the locale in it
[03:07:27] hightower4: Hey, how can I throw a validation error from a before_save? I am doing errors.add :fieldname, :msg, but it is letting the save go through without stopping it
[20:04:12] hightower4: Let's say my rails app is configured to run inside example.com/test/, and when I access e.g. example.com/test/users, I want to retrieve the value of "example.com/test"
[00:27:03] hightower4: gambl0re, inside the up() or change() function you would just list more "add_column :TABLE, :COL, TYPE" calls
[14:38:59] hightower4: Hey, in Rails I18n guide, there is a note on adding ability to select locale from an URL automatically, by doing scope "/:locale" do resources :books end . How would I make this apply to all resources, not just :books, without listing them explicitly?
[15:08:22] hightower4: FailBit, actually, I have scope '/:locale/ do mount App::Core::Engine :at => '/' end, but I believe the scope is not getting applied to the mount. (Passing the locale in the URL, such as /en/login, works, but the default locale is always used). Any hints?
[15:25:09] hightower4: FailBit, hm, no luck, mounting to /:locale/ seemed to trigger an endless loop (page rendering within page), and other attempts resulted in /<locale>/login working, but still always the default locale is used
[15:28:28] hightower4: FailBit, is it possible that the first method (scope '/:locale' do mount at => '/') worked, but that I need code in application_controller which actually sets I18n.locale= params[:locale] ?
[15:41:00] hightower4: FailBit, hm, I do see params[:locale] set from a before_action handler in the application controller, and setting I18n.locale= works, but has no effect. Will check in more detail later.
[17:16:30] hightower4: FailBit, I seem to have progressed a bit with the I18n issue. In the before_action of the application_controller, I set I18n.locale= to my locale, and if I print a string there, it is localized. But obviously the setting is somehow lost, because by the time the view is displayed, the locale is back to english
[21:46:15] hightower4: Hey, in a localization file, if I have an existing key for "products", and I need to add "product", but without modifying the views, do I add "product" as an additional entry, or I remove "products" and add "product" with one: and other: below it?
[21:49:52] hightower4: capin, that's the default of course, I will do that in the lack of a response here. But given that I am on an entirely different part of code, I'd like to avoid interruption if possible
[03:08:15] hightower4: In development mode, how can I temporarily disable seeing database queries in the rails console?
[13:54:59] hightower4: Hey, I have a column which should have a default of convert_to_bigint(("current_schema"())::text). It works when I define it in Postgres directly. But when I add it to a migration, the column gets created with default value 0, and no error/warning is printed. What's the catch?
[19:29:52] hightower4: Hey gents, if I am in the rack middleware code, is there a way I can set some variable/some value in there, that would be visible in the rails app during the remainder of processing the request?
[18:13:15] hightower4: Hey, any ideas where in Rails there would be a limit on the max value in an int/bigint? I've tried overriding the default field 'id' to be bigint in the database (and all foreign key fields to also be bigint), and on a 64bit architecture a value of e.g. 1060258517765587969 still fits nicely into a Fixnum and Ruby uses a Fixnum for it. But when it goes through the whole rails stack, I get some (intermittent) errors.
[18:15:46] hightower4: tubbo, right. I've assumed that to rails/ruby it would make no difference, because this value should still fit nicely into Fixnum, which is the default (used even for plain ints)
[18:16:57] hightower4: tubbo, it's a guess, yes. Based on the fact that if I remove two digits from this large number, the error does not happen
[18:17:27] hightower4: workmad3, in some table, there is a foreign key containing the ID of a record in another table, and following that association does not work. I'm not sure exactly why (I will go and reproduce it)
[18:18:14] hightower4: Right, I agree with all that's been said. I'll follow up in here if I get more evidence/pointers to where the issue may be
[18:25:13] hightower4: workmad3, I wanted to do this implicitly, without modifying the migrations, so I overwrote create_table and add_reference in ActiveRecord::ConnectionAdapters::SchemaStatements to insert an explicit "id: 'bigint not null default ..." into the parameters if the type of :id was not already specified or if it was specified as int. Also, possibly not necessary, but I have overwritten function aliased_types in ActiveRecord::ConnectionAdapters::Table
[18:27:19] hightower4: workmad3, yes. Also to make sure I didn't make a mistake (or that rails used some other functions I did not overwrite), for test I have also replaced all int(eger)? with bigint in all migrations, and then ran them
[18:28:55] hightower4: Great, let me try that just to test another approach. Let you know of the results
[18:32:52] hightower4: workmad3, right, certainly. My concern in that approach is the need to modify literally all migrations, and to always use the method of installing extensions using that step-by-step approach in which I can checkout, modify migrations, then run them
[18:34:55] hightower4: A couple combined reasons (I'd prefer IDs all having equal number of digits, and also have sharding and global unique ID)
[18:35:27] hightower4: (well, global, within the databases and shards, not globally like uuids or something)
[18:39:39] hightower4: workmad3, well, actually I just realized I can't just add :limit, because as mentioned I'd like to have the IDs unique, so I'm doing that by assigning them a default value which is coming from a sequence, rather than a fixed value + auto_increment
[18:58:39] hightower4: workmad3, tubbo : actually, it looks like my approach with overwriting create_table and add_reference to re-define the type of field worked, and the "intermittent issue" was related to using jruby instead of ruby. The only thing is that one also has to define int/integer to be alias for bigint, because some fields end up being integers in the database without it, even though I've replaced all ints with bigints in the migrations. (So I assume th
[22:36:45] hightower4: What could be the reason that rake db:migrate clearly executed a migration (it says "migrating... add_column... add_index ... migrated"), but the field does not actually show up in the database?
[22:40:36] hightower4: kitsuneyo, 236 migrations are executed in this run, but the issue is also reproducible.
[22:46:45] hightower4: kitsuneyo, I'm gonna see if I can execute half of the migrations, then the other half
[23:35:52] hightower4: Am I seeing this right that in spree 3.0.3 there is an issue with the state dropdown on the Checkout->Address page?
[23:36:24] hightower4: Whatever state I select, the message is Billing address state can't be blank, Shipping address state can't be blank