renegadeandy

Activity Graph

Page 1 of 16 | Next »

2019-07-04

[14:30:17] renegadeandy: has joined #RubyOnRails
[14:30:47] renegadeandy: Hi all. With regards to image classification from a rails app, do you think this still applies : https://www.netguru.com/blog/ruby-on-rails-in-machine-learning-yay-or-nay
[16:32:46] renegadeandy: Remote host closed the connection

2019-07-02

[22:56:56] renegadeandy: has joined #RubyOnRails
[22:57:21] renegadeandy: Hi all! Is there any good tutorials or guides on how i may integrate image classification (perhaps I can train a model) into a rails app?
[23:42:19] renegadeandy: Remote host closed the connection

2017-11-06

[18:23:37] renegadeandy: Read error: Connection reset by peer

2017-11-05

[23:31:27] renegadeandy: has joined #RubyOnRails
[23:31:54] renegadeandy: hey all. I have a user model, and a headache model. Headache has belongs_to :user and User has_many :headaches
[23:32:20] renegadeandy: When I do User.first.headaches, it says Uninitialized constant User::Headach
[23:49:01] renegadeandy: Radar: rails has always pluralized sensibly. This is the first instance of me seeing it misbehave
[23:58:45] renegadeandy: it could be in the irregular list
[23:58:50] renegadeandy: i mean if it i can do fish, hippo, etc

2017-11-03

[17:54:22] renegadeandy: Ping timeout: 260 seconds

2017-11-02

[15:59:13] renegadeandy: has joined #RubyOnRails
[15:59:57] renegadeandy: Hi All. I am making a rails backend API, and have installed / configured rack_cors gem. When I issue my post, my rails server still shoots out a Can't verify CSRF token authenticity.
[16:00:05] renegadeandy: any pointers I should check
[16:00:09] renegadeandy: this is my application.rb
[16:00:45] renegadeandy: https://gist.github.com/anonymous/8283adacc464a3e7ca0c1a2978d5ba10
[16:02:57] renegadeandy: tbuehlmann: dont believe i do
[16:06:42] renegadeandy: I think i should use skip_before_action :verify_authenticity_token -- but my only concern is what if i use the same API to drive the site at a later point
[16:06:46] renegadeandy: I want it to work here too
[16:09:43] renegadeandy: tbuehlmann: should i be turning off protect_from_forgery
[16:15:11] renegadeandy: tbuehlmann: doing protect_from_forgery with: :null_session in the application controller works, but the app still emits the message "Can't verify CSRF token authenticity."
[16:15:36] renegadeandy: Do most people have seperate controllers for the web UI against the API?
[16:15:51] renegadeandy: tbuehlmann: i suppose it makes sense
[16:16:18] renegadeandy: tbuehlmann: so the Can't verify CSRF token authenticity." is ok, and should be ignored?
[16:17:06] renegadeandy: instead of, or as well as protect_from_forgery with: null_session
[16:17:26] renegadeandy: skip_before_action :verify_authenticity_token in the application controller doesn't appear to work
[16:18:06] renegadeandy: Before process_action callback :verify_authenticity_token has not been defined
[16:18:34] renegadeandy: tbuehlmann: no, its just a base application controller for everything
[16:18:40] renegadeandy: which inherits from actioncontroller::base
[16:20:01] renegadeandy: so i make another class
[16:20:42] renegadeandy: leave application_controller.rb for my UI side work. And my new one application_api_controller.rb will be for my API work?
[16:25:07] renegadeandy: so you would pop it into its own folder?
[16:25:13] renegadeandy: api/application_controller.rb
[16:25:25] renegadeandy: api/v1/sessions_controller.rb etc
[16:26:35] renegadeandy: tbuehlmann: true
[16:26:52] renegadeandy: So I would then have 2 application_controller.rb with the same name, but different content, is that allowed?
[16:27:33] renegadeandy: gona try it now
[16:29:23] renegadeandy: so triple check
[16:29:39] renegadeandy: controllers/api/v1/application_controller.rb
[16:29:48] renegadeandy: class API::V1::ApplicationController < ActionController::API
[16:30:00] renegadeandy: controllers/api/v1/sessions_controller.rb:
[16:30:08] renegadeandy: lass SessionsController < API::V1::ApplicationController
[16:30:14] renegadeandy: *class SessionsController < API::V1::ApplicationController
[16:30:46] renegadeandy: why does the class also need to be name spaced
[16:31:35] renegadeandy: is that basically because of the folder structure
[16:31:40] renegadeandy: so it knows how to find the correct files etc?
[16:34:14] renegadeandy: tbuehlmann: and that has now changed my routes
[16:34:20] renegadeandy: does it have to?
[16:34:23] renegadeandy: before I had:
[16:34:42] renegadeandy: namespace :v1 do #routes in here end
[16:34:57] renegadeandy: now i seem to have to do
[16:35:07] renegadeandy: namespace :api do namespace :v1 do #routes in here end end
[16:35:21] renegadeandy: resulting in /api/v1/my_url
[16:35:32] renegadeandy: what if i wanted (for some reason) to keep it as /v1/my_url
[16:35:43] renegadeandy: (i don't but this is a learning question for me)
[16:36:50] renegadeandy: tbuehlmann: so i would wrap my namespacing inside a scope
[16:44:24] renegadeandy: tbuehlmann: yeah i wrapped my routes in scope '/v1' do
[16:44:29] renegadeandy: that did something i didn/t expect
[16:44:43] renegadeandy: I then tried nesting the scope line deeper
[16:44:48] renegadeandy: which also didn't quite do it
[16:45:06] renegadeandy: various combinations of /v1/api/v1/ or /api/v1/v1 etc
[16:45:18] renegadeandy: but i was wondering how i would make it simply /v1/url

2017-10-30

[16:33:58] renegadeandy: has joined #RubyOnRails
[16:34:52] renegadeandy: I am looking for a getting started guide on how best to do android client authentication with a server backend(rails). I have found a bunch of guides like this : http://blog.elcurator.net/articles/25-how-to-authenticate-an-android-application-to-a-rails-server-with-google They are all relatively old, is this still relevant best practices?
[19:17:01] renegadeandy: havenwood: dminuoso i definitely won't choose basic auth.
[19:17:05] renegadeandy: iTs pretty terrible
[19:22:07] renegadeandy: havenwood: You have to pass a username and password on every request and its easily brute forced?
[19:22:13] renegadeandy: or open to most attacks
[19:22:21] renegadeandy: especailly if you have no crypto, its terribly insecure
[19:23:04] renegadeandy: there is a reason auth isn't done using basic auth with rails security gems
[19:24:06] renegadeandy: How is that stateless?
[19:24:18] renegadeandy: havenwood: is there a documented guide on this?
[19:26:50] renegadeandy: havenwood: ok - is there a written guide for this?
[20:25:03] renegadeandy: Remote host closed the connection

2017-07-07

[01:40:52] renegadeandy: Remote host closed the connection

2017-07-05

[01:14:49] renegadeandy: Remote host closed the connection
[11:57:27] renegadeandy: has joined #RubyOnRails

2017-07-04

[15:47:00] renegadeandy: has joined #RubyOnRails
[15:47:13] renegadeandy: why when i run this in my view do i get extra quotes everywhere in the json object? https://gist.github.com/anonymous/a9f37cac3a7c66aca24c39b5347932cd
[16:06:00] renegadeandy: cerulean: hey! So this is what you asked for : https://gist.github.com/anonymous/b273536e9cd468148ac10d6f1c4b7bac I also removed the obj.as_json from the input to the array and changed it back to just array << obj
[16:06:16] renegadeandy: still get too many escaped quotations instead of normal quotations
[16:32:12] renegadeandy: tbuehlmann: hey! That gets me : undefined method `html_safe' for #<Array:0x007ff2db65c090>
[16:35:22] renegadeandy: tbuehlmann: yeah , suppose, so it needs to be legs_array.as_json.to_s
[16:35:27] renegadeandy: then in the view to .html_safe
[16:45:07] renegadeandy: tbuehlmann: i read as_json was better than to_json? Whats differnefc/
[16:51:43] renegadeandy: tbuehlmann: it was various SO answers on how to render json from an instance object in rails
[16:51:52] renegadeandy: to_json and html_safe combination worked nicely - thank you!
[18:01:45] renegadeandy: hi everyone. IN a css file, how do i reference the URL of an image - for a background-image rule?
[18:22:12] renegadeandy: sylario: how does that work with the asset pipeline>?
[18:26:12] renegadeandy: tbuehlmann: ok so I have : background: image-url('/jTLine/cd-arrow.svg') which is not working
[18:26:30] renegadeandy: my image is in assets/images/jTLine/cd-arrow.svg
[18:37:26] renegadeandy: sylario: i don't see what syntax is wrong
[18:37:45] renegadeandy: background: image-url('/jTLine/cd-arrow.svg') no-repeat 0 0;
[18:46:31] renegadeandy: tbuehlmann: nothing - the image just doesn;t show
[18:52:27] renegadeandy: in the css on the page it renders this css
[18:52:28] renegadeandy: background: image-url('/jTLine/cd-arrow.svg') no-repeat 0 0;
[18:57:30] renegadeandy: sylario: thats a rails command - but im not sure it works in css land... tbuehlmann?
[19:00:53] renegadeandy: tbuehlmann: aha yes
[19:00:57] renegadeandy: didnt realise you needed them in there
[19:01:48] renegadeandy: tbuehlmann: background: <%= image-url('/jTLine/cd-arrow.svg') %> no-repeat 0 0; also doesn't work
[19:03:42] renegadeandy: tbuehlmann: we are not in scss land?
[19:03:44] renegadeandy: this is a css file
[19:04:00] renegadeandy: generated css is as I said before
[19:04:07] renegadeandy: background: image-url('/jTLine/cd-arrow.svg') no-repeat 0 0;
[19:07:47] renegadeandy: i do use sass
[19:07:51] renegadeandy: but this file is not an scss file
[19:12:04] renegadeandy: this file is located in
[19:12:17] renegadeandy: assets/stylesheets/lib/jTLine/style.css
[19:15:25] renegadeandy: i rename it to style.css.erb
[19:15:58] renegadeandy: <%= image_url('/jTLine/cd-arrow.svg %>
[19:16:38] renegadeandy: background: url(<%= image_url('/jTLine/cd-arrow.svg') %>) no-repeat 0 0;
[19:16:38] renegadeandy: fryguy: leaving me with
[19:18:23] renegadeandy: which resolves to
[19:18:24] renegadeandy: background: url(/jTLine/cd-arrow.svg) no-repeat 0 0;
[19:18:31] renegadeandy: which doesn't display my image
[19:18:53] renegadeandy: image is in app/assets/images/jTLine/
[19:19:25] renegadeandy: mac, rails 5.1.1, development
[19:21:30] renegadeandy: oh how annoying
[19:21:53] renegadeandy: thank you fryguy
[19:22:01] renegadeandy: and tbuehlmann
[20:07:19] renegadeandy: tbuehlmann: the solution was : change the file name from style.css to style.css.erb and then change the line of code to : background: url(<%= image_url('jTLine/cd-arrow.svg') %>) no-repeat 0 0; in partiular removing the first / in the path which is no longer present :)
[20:07:29] renegadeandy: cam27: i am not a pro by any stretch - but I get by
[20:07:36] renegadeandy: pm me if you like

2017-06-26

[11:20:52] renegadeandy: has joined #RubyOnRails
[11:21:23] renegadeandy: fryguy: sorry I missed you last night. This was the question i was referring to : https://stackoverflow.com/questions/44740612/in-a-included-partial-how-do-you-render-the-original-page-with-validation-errors/44741603#44741603
[17:45:48] renegadeandy: hey all - can somebody help out with this question : https://stackoverflow.com/questions/44740612/in-a-included-partial-how-do-you-render-the-original-page-with-validation-errors/44741603#44741603
[17:45:53] renegadeandy: nobody seems to be able to provide an answer
[17:50:27] renegadeandy: Andr3as: you talking about my question?
[17:52:10] renegadeandy: Andr3as: well sure, i could do render "journeys/show" however, it doesn't seem to bring the validation errors onto the rendered partial.
[17:52:14] renegadeandy: As i mention in my question
[17:53:53] renegadeandy: there isn't an issue with the journey Andr3as
[17:54:18] renegadeandy: Journey show page doesn't make any alterations to the journey, it just adds a leg to the journey
[17:56:35] renegadeandy: k1t: i think thats absolutely fine :)
[19:39:10] renegadeandy: Andr3as: I am talking about form validation errors which automatically get added to the form elements via simple_gem
[19:40:59] renegadeandy: please help me : https://stackoverflow.com/questions/44740612/in-a-included-partial-how-do-you-render-the-original-page-with-validation-errors
[20:07:19] renegadeandy: pwnd_nsfw: so i assign an instance variable to the view....but how do i make sure this is handed to the partial?
[20:10:14] renegadeandy: pwnd_nsfw: i am not sure how to take what I have read and translate into my specific question. Can you help me and others by answering it on SO?
[20:19:05] renegadeandy: i suppose so pwnd_nsfw - so I change that to @leg, and change the show method in journeys to make a @leg, and the create in legs controller will automatically show the errors as it already has the @leg object? When I change the render in legs controller, create, to format.html { render "journeys/show" } i get a "undefined method `name' for nil:NilClass" error on that line.
[20:22:35] renegadeandy: pwnd_nsfw: https://gist.github.com/renegadeandy/38886080e8299ab1dc8a3aab70fb1f2b
[20:31:03] renegadeandy: i dont use them generally pwnd_nsfw it was used to create the files and now deleting code haha . It now contains view code : https://gist.github.com/renegadeandy/38886080e8299ab1dc8a3aab70fb1f2b
[20:36:57] renegadeandy: pwnd_nsfw: where?
[20:37:34] renegadeandy: thats all simple_form code...
[20:37:53] renegadeandy: anyway - that works and is valid so whats wrong with it?
[20:38:07] renegadeandy: im not looking for a critique of how 'terribad' you consider my style?
[20:38:21] renegadeandy: that is umtidy
[20:38:26] renegadeandy: and ill tidy that
[20:39:10] renegadeandy: pwnd_nsfw: well. Thanks for your help.
[20:55:19] renegadeandy: If i do "format.html { render "journeys/show" }" the URL in the browser remains the previously submitted URL despite the page rendering the correct content. Anyway to make the URL update to the appropriate view for the rendered content?
[22:18:40] renegadeandy: Remote host closed the connection

2017-06-24

[00:18:46] renegadeandy: Remote host closed the connection
[09:15:07] renegadeandy: has joined #RubyOnRails
[09:15:23] renegadeandy: somebody who knows about simple forms could they take a look and answer this : https://stackoverflow.com/questions/44731541/in-simple-form-get-the-error-notification-text-without-generating-a-validation-e
[09:22:45] renegadeandy: Cork: answer 2 help? https://stackoverflow.com/questions/32834752/in-rails-4-2-how-does-one-set-the-response-content-type-header-with-media-type
[09:29:29] renegadeandy: Remote host closed the connection
[11:41:14] renegadeandy: has joined #RubyOnRails
[19:30:05] renegadeandy: Hi all. If i have a nested form, and I want to revert the user upon validation errors to the original nested form rather than the default "format.html :new" but instead to the object which is doing the nesting - how would i do this from the controller of the failing model?
[20:19:19] renegadeandy: If anyone is around can you help out with my question here https://stackoverflow.com/questions/44740612/in-a-nested-form-how-do-you-render-the-original-page-with-validation-errors
[21:19:26] renegadeandy: has left #RubyOnRails: ()
[21:19:27] renegadeandy: has joined #RubyOnRails
[21:19:44] renegadeandy: Its so quiet in here today!
[21:20:27] renegadeandy: Well - again in case I miss somebody - please can you take a look at : https://stackoverflow.com/questions/44740612/in-a-nested-form-how-do-you-render-the-original-page-with-validation-errors
[22:43:27] renegadeandy: hey fryguy - you have helped me in the past, did you get a chance to take a look at my SO question?
[23:32:32] renegadeandy: Remote host closed the connection

2017-06-23

[23:38:36] renegadeandy: has joined #RubyOnRails
[23:49:12] renegadeandy: Hi. In my simple_forms form, I have <%= f.error_notification %> which shows the alert box at the top of the form when there is a validation issue. I want to show this error notification sometimes before the form is submitted (using javascript validation too). How can I get the error_notification value, without having triggered a POST to the backend controller?

2017-06-18

[00:20:22] renegadeandy: Remote host closed the connection
[23:11:31] renegadeandy: has joined #RubyOnRails
[23:11:52] renegadeandy: Hi all. What is the best way to include some javascript in a partial?
[23:12:07] renegadeandy: *note* it is a script specific to just this partial
[23:17:47] renegadeandy: Remote host closed the connection

2017-06-17

[23:05:50] renegadeandy: has joined #RubyOnRails

2017-06-14

[04:39:22] renegadeandy: has joined #RubyOnRails
[04:39:37] renegadeandy: Can anyone help with this : https://stackoverflow.com/questions/44535413/calculating-the-distance-between-2-latitude-and-longitude-locations-in-a-rails-p
[04:46:00] renegadeandy: Remote host closed the connection

2017-06-10

[01:37:12] renegadeandy: I am getting 'couldn't find file 'journeys.source.js'. My manifest.js has : "//= link controllers/journeys/journeys.js" and i have app/assets/javascripts/journeys/journeys.js. My view code has: <%= javascript_include_tag "controllers/journeys/journeys" %> I have also restarted the server. Can anybody spot my mistake?
[01:49:34] renegadeandy: fryguy: I have the source javascript file in /app/assets/javascripts/controllers/journeys/journeys.js -> I thought I would match each controller / model up to a specific js file in a tidy folder structure? I see I have got things wrong, what is the best way to fix this?
[01:51:54] renegadeandy: fryguy: app/assets/config/manifest.js and it contains : https://gist.github.com/anonymous/5580641b232dac87e98cf524a370fdce
[01:55:19] renegadeandy: <%= javascript_include_tag "controllers/journeys/journeys" %>
[01:55:24] renegadeandy: journeys.js just contains a bunch of js and one function. i don't know what journeys.source is -- I am trying to include the journeys.js in a view - journeys/show.html.erb with this code
[01:59:19] renegadeandy: I searched my entire project for 'journeys.source.js' and it doesn't exist - so this is perhaps a rails 'inferred' name?
[02:05:10] renegadeandy: fryguy: well, when I add : //= link controllers/journeys/journeys.js to app/assets/config/manifest.js i get this complete error : https://gist.github.com/anonymous/0af75cc0a3c8c5472729a2649c0a240e
[02:11:00] renegadeandy: fryguy: if i remove ' //= link controllers/journeys/journeys.js ' from manifest.js i get this error : https://gist.github.com/anonymous/9a85332de3e38d57ec75a263a49f961c
[02:11:12] renegadeandy: so i added that - then i get the error i reported to you previously
[02:59:51] renegadeandy: Rails appears to be removing my input when it renders the html.erb -- i am trying to follow the google maps places autocomplete article : https://gist.github.com/anonymous/706e74da77f1aa6559bcc3b2e47d36c0
[03:00:02] renegadeandy: article is here : https://developers.google.com/maps/documentation/javascript/examples/places-searchbox
[03:00:21] renegadeandy: How do i stop rails from removing my input (guessing it classes it as invalid outside of a form)
[03:32:08] renegadeandy: If anybody has some time - and fancies helping - please read and answer this : https://stackoverflow.com/questions/44469244/using-google-places-search-autocomplete-in-a-rails-app
[03:48:21] renegadeandy: Remote host closed the connection
[15:17:18] renegadeandy: has joined #RubyOnRails
[15:17:42] renegadeandy: Can somebody take a hand at helping with this : https://stackoverflow.com/questions/44469244/using-google-places-search-autocomplete-in-a-rails-app
[15:31:22] renegadeandy: Help please! Can somebody take a hand at helping with this : https://stackoverflow.com/questions/44469244/using-google-places-search-autocomplete-in-a-rails-app
[15:49:21] renegadeandy: quazimodo: thanks for replying
[15:49:25] renegadeandy: actually i just solved it
[15:50:02] renegadeandy: the map had been given no size, so it was not visible, and the line map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); was pushing the textbox onto the map - which was therefore also hidden
[15:50:20] renegadeandy: so by commenting out : map.controls[google.maps.ControlPosition.TOP_LEFT].push(input); and by giving the map div a size - it suddenly worked as designed
[16:07:53] renegadeandy: Remote host closed the connection
[21:48:56] renegadeandy: has joined #RubyOnRails
[22:04:16] renegadeandy: Remote host closed the connection

2017-06-09

[20:36:09] renegadeandy: Remote host closed the connection
[20:41:43] renegadeandy: has joined #RubyOnRails
[20:41:49] renegadeandy: arup_r: Fantastic - loveit
[20:47:05] renegadeandy: Remote host closed the connection
[21:11:15] renegadeandy: has joined #RubyOnRails
[21:11:53] renegadeandy: arup_r: if I need my javascript to load for a specific page *after* the DOM, do I simply move my javascript include tags in the layout to the bottom of the DOM?
[21:20:24] renegadeandy: arup_r: any harm in just moving : <%= javascript_include_tag "application" %> after yield?
[21:22:37] renegadeandy: because - my js is tied up in 'application' so...
[21:22:43] renegadeandy: that would need to be my solution
[21:25:35] renegadeandy: so basically - remove the //= require journeys from the application.js , then at the bottom have another yield
[21:37:19] renegadeandy: I am getting 'the asset journeys/journeys.js' is not in the asset pipeline. My manifest.js has : "//= link controllers/journeys/journeys.js" and i have app/assets/javascripts/journeys/journeys.js. I have also restarted the server. Can anybody spot my mistake?
[22:59:58] renegadeandy: I am getting 'the asset journeys/journeys.js' is not in the asset pipeline. My manifest.js has : "//= link controllers/journeys/journeys.js" and i have app/assets/javascripts/journeys/journeys.js. I have also restarted the server. Can anybody spot my mistake?