Activity Graph

Page 1 of 1


[14:33:59] terrabl: has joined #RubyOnRails
[14:35:18] terrabl: So I'm having a weird problem. Whenever I put my rails app/server up in production mode, and then I make a request to somewhere, instead of going to the URL + the endpoint it goes to localhost + the endpoint, does anyone know why this is? Is there a setting that I need to put so that it concats the endpoint to the url?
[14:48:14] terrabl: Quit: Page closed


[15:25:16] terrabl: has joined #RubyOnRails
[15:27:44] terrabl: I'm having trouble utilitizing asset pipeline to link to some of my font files, for example I need to use the bootstrap-glyphicons but because this app doesn't necessarily need internet access I need it to be able to get it without going to a CDN or something. But whenever I try to link it to app/assets/fonts it isn't finding the .woff file or .eof and such
[16:12:52] terrabl: Quit: Page closed


[18:58:12] terrabl: has joined #RubyOnRails
[19:46:09] terrabl: Quit: Page closed


[14:47:49] terrabl: has joined #RubyOnRails
[14:49:44] terrabl: so im trying to link_to something in my probject but when I set it up like this '<%= link_to 'Review', '/loadtests/#{@tests["uuid"]}/review', :class => "btn btn-primary", :id => "loadtest_button" %>' the @tests["uuid"] doesnt get translated to a literal for some reason
[14:50:43] terrabl: thanks, dumb mistakes
[14:51:04] terrabl: Client Quit


[00:57:28] terrabl: Ping timeout: 250 seconds


[21:34:31] terrabl: has joined #ruby
[21:35:41] terrabl: Hey guys, how would I use gsub or sub to change this string {"gametitle"=>"FIFA"} into this {"gametitle"=>/FIFA/} I understand that gsub is global sub and I know that sub only does the first occurance so could I make it so sub does the 3rd and 4th occurances?
[21:37:35] terrabl: That's what I was thinking but could you further explain how to get to that using sub?
[21:40:19] terrabl: Yeah, i have never really worked with regex but I understand matching, just not replacing.


[13:59:54] terrabl: has joined #RubyOnRails
[14:00:17] terrabl: pretty simple question, if I wanted to add contenteditable = "true" to an erb file would I just do <%= @test["title"], :contenteditable => "true"%>
[14:01:46] terrabl: Yeah but I want to make it editable?
[14:01:52] terrabl: Is that possible?
[14:02:11] terrabl: yeah but when I put a div around it it puts a weird line break
[14:03:45] terrabl: Without the content tag i get an : syntax error, unexpected tLABEL, expecting '=' ...test['title'], contenteditable: true );@output_buffer.safe_a... ... ^
[14:04:55] terrabl: Well it isnt really that important. It's justa line break ahah thanks for helping
[14:04:58] terrabl: Quit: Page closed
[14:53:18] terrabl: has joined #ruby
[14:55:15] terrabl: Hey guys, I have a string like the following (<ul><li><u>sadfasd</u></li><li><u>asdfasdf</u></li></ul>) and I want to add "class = list-group" to every instance of ul but not /ul and I want to add "class = list-group-item" to every instance of li but not /li, I know I can't use gsub because gsub would replace that part, is their something similar to gsub but for addition?
[14:56:21] terrabl: Not parsing, the html comes in through a form and I need to add these classes to it
[14:56:44] terrabl: I know I should do it javascript but its a WYSIWYG editor and this is the only way I have found to get the string.
[15:02:46] terrabl: Thank you, I didn't even think about just using gsub to replace ul when I find ul
[15:02:53] terrabl: I was thinking I had to add to ul
[15:07:02] terrabl: Quit: Page closed


[13:45:34] terrabl: has joined #RubyOnRails
[13:58:23] terrabl: Quit: Page closed


[15:20:04] terrabl: has joined #ruby
[15:21:50] terrabl: Hello, I need to be able to take a JSON response from HTTParty, and then turn that into a hash so that I can run key value pairs on it. But everything I am attempting to do isn't working. It was working when I hard coded the hash but when I did JSON.parse(response.body), which I though puts the JSON to a hash it isnt allowing me to access elements using hash[:key]
[15:28:15] terrabl: Yeah I know that but if I do that then I cant cycle through using .each do |key, value|
[15:29:44] terrabl: really? because when I do hash["details"].each do |k, v| it gives me an error
[15:30:04] terrabl: ah frick i was missing the hash[0]["details"
[15:30:24] terrabl: Yeah I know I think I figured it out, I was making the gist
[15:34:38] terrabl: Nope. I figured it out, thanks though
[15:35:15] terrabl: uh... stop
[15:36:16] terrabl: maybe if it was a python bot it would have banned him faster hahah
[15:37:12] terrabl: Quit: Page closed
[20:22:32] terrabl: has joined #RubyOnRails
[20:24:07] terrabl: Hello, I need to link to my show method in my controller and I thought I could do this by doing <%= link_to 'Show', response %> but whenever I click on that button it doesn't direct me to the correct place. It should be redirecting me to /tests/:uuid but it just redirecting me to /:uuid
[20:28:39] terrabl: Like it renders the html as <a href="a91a5580-1bab-0134-ecad-074d5946dff2">Show</a> When it should be <a href="loadtests/a91a5580-1bab-0134-ecad-074d5946dff2">Show</a>
[20:37:43] terrabl: Quit: Page closed


[20:13:37] terrabl: has joined #ruby
[20:13:49] terrabl: When I do DateTime.parse(), how come it can't parse something like 06/23/2016 12:00 AM it's giving me an invalid date error
[20:16:15] terrabl: ugh, i didnt want to lol
[20:27:04] terrabl: Ping timeout: 250 seconds


[13:51:36] terrabl: has joined #RubyOnRails
[13:52:17] terrabl: Hello, So I have a long list of checkboxes and would like to make it so the checkboxes are stored in a JSON array as objects? Is there a way to do this?
[13:52:36] terrabl: At the moment I am storing them as comma seperated strings.
[13:58:52] terrabl: I would like to send the JSON off to an API afterwards
[13:59:09] terrabl: And then that API will store the rails form JSON in its own database
[14:02:43] terrabl: Honestly I really just care about the JSON that is related to the form that the user filled out
[14:05:00] terrabl: I think the JSON would be created by the client when they hit submit with the values being the info they put in the text boxes and such
[14:05:51] terrabl: Not really, just using rails as a front end atm
[14:33:28] terrabl: Quit: Page closed


[14:08:43] terrabl: has joined #RubyOnRails
[14:10:38] terrabl: Hello, at the moment I am attempting to create a form that has nested objects, for example if someone wants to input more than one type of food they can click an add button that would create a new row, I would like to store this in a mongo database as an array of different objects but I do not understand how to created nested form objects nor do I know how to store an array of objects intoa mongoDB from rails.
[14:12:58] terrabl: If someone could point me in the right directrion of doing either of these thigns ti would be great
[14:31:56] terrabl: Yeah I just have to use mongo for the project I'm working on. It's good but their isnt much documentation on it.
[14:36:35] terrabl: I also could just store the form data as a json and send it to mongo that way. I think that would be the best way but I still have to figure out how to created nested objects...
[15:19:45] terrabl: Quit: Page closed


[14:42:04] terrabl: has joined #ruby
[14:44:05] terrabl: Hey guys, Is there any reason that I would be getting a TestController is not a module (TypeError) in this code? It is saying that TestController is not a module? https://gist.github.com/terrabl/e7fb88ba471b21d9fdbc996a97ad1188
[14:47:38] terrabl: I figured out what I did wrong, i accidently made a class TestController inside of the file I was requiring inside of loadtestcontroller.rb
[14:47:55] terrabl: I thought as a module I can just call the function as long as I required it in the file?
[14:48:22] terrabl: Like calling create from scheduler would run the TestControllers.create method?
[14:50:31] terrabl: Sorry I'm new to ruby could you explain or point me in a direction that will help me understand.
[14:50:59] terrabl: I like the concept of modules, and need to implement them, but I think I am correlating them too closely to user defined regular old classes
[14:56:01] terrabl: apeiros: yeah i guess its probably something I could have looked up myself, sorry for bothering you.
[16:16:46] terrabl: Can you pass variables to a module method?
[16:21:42] terrabl: Nevermind that was a stupid question, something else was wrong.
[18:15:38] terrabl: Does anyone have any preferances on a ruby gem that can plot a bunch of data points?
[18:31:54] terrabl: If there is a gem availible for rails does that mean i can use it in regular scripting ruby too?
[18:32:02] terrabl: Like I want to use the gruff graphing gem
[18:32:42] terrabl: Awesome. Is there a way to tell?
[19:23:40] terrabl: Hey guys I made this SO question if you guys could check it out maybe : http://stackoverflow.com/questions/37755515/changing-the-format-from-a-mysql-datetime-format-to-a-different-type-in-ruby
[19:31:46] terrabl: so time.parse.strftime?
[19:34:15] terrabl: Hmm, I guess I'm just trying to turn 2016-06-09 14:29:34 into 14:29_20160609
[19:37:03] terrabl: Still not working... its just outputting 2016-06-09 13:28:34 +0000
[19:38:35] terrabl: Exactyl what you put. It makes sense but I dont know what it isnt working
[19:38:44] terrabl: I'm looking at DateTime.parse right now
[19:41:46] terrabl: Thanks friend!
[20:14:54] terrabl: How would I use a graphing tool to graph this json data? https://gist.github.com/terrabl/1bee2ee18b3793cf3f4671e965b44080
[21:04:00] terrabl: Quit: Page closed


[15:16:26] terrabl: has joined #RubyOnRails
[15:21:28] terrabl: How do I include a javascript file that only one html.erb file can utilize?
[15:39:49] terrabl: I am using sprockets and I understand the preformance bonuses, but for the scale of the project that I am working on, it is just more of a hinderance than anything. I would rather just have each page have its own individual JS/CSS
[16:46:56] terrabl: Quit: Page closed
[16:53:43] terrabl: has joined #RubyOnRails
[16:54:24] terrabl: So I created a scaffold in ruby on rails, and whenever I hit edit it shoes the form, but none of the text boxes are auto generated with the data that is already in the database, is there a way to do this easily without just doing some jquery stuff
[17:55:31] terrabl: tubbo: yes im using form_for sorry for the late reply
[18:03:24] terrabl: hmm. It doesnt seem to be populating the form with the results from when I first filled it out
[18:03:45] terrabl: edit.html.erb literally just calls render form
[18:05:48] terrabl: Oh I think I know why
[18:06:01] terrabl: I changed the ruby stuff to html stuff
[18:17:27] terrabl: Do you know how to add classes to the <%= f.textfield %>
[18:26:02] terrabl: easier than i though
[18:33:38] terrabl: Quit: Page closed


[13:16:41] terrabl: has joined #RubyOnRails
[13:24:29] terrabl: Has anyone ever gotten a wrong number of arguments (2 for 1) error when including //= tree . in their application.js
[13:26:14] terrabl: no its all js and coffe
[13:27:23] terrabl: oh I have always been doing require tree . rather than require_tree .
[14:01:38] terrabl: Hey this may be a basic question but can someone tell me the difference between the two below? find in the gist https://gist.github.com/terrabl/6347742e5eeb72ab8d8cc02490b7184e
[14:10:14] terrabl: morfeen: http://guides.rubyonrails.org/getting_started.html https://www.youtube.com/watch?v=GY7Ps8fqGdc&list=PLGLfVvz_LVvSngZQwrhYXlPnJf1zYqghI
[18:50:07] terrabl: Could someone help me out in getting this imageNotes Javascript library into my rails project? https://github.com/waynegm/imgNotes
[18:50:21] terrabl: Or point me in the direction of something that can help me
[18:54:19] terrabl: How do I link to those then?
[18:54:24] terrabl: does reqquire_tree .
[18:54:28] terrabl: pick those up?
[18:57:48] terrabl: What do you mean link them directly?
[18:59:19] terrabl: And that would go in my application.html.erb?
[19:01:18] terrabl: Is it any different if its a .min.js file because it is unable to find that one
[19:02:24] terrabl: There isnt an unminified version in the library
[19:03:56] terrabl: oh im talkiong about jquery-mousewheel.min.js
[19:04:05] terrabl: It's having trouble finding that file
[19:04:59] terrabl: I put jquery-mousewheel.min.js in vendor/assets/javascripts
[19:06:15] terrabl: <%= javascript_include_tag "jquery-mousewheel.min.js" %> in application.html.erb
[19:08:12] terrabl: Looks like it still didn't work.
[19:10:06] terrabl: Still couldnt find it
[19:13:17] terrabl: Sounds good. I just need something that will allow for users to post notes or comments on an image
[19:24:15] terrabl: Is it the bundle.js or main.js?
[19:24:38] terrabl: nevermind im dumb
[19:26:17] terrabl: Now I'm just getting other errors
[19:26:41] terrabl: $.widget is not a function, Cannot read property 'track' of undefined, and $(...).imgNotes is not a function
[19:31:21] terrabl: That wont fix the errors that I have I dont thibkt hough
[19:31:29] terrabl: I just tried it and i still have them
[19:38:12] terrabl: Ping timeout: 250 seconds


[14:44:05] terrabl: has joined #RubyOnRails
[14:48:21] terrabl: https://gist.github.com/terrabl/dd6eacea8685929e9754c5baee68cc6a
[14:48:21] terrabl: Hey guys, I am attempting to fix a bug in my ruby on rails form that will allow for a user to submit a first and last name to a database, i know this is simple but I am trying to get it to work before making it more complicated than it needs to be. At the moment I am getting a undefined local variable or method `student_params' for #<StudentsController:0x9468798> error in my code, you can find a gist of the relevant files here:
[14:50:38] terrabl: sevemseacat: is it bad if i dont know how to do that? Could you point me to a guide in which someone creates a params method inside their controller?
[15:01:45] terrabl: Thank you sevenseacat, I was able to fix it with your help and that article.
[16:42:33] terrabl: What is the best way of submitting checkboxes to mysql in rails, would I just have as many different columns as I have checkboxes?
[16:44:03] terrabl: I'm pretty new and basically learning as I'm going through, I just am having trouble in how to set up this post request that uses check boxes.
[16:46:21] terrabl: Hmm, what do you mean?
[18:55:01] terrabl: smathy: I founda tutorial that walked me through creating an array fo checkboxes that works well with a database. Thanks!
[18:56:33] terrabl: of course, let me link you the youtube video
[18:57:23] terrabl: jayce0b0: https://www.youtube.com/watch?v=NTLnDCx9wL0 It doesnt have any sound and you should skip to 11:23 because he messes up the first part.
[18:57:57] terrabl: He uses scaffold so its a little noob friendly but I was able to use model pretty easily as well.
[18:59:10] terrabl: taking a look at what you have, it looks like it should fix your problem, but the thing is it stores it in the database as a concatinated string if there is more than one, so if someone had all of the "fax machines" then it would be a concat string of all of those.
[19:51:01] terrabl: Does anyone know of a gem that is a number picker but allows for mouse wheel scrolling to make the number go up and down, I have looked around but for some reason I'm creating horrible google search queries or it doesnt exist
[19:51:39] terrabl: A number picker is bad UX?
[19:53:00] terrabl: But that doesnt allow for scrollable inputs?
[19:54:23] terrabl: Is having a scrollable number picker bad UX design?
[19:55:30] terrabl: Hmmm.. interesting, i didnt think it was a solved problem but I guess I wont worry about finding one in rails.
[20:00:17] terrabl: Failbit: can you give me an example
[20:01:27] terrabl: Failbit: you're right that just looks wrong
[20:05:58] terrabl: Ping timeout: 250 seconds


[00:01:20] terrabl: Ping timeout: 250 seconds


[18:56:39] terrabl: has joined #RubyOnRails
[18:58:32] terrabl: Hello guys, I'm new to ruby on rails so this might be a easy question but I thought I should still have it. So I have two different webpages that include two different sets of javascript and CSS is there a way that I can associate the javascript and css with their assocaited .html.erb file or is that not possible?
[18:59:28] terrabl: Without turbolinks because I got rid of those per your advice yesterdat
[18:59:31] terrabl: yesterday*
[19:00:09] terrabl: always a bit haha
[19:00:57] terrabl: Well I was doing it the ghettto not rails way before where I just have <script> tags in the associated .html.erb files
[19:03:17] terrabl: Yeah they are completely different. I have 3 .js files and 3 .css files, there is form.{js,css} application.{js,css} and template.{.js,css}
[19:04:26] terrabl: Would those link tags go inside of the associated .html.erb files?
[19:06:42] terrabl: Sorry I know I'm probably annoying you with my noobiness, but my layouts folder only has application.html.erb which has the link tags to application.{js,css}
[19:07:31] terrabl: just call it like template.html.erb?
[19:08:07] terrabl: And then how much overlap is there between code in application.html.erb and template.html.erb?
[19:08:36] terrabl: Well what is supposed to be inside of template.html.erb??
[19:10:16] terrabl: yes its completly different css and js
[19:10:33] terrabl: Alrighty I'm going to try to read this guide gimme a minute
[20:21:53] terrabl: I'm still suck on this page specific javascript stuff. I have tried a couple of things. I followed the solution outlined by this guide http://brandonhilkert.com/blog/page-specific-javascript-in-rails/ as well as the other solution that was mentioned above.
[20:50:48] terrabl: Does anyone know why I might be getting a wrong number of arguments (2 for 1) error whenever I add require tree . to my application.js


[18:38:37] terrabl: has joined #ruby
[18:38:49] terrabl: Hey guys I am having some trouble implementing CSS and JS on my html.erb files in Rails. The gist included (https://gist.github.com/anonymous/6b4262524ad96ccd48dd) has all of the files that I believe would be necessary for you to understand the problem. In application.html I changed the original stylesheet and javascript link tags to be 'default' instead of 'application' because that is what I read to do on a SO question. If you have
[18:38:51] terrabl: I attempted to read up on the asset pipeline and I think I understand but I am always getting a 404 error when I try to load up default.js and default.css
[18:40:01] terrabl: Lol I just got redirected here from anotehr channel
[18:40:10] terrabl: How would I get there?
[18:40:27] terrabl: it for sure is
[18:40:29] terrabl: thanks guys
[18:40:31] terrabl: has joined #RubyOnRails
[18:40:41] terrabl: Hey guys I am having some trouble implementing CSS and JS on my html.erb files in Rails. The gist included (https://gist.github.com/anonymous/6b4262524ad96ccd48dd) has all of the files that I believe would be necessary for you to understand the problem. In application.html I changed the original stylesheet and javascript link tags to be 'default' instead of 'application' because that is what I read to do on a SO question. If y
[18:40:47] terrabl: I attempted to read up on the asset pipeline and I think I understand but I am always getting a 404 error when I try to load up default.js and default.css
[18:43:10] terrabl: Showing c:/Users/*/Desktop/loadtest/app/views/layouts/application.html.erb where line #5 raised: TypeError: Object doesn't support this property or method This is the error that I am recieving when I try to load the page atm
[18:47:24] terrabl: https://gist.github.com/anonymous/6b4262524ad96ccd48dd1255305cd063
[18:47:40] terrabl: Leave the application name?
[18:47:46] terrabl: and not change to default?
[18:49:03] terrabl: I have it at the point where it will load the html but it is unable to find the .css and .js files
[18:49:38] terrabl: In the Inspect > network of google chrome it says that it 404s when it looks for default.js and default.css but I have never created those files
[18:50:25] terrabl: Yeah they were like that originally but it results in the html not even being loaded
[18:51:06] terrabl: where would you like to see the full error trace?
[18:51:38] terrabl: Is there a way to edit it?
[18:53:11] terrabl: https://gist.github.com/terrabl/82f04b718d6e82c90ee6c02b4d04888d
[18:53:20] terrabl: I had to make a new one because i wasnt signed in for some reason
[18:57:00] terrabl: universa1: I changed it to 'default' because of this SO question http://stackoverflow.com/questions/28421547/rails-execjsprogramerror-in-pageshome
[19:01:04] terrabl: I just fixed it
[19:01:33] terrabl: I changed application to application.css and application.js and then I added =require turbolinks to application .js without the //
[19:11:10] terrabl: Quit: Page closed