Activity Graph

Page 1 of 3 | Next »


[14:42:55] acovrig: has joined #elixir-lang
[18:05:13] acovrig: has left #elixir-lang: ()


[22:41:08] acovrig: has joined #RubyOnRails
[22:41:26] acovrig: I am having issues deploying a rails 5.2 app - I can’t make the required credentials store...
[22:41:57] acovrig: I guess I understand not having config/secrets.yml anymore, but all the articles I’ve seen say to run bin/rails credentials:edit, but that doesn’t work
[22:42:20] acovrig: when I run that I get OpenSSL::Cipher::CipherError and ActiveSupport::MessageEncryptor::InvalidMessage on a fresh blank project
[23:02:18] acovrig: Read error: Connection reset by peer
[23:02:26] acovrig: has joined #RubyOnRails
[23:06:35] acovrig: Client Quit


[16:42:42] acovrig: has joined #RubyOnRails
[16:59:32] acovrig: Quit: acovrig


[18:19:57] acovrig: has joined #RubyOnRails
[18:20:51] acovrig: I’m having issues with ActionCable in production, it works perfectly fine in development, but if I run puma in produciton mode, all my connections fail with “was not upgraded to websocket”
[18:26:07] acovrig: It’s definately something in my config/environments/production.rb - if I copy development over it, it works fine
[18:30:31] acovrig: Found it: action_cable.disable_request_forgery_protection
[18:30:53] acovrig: Quit: acovrig


[23:24:34] acovrig: has joined #RubyOnRails
[23:26:07] acovrig: I’m currently using Rails 5.1.4 with ActionCable and love it, however, I’m having issues integrating the sockets in a mobile app, can I have rails provide a style websocket?
[23:54:40] acovrig: Quit: acovrig


[12:09:52] acovrig: has joined #RubyOnRails
[13:51:07] acovrig: Quit: acovrig
[13:57:02] acovrig: has joined #RubyOnRails
[14:09:15] acovrig: Quit: acovrig


[21:35:13] acovrig: has joined #RubyOnRails
[23:31:34] acovrig: Ping timeout: 264 seconds


[12:02:58] acovrig: has joined #RubyOnRails
[12:04:14] acovrig: Client Quit
[12:27:22] acovrig: has joined #RubyOnRails
[13:36:58] acovrig: Quit: acovrig


[20:44:45] acovrig: has joined #RubyOnRails
[20:45:02] acovrig: Is it possible to have rails work as a server?
[21:22:42] acovrig: lupine: I’ve used actioncable and like it, but an app dev can’t use actioncable (as far as i know), do you know of any way to use or websockets in rails (or, mostly of of scope of this channel - a js client that works with actioncable)
[21:23:55] acovrig: true, but does actioncable produce raw websickets? He is able to see the pings and a welcome message, but nothing in any cables
[21:24:23] acovrig: and I’d rather not boradcast private data to any websocket-connected deivce for snooping
[22:14:05] acovrig: Ping timeout: 256 seconds


[10:43:35] acovrig: has joined #RubyOnRails
[10:45:31] acovrig: I’m working on a photo management system, Pic has_many Tag through PicTag; to display the tags I have a, which works fine, but it makes page loads take ~2s given it has N(tags)+1 queries to run to dispaly that, how would I change my queries to be faster?
[10:51:03] acovrig: Radar:
[10:51:46] acovrig: I’m thinking something with includes but not sure what
[10:54:10] acovrig: or like a join where I somehow get the last pic in association with each tag
[11:03:33] acovrig: if I do an includes, can I specify which columns I want (for the large select in (id array))?
[11:05:38] acovrig: just adding a .select(:id, :fname) to the Pic.where() elsewhere in my controller went from 17ms -> 3ms so I’m guessing if I did the same on an includes(:pics) then it’d greatly help too
[11:50:31] acovrig: Quit: acovrig


[15:51:42] acovrig: has joined #RubyOnRails
[15:54:46] acovrig: I’m POSTing a JSON object to a rails instance, I can JSON.parse(request.raw_post) but that feels wrong, shouldn’t I be able to access the params object, if I p params, I get a stringified version of my object => “” as a single parameter, how do I fix this?
[16:17:42] acovrig: Quit: acovrig


[13:52:03] acovrig: has joined #RubyOnRails
[15:43:53] acovrig: Quit: acovrig
[16:10:03] acovrig: has joined #RubyOnRails
[19:45:12] acovrig: Quit: acovrig
[20:55:49] acovrig: has joined #RubyOnRails
[21:13:02] acovrig: I’m having issues with devise_token_auth, is some of my files, test.txt is a list of what I try to show the issue - I can sign_in but it won’t accept any of my tokens
[22:15:26] acovrig: Quit: acovrig


[20:22:31] acovrig: has joined #RubyOnRails
[20:23:17] acovrig: Has anyone gotten devise_token_auth to work? I can install it and things are fine until I try <% if user_signed_in? %> in my application.html.erb on a devise route (/users/sign_in)
[21:02:14] acovrig: Quit: acovrig


[23:08:48] acovrig: has joined #RubyOnRails
[23:22:21] acovrig: Quit: acovrig


[20:06:32] acovrig: has joined #ruby
[20:08:33] acovrig: I’m trying to encrypt a string with GPGME, when I encrypt I get a strange string, hex maybe? (\x8C\r\x04\x03 for example) - I’d like a string that I’d get from gpg like "-----BEGIN PGP MESSAGE-----“, should I use a different gem?
[20:21:50] acovrig: graft: yes
[20:27:00] acovrig: graft: I tried but the file just contains \x**\x**… text, if I dump it to a file, `file` says “PGP RSA encrypted session key” - I’d like a BEGIN PGP MESSAGE … END PGP MESSAGE sorta string I can copy/paste through `gpg --decrypt`
[20:29:21] acovrig: graft: that did it, thanks :D
[21:12:21] acovrig: Quit: acovrig


[16:02:57] acovrig: has joined #RubyOnRails
[16:04:08] acovrig: I have 2 tables, profiles and forms, profiles has a column ‘default_form’ that should have a foreign_key to forms/uri (uri being the column it references); ‘add_foreign_key :profiles, :forms: column: :uri’ is what I was thinking; but it keeps referencing forms/id…
[16:04:55] acovrig: I’ve also tried add_foreign_key :profiles, :forms, column: :default_form, foreign_key: :uri
[17:09:46] acovrig: how do I specify the foriegn key in a relationship (usually :id, but not in this case)
[17:20:28] acovrig: cnk: in the past I’ve used add_foreign_key :orders, :users, column: :placed_by_id, foreign_key: :id; but when it seems to be ignoring my foreign_key: :uri in this case
[19:37:32] acovrig: Quit: acovrig


[17:58:21] acovrig: has joined #RubyOnRails
[17:59:01] acovrig: I’m trying to configure gmail smtp for sending mail and am getting the error that An SMTP From address is required. I have a from address specified in my environment config...
[18:02:49] acovrig: here is my initializer and enviroment config:
[18:16:45] acovrig: is it possible to set a from address for action_mailer in a config somewhere so as to not specify it every mail call in an ActionMailer?
[18:28:22] acovrig: config/environemnts/* and config/initializers
[18:31:29] acovrig: matthewd: I was using app/mailers/application_mailer.rb and it wasn’t working, docs put it there, so I tried again and it works now so I guess I just hadn’t restarted the server before or had a caching issue
[18:59:49] acovrig: Quit: acovrig


[19:39:52] acovrig: has joined #RubyOnRails
[19:49:08] acovrig: does anyone know of any good docs for devise (or alternatives to devise), I need *API* auth, not HTTP (no browser, providing API for an app)
[20:30:35] acovrig: does anyone know of any good docs for devise (or alternatives to devise), I need *API* auth, not HTTP (no browser, providing API for an app)
[21:04:42] acovrig: Quit: acovrig


[15:49:26] acovrig: has joined #RubyOnRails
[15:50:19] acovrig: I have a rails app (API, no web interface) that uses devise, I’d like to have oauth, I got oauth working for Google,Facebook,and Twitter; how do I use my API w/oauth? I can login w/those providers in the web interface
[15:53:22] acovrig: mikecmpbll: no, I want to be able to login to my API w/an auth provider (AKA google)
[15:53:35] acovrig: I can login on the web interface, but am unsure how to login via the API
[15:53:52] acovrig: yea, I have omniauth and it works for the web interface (all but windowslive but that’s a separate issue)
[15:55:12] acovrig: yea, I tried login in w/facebook, then using that GET request in the API and I get a 302 to the login page
[15:57:25] acovrig: the app dev used Azure last and said they provide a API for auth he can use in the (mobile) app but admin. would rather use rails than azure due to hosting prices
[16:57:35] acovrig: I’m making an API-only Rails App, is ther a specific gem that is recomended or just rails itself?
[22:17:24] acovrig: Ping timeout: 260 seconds
[22:54:17] acovrig: has joined #RubyOnRails
[22:54:37] acovrig: Has anyone used an oauth, say Facebook for a Rails API app?
[22:55:34] acovrig: pragmatism, for *API* though? I can do omniauth via a browser, but how do I login via the API?
[22:56:15] acovrig: pragmatism, yes
[22:56:51] acovrig: I have devise working with omniauth for several providers in the web interface, but don't know how to hit the API for omniauth
[22:57:47] acovrig: pragmatism, yea, I saw that page; the appdev said w/ Azure he hit an auth api w/2 args: the provider and the token and it auth'd him, I'm not sure how to provide that
[22:58:51] acovrig: I'm not sure how to implement the SO post either...
[23:02:02] acovrig: Actually, looking at the post again in more depth, I may actually be able to do this, thanks
[23:11:00] acovrig: Quit: Leaving
[23:48:55] acovrig: has joined #RubyOnRails
[23:49:48] acovrig: Client Quit


[21:38:21] acovrig: has joined #RubyOnRails
[21:39:23] acovrig: what is the recommended/best practice method to deal with record validation errors: I.E. trying to create a duplicate record should return a pretty error message (I.E. render json: {…}) as opposed to spewing source or just returning a 500?
[21:40:12] acovrig: I’m currently thinking a begin; rescue; end thing and catching the validation error and `render json: {…} and return`
[21:40:22] acovrig: has left #RubyOnRails: ()
[21:40:37] acovrig: has joined #RubyOnRails
[21:43:24] acovrig: arup_r: they currently are: I have a .save! and it’s throwing an ActiveRecord::RecordInvalid (Validation failed: ModelName has already been taken)
[21:45:23] acovrig: from what I understand save doesn’t actually commit to DB, but save! does; I’ll look into save vs save! however this specific instance isn’t actually a save! (sorry), it’s a item.foreign_key_colum << foreign_item statement
[21:45:31] acovrig: as a many to many relationship
[21:46:09] acovrig: arup_r: so if save then save! else return pretty error?
[21:48:28] acovrig: oh, so save returns true and /actually/ saves, save! tries to save, but throws an Exception if it fails
[21:49:28] acovrig: OK, I have a many to many: Event, Contact; I’ve been doing << event; should I do ContactEvents.create() instead?
[21:49:43] acovrig: to add a contact to an event
[21:49:55] acovrig: and to remove should I do
[21:51:54] acovrig: kwerle: will that return false if the relationship already exists? (build)
[21:52:03] acovrig: kwerle: won’t that remove all contacts from the event?
[21:53:10] acovrig: kwerle: just remove *that* contact from *that* event
[21:53:43] acovrig: kwerle: context: just before those lines I have an event=Event.find(blah) and contact=Contact.find(blah)
[21:54:24] acovrig: kwerle: however, a contact can have multiple events, so it wouldn’t know what event, right?
[21:54:32] acovrig: for the contact.event = nil
[21:55:12] acovrig: kwerle: so, would ?
[21:57:20] acovrig: kwerle: currently I’m doing << event and that’s throwing a validation error as it should, but I want to catch that and give a pretty error
[21:57:56] acovrig: kwerle: something like if ( << event); render plain: ‘OK’; else; render plain: ‘error’; end but meh
[21:58:30] acovrig: kwerle: so would it be better to do ContactEvents.create(contact_id:, event_id: ?
[21:59:29] acovrig: what do you mean real thing?
[22:01:46] acovrig: oh, I think I see what you mean, I’m not sure that would apply here, but I do have timstamps on the join table, so I think I’m fine
[22:02:17] acovrig: kwerle: thanks for the help, TTFN
[22:06:31] acovrig: Ping timeout: 240 seconds


[19:21:54] acovrig: has joined #RubyOnRails
[19:22:44] acovrig: I’m having a strange issue: I do a GET and I get a 500 StatementInvalid Mysql::Error; but if I do the *exact* same call again I don’t get the 500...
[19:33:34] acovrig: norc_:
[19:35:30] acovrig: norc_: how do I do that?
[19:36:11] acovrig: norc_: no, it seems random
[19:36:47] acovrig: norc_: that could be interesting, this is an API, not a web-interface
[19:39:12] acovrig: norc_: I just rake db:drop db:create db:migrate db:seed and hit it and it worked just fine...
[21:39:55] acovrig: Quit: acovrig


[12:57:21] acovrig: has joined #RubyOnRails
[14:05:47] acovrig: I have a rails API w/devise, and can login just fine from angularjs’s $, an android app, a Titanium app, and a ionic app; however in Titanium and ionic, when I login, logout, and try to login again, I get `Filter chain halted as :require_no_authentication rendered or redirected` any ideas why?
[21:36:23] acovrig: Quit: acovrig


[13:52:07] acovrig: has joined #RubyOnRails
[14:01:07] acovrig: I’m having an issue with nested params ( I bet it’s a simple fix, just not seeing it.
[14:06:47] acovrig: durexlw: schema.rb added to gist
[14:08:48] acovrig: durexlw: should it be a has_many? I figure a contact has an address
[14:12:21] acovrig: durexlw: see controller_idea.rb I just added, does it help in explaining what I’m trying to do?
[14:14:56] acovrig: durexlw: yea, I like the idea of using nested params, but if I can’t get it to work, I may use the controller_idea.rb code instead
[14:15:10] acovrig: durexlw: I figure it’ll *work* but be hideous…
[14:16:10] acovrig: durexlw: yay, it works, thanks; now to get update working :)
[14:17:19] acovrig: durexlw: thanks; it occurs to me I seem to have been trying to re-invent the weel
[14:18:44] acovrig: jokke: yea, this is basically just an API and the app dev sees a contact and an address as the same entity, so they’re going to create a contact and address at the same time
[14:41:56] acovrig: OK, the create works, but the update doesn’t work and doesn’t give me a usable error:
[22:06:21] acovrig: Ping timeout: 258 seconds
[22:49:11] acovrig: has joined #RubyOnRails
[22:50:21] acovrig: Client Quit


[15:08:33] acovrig: has joined #RubyOnRails
[15:09:20] acovrig: given a route (from rake routes), how do I describe this in config/routes.rb? GET /users/:user_id/custom_name/:id
[15:10:56] acovrig: universa1: yes, in a rails 2.0.2 app I’m trying to upgrade to current...
[15:12:59] acovrig: universa1: yup, that’s it; thanks; I’ve used them before and I guess I’m a bit deer-in-the-headilghts’d about this foreign old code
[16:59:36] acovrig: Quit: acovrig
[21:44:56] acovrig: has joined #RubyOnRails
[21:46:13] acovrig: I have contact and address models, when a users POSTs (json) I’m thinking and params.require(:address).require(:street, :city, :state); I’m getting a forbidden attributes error, any ideas why?
[21:49:33] acovrig: norc:
[21:51:01] acovrig: norc: gist updated
[21:51:10] acovrig: smathy: how do I do multiple params then?
[21:52:20] acovrig: smathy: why?
[21:58:48] acovrig: smathy: thanks but it still isn’t working (see updated gist)
[22:10:28] acovrig: smathy: I read through the guide more and am getting a different error now (see gist (
[22:23:06] acovrig: Ping timeout: 246 seconds


[18:19:25] acovrig: has joined #RubyOnRails
[18:20:44] acovrig: I'm trying to implement (customizing devise); when I do, the /sign_up page shows the sign_in view... why?
[18:22:34] acovrig: This is the relevant code of mine:
[18:29:35] acovrig: also, /sign_up shows the sign_in page, then if I refresh, I'm redirected to the sign_in page...
[20:39:49] acovrig: Quit: Leaving


[02:14:05] acovrig: has joined #ruby
[02:15:26] acovrig: has left #ruby: ()
[16:48:46] acovrig: has joined #RubyOnRails
[16:49:52] acovrig: I have a model with a custom method, so Model.first.thmb returns data; however Model.first(2) doesn't have the thmb attribute, how do I add it?
[16:52:44] acovrig: say I have a User model with first_name and last_name; I can create a def name { "#{first_name} #{last_name}" } in the model; then I can do; but render json: User.all doesn't have the name attrib..
[16:57:32] acovrig: alfiemax, yes, I can call, but can I include the name method in User.all ?
[16:58:03] acovrig: alfiemax, how?
[17:00:06] acovrig: alfiemax, OK, thanks; I was using that and was hoping for a better solution but oh well
[18:37:41] acovrig: Quit: Leaving


[23:02:32] acovrig: has joined #RubyOnRails
[23:03:34] acovrig: Client Quit


[02:43:11] acovrig: has joined #RubyOnRails
[02:48:17] acovrig: Ping timeout: 250 seconds
[12:33:03] acovrig: has joined #RubyOnRails
[18:20:08] acovrig: I have a very old rails app I’m trying to upgrade (didn’t write it); can someone explain what this means: map.signup '/register', :controller => 'users', :action => 'new' (routes.rb)
[18:23:34] acovrig: could the map.’signup’ be as: ‘signup’ for signup_path?
[18:25:29] acovrig: yea, this is from the rails 1.8 era…
[21:39:51] acovrig: Ping timeout: 244 seconds


[12:45:28] acovrig: has joined #RubyOnRails
[15:31:10] acovrig: I installed devise_token_auth and when doing POST /auth/sign_in '{"email": “”, "password: "asdf”}’; I get Unpermitted parameter: {"email": “”, "password: "asdf"} followed by a 401, why?
[15:34:29] acovrig: n_e_o: the user controller is empty; the application controller is
[15:35:44] acovrig: ummm wat… that’s awkward…
[15:38:54] acovrig: n_e_o: interesting; the link works for me now, I guess they just had a slowdown for a moment
[15:44:04] acovrig: n_e_o: I just added the development.log to the gist
[15:50:36] acovrig: n_e_o: lol, was reading that same page; I just used ARC (Chrome app thing) and it works; so it must be an issue with resty (; thanks for the help
[16:02:18] acovrig: I can login with a POST and I see an Access-Token and Uid headers get set, but when I try a GET with those headers, I see current_user returns nil in the console
[18:07:22] acovrig: Event belongs_to user, foreign_key: ‘created_by’; event.created_by doesn’t work, but event.created_by_id returns a; can I have event.created_by return a <User>?
[18:09:10] acovrig: I guess I could do this in the event model: def created_by { return User.find(created_by_id) } but eeh
[21:57:56] acovrig: is it possible to have devise_token_auth return the token as the response body instead of header?
[22:11:47] acovrig: Ping timeout: 260 seconds


[20:40:29] acovrig: has joined #RubyOnRails
[20:42:01] acovrig: I have a table orders that has shipping_address_id that references addresses (id); in the migration, I’m trying t.belongs_to :address, index: true, foreign_key: ‘shipping_address_id’; but the addresses table doesn’t exist yet, what is the best practice to deal with this? add these columns in the create_table :addresses migration?
[20:45:39] acovrig: I was a bit overwhelmed w/my diagram, but it looks like I can make addresses first; should I just swap the timestamp on the beginning of the db/migration/*.rb files to make it first?
[20:52:44] acovrig: universal, hnanon: that worked; now I guess I should put the tables in order of when they /can/ be created
[21:14:53] acovrig: I have a migration: t.belongs_to :user, index: true, foreign_key: ‘created_by’; but the migration still creates the column as ‘user_id’, any ideas why?
[21:29:01] acovrig: how do I change the foreign_key/index name on a belongs_to in a migration?
[21:30:49] acovrig: orders has a foreign key to address ‘shipping_address_id’; when I do a t.belongs_to :address, index: true, foreign_key: ‘shipping_address_id’ it creates address_id instead
[21:31:39] acovrig: normally I’d be able to live with it, but orders has shipping_address_id and billing_address_id and other_address_id; and I can’t have 3 address_id columns...
[21:32:24] acovrig: universal: wouldn’t that point to ‘shipping_addresses’ table?
[21:32:46] acovrig: how would it know to point to the addresses table?
[21:33:55] acovrig: universal: OK, so t.integer :shipping_address_id, then add_foreign_key?
[21:41:10] acovrig: universal: thanks, that works; now what if I want event.created_by -> t.references :created_by, index: false, foreign_key: false; add_foreign_key :events, :users, column: :created_by, foreign_key: id
[22:06:07] acovrig: Ping timeout: 244 seconds


[14:11:00] acovrig: has joined #RubyOnRails
[14:16:39] acovrig: I’m having issues with CORS, has all my related code, is this a problem with rails or js?
[14:24:41] acovrig: mrgreenfur: OK, I’ll look into the json data thing
[14:34:36] acovrig: mrgreenfur: that did it, it also helped to use valid credentials ;) I didn’t think a non-200 would cause that; thanks.
[14:59:25] acovrig: Ping timeout: 244 seconds
[17:30:35] acovrig: Quit: acovrig


[18:52:04] acovrig: has joined #RubyOnRails
[18:52:27] acovrig: I’m getting an UnknownFormat error, is there any way for me to debug what the client is using as a format?
[18:54:03] acovrig: I may need a different logging level (I’m using the default and `rails s`), I don’t see anything about that (but I know what you’re talking about: I’ve seen it before)
[19:16:16] acovrig: Quit: acovrig


[14:28:28] acovrig: has joined #RubyOnRails
[14:29:48] acovrig: Can (if so, how) I change the root, my assets are linking to /assets/*; can I set the app root to be /asdf/* (because of a proxy) so assets would link at /asdf/assets/* and a route ‘/abc’ would be ‘/asdf/abc’?
[14:32:57] acovrig: then route ‘/asdf/abc’, to: ‘abc#index’?
[14:33:36] acovrig: right, I need both?
[14:33:55] acovrig: wouldn’t the config.assets just do the asset pipeline?
[14:34:01] acovrig: placeholders
[14:48:24] acovrig: Quit: acovrig
[14:52:37] acovrig: has joined #RubyOnRails
[15:16:07] acovrig: sorry for the delay, I went AFK; I guess a better way of asking my question: I am proxying my app via nginx mapping /asdf to rail’s /; the assets are pointing to /assets instead of /asdf/assets and links in a scaffold is linking to /controller instead of /asdf/controller; would sssets.prefix do both or are they different issues?
[15:39:15] acovrig: Quit: acovrig
[16:22:43] acovrig: has joined #RubyOnRails
[16:26:08] acovrig: I'm still having issues with routes, pages load fine (including assets), but links on a scaffolded page doesn't account for the proxy
[16:32:04] acovrig: Read error: Connection reset by peer
[16:38:30] acovrig: has joined #RubyOnRails
[16:41:11] acovrig: OK, now that I’m back *sigh* My proxy is routing /asdf to / in RAILS; I have config.action_controller.relative_url_root = ‘/asdf’ in config/application.rb so assets work, but links in scaffolds link to instead of
[16:41:29] acovrig: I tried scope ‘/asdf’ { resources :controller } but that gives me 404s
[17:52:14] acovrig: Quit: acovrig
[18:05:13] acovrig: has joined #RubyOnRails
[18:08:51] acovrig: Client Quit
[18:17:04] acovrig: has joined #RubyOnRails
[18:32:44] acovrig: Quit: acovrig


[01:18:49] acovrig: does rails by deafult look at /app/jobs?
[01:25:15] acovrig: It semes I???m having this issue, but the last message doesn???t help:
[02:00:47] acovrig: Ping timeout: 264 seconds