Activity Graph

Page 1 of 1


[04:54:48] arifba: has joined #RubyOnRails
[04:56:18] arifba: I read somewhere that it's usually a bad idea to have :id in the URL as it makes it easy for web crawlers to steal your data. What's a good alternative then?
[05:39:40] arifba: Ping timeout: 250 seconds


[16:11:55] arifba: has joined #RubyOnRails
[16:12:16] arifba: Right now my search route looks like /posts?utf8=✓&search=searchterm
[16:12:29] arifba: But I want to change it to look like /search/searchterm
[16:12:34] arifba: How would I do that?
[16:34:40] arifba: Quit: Page closed


[09:07:22] arifba: has joined #RubyOnRails
[09:07:36] arifba: Can someone have a look?
[09:07:38] arifba:
[09:07:46] arifba: It's probably something really simple and silly
[09:14:29] arifba: @sevenseacat How can I accomplish what I'm trying to then? Is there another way to find the current path?
[09:15:59] arifba: I just want to render different actions based on what the current path is
[09:17:17] arifba: well that's what i was intending to do...
[09:17:32] arifba: render :action works fine when i don't include the current_page? method
[09:19:02] arifba: index action basically shows all posts in normal view while masonry action shows them in masonry view (responsive grid)
[09:21:08] arifba: Initially I just ajax-ed the masonry views, but then I decided to make it a separate url for cases when javascript is turned off
[09:21:22] arifba: also, the ajax was messing with my infinite scrolling and stuff
[09:21:25] arifba: or am i doing it wrong?
[09:25:02] arifba: Now I just want to do this -- when the User clicks on TOP (i.e. the top method), I want the Top posts to be shown in either normal or masonry view depending on the page the user is currently in
[09:25:07] arifba: if that makes any sense..
[09:25:14] arifba: i'm probably doing it all wrong though
[09:25:25] arifba: but is there no alternative of current_page?
[09:44:48] arifba: Quit: Page closed


[15:31:02] arifba: has joined #RubyOnRails
[15:31:20] arifba: could someone take a look?
[15:42:33] arifba: Quit: Page closed


[14:07:43] arifba: has joined #RubyOnRails
[14:08:03] arifba: When rendering partials, is there a way to only render first x lines from it?
[14:12:28] arifba: yep that's what i'll have to do, but i was just wondering if it was possible
[14:14:20] arifba: Got it, thanks! Also, how did you tag me?
[14:20:44] arifba: Ping timeout: 250 seconds


[09:22:53] arifba: has joined #RubyOnRails
[09:23:43] arifba: can someone help me on this?
[09:25:27] arifba: yep the code is there
[09:26:45] arifba: I'm getting a "$ is not defined; please fix or add /*global $*/" error whenever I type in a line with $ in a javascript file
[09:28:56] arifba: the file works, however
[09:29:03] arifba: i'm just curious what this error means
[09:30:59] arifba: i just get this error in the IDE beside any line with $, but everything else works fine. so i'm guessing it's more of a warning than an error
[09:34:03] arifba: Quit: Page closed
[16:28:01] arifba: has joined #RubyOnRails
[16:28:28] arifba: Can someone help me out here?
[16:34:07] arifba: @mwlang the confusing part is it works on codepen, jsfiddle, or any other site you can try it, but not on a rails app. I tried this on two different rails apps and it worked on neither
[16:36:03] arifba: @mwlang everything else in application.css.scss works though, just not this one.
[16:39:42] arifba: @mwlang ehrm... how would i go about seeing that?
[16:41:45] arifba: @mwlang ok i do see the .scrollTop rules there
[16:43:03] arifba: @mwlang yep the rules are there. like i said in the stackoverflow post, everything in autohide.js works fine, it's just that the button doesn't animate
[16:43:13] arifba: @mwlang could you please quickly implement it into any of your apps to see if it works for you?
[16:43:24] arifba: i just want to make sure if the problem is on my side
[16:44:08] arifba: @mwlang ahh no worries!
[16:47:39] arifba: @mwlang hmm the doc types match as well
[16:49:27] arifba: @mwlang anyway, if you do come up with an answer later, please answer it on stackoverflow. thanks!
[16:56:22] arifba: Quit: Page closed


[06:01:48] arifba: has joined #RubyOnRails
[06:02:16] arifba: Could someone please take a look at this?
[06:05:45] arifba: so @comment = @article.comments.create(comment+_params.merge(user_id:
[06:09:24] arifba: @rvanlieshout worked like a charm! thanks!
[06:12:44] arifba: Quit: Page closed
[06:34:09] arifba: has joined #RubyOnRails
[06:37:26] arifba: @rvanlieshout sooo... i've ran into another problem regarding the comments
[06:37:42] arifba: rvanlieshout:
[06:47:09] arifba: ahh silly me. thanks again!
[08:03:47] arifba: how can i delete all records at once?
[08:08:51] arifba: so something like *.destroy_all for everything at once?
[08:19:36] arifba: i'm just trying to delete all user entry data, for eg, user accounts, articles, comments, etc all at once
[08:19:42] arifba: but keep everything else as is
[08:20:43] arifba: how would i go about doing that in the console?
[08:25:05] arifba: ok i'm in the sqlite console now. how do i delete all data from here?
[08:25:26] arifba: by the way, i'm only trying to delete user data, not the entire db structure
[08:31:05] arifba: Quit: Page closed
[08:31:56] arifba: has joined #RubyOnRails
[08:32:13] arifba: thanks! any idea how to do the same in Heroku?
[08:38:08] arifba: Quit: Page closed
[08:58:21] arifba: has joined #RubyOnRails
[08:59:30] arifba: will devise's current_user run into an error if there are multiple users signed in?
[09:08:16] arifba: Ping timeout: 250 seconds


[11:52:02] arifba: has joined #ruby
[11:53:51] arifba: how would i go about replacing multiple characters in a string using .tr?
[11:54:16] arifba: for instance, i want to replace all "a" and "b" from a string with a hyphen
[11:56:01] arifba: Client Quit
[12:25:14] arifba: has joined #ruby
[12:27:25] arifba: how can i selectively delete occurrences of a particular word from a string?
[12:27:29] arifba: for example
[12:27:43] arifba: str = "the quick the brown the fox jumped over the lazy dog"
[12:27:52] arifba: here, i'd like to do two things
[12:28:05] arifba: 1. delete only the third "the"
[12:28:23] arifba: 2. delete every third "the"
[12:43:31] arifba: jhass: this is just an example sentence
[12:43:54] arifba: jhass: what i want to know is if i can delete nth character from a string
[12:44:48] arifba: jhass: is there a way to do that?
[12:46:26] arifba: well then :/
[12:50:33] arifba: sorry guys, i'm new to this and i had no idea what xy was prior to this day
[12:50:39] arifba: domgetter: yes that's exactly what i'm trying to do
[12:54:50] arifba: Ping timeout: 250 seconds


[04:51:07] arifba: has joined #ruby
[04:52:24] arifba: how can i use case insensitivity in string.delete()?
[04:59:07] arifba: thanks! i'm trying to insert consonants inside / / but it doesn't seem to work
[04:59:14] arifba: "Chicken Nuggets".gsub(/^aeiou/i, "")
[04:59:41] arifba: for instance, here i want to delete all uppercase and lowercase consonants from "Chicken Nuggets"
[05:00:01] arifba: maybe i'm being thick
[05:09:58] arifba: thanks a ton! also, is it possible to get the same result using the .delete method?
[05:11:19] arifba: got it. thanks
[05:14:27] arifba: Quit: Page closed
[06:36:06] arifba: has joined #ruby
[06:37:14] arifba: can someone take a look? --
[06:37:49] arifba: i'm trying to access the variable 'name' outside the loop? is there an alternative way of doing it other than initializing the variable at the very beginning?
[06:39:23] arifba: could you please give an example what kind of loop/variable that'd work with?
[06:41:30] arifba: but while/until loops check for the condition at the beginning of the loop and won't work in this case
[06:44:04] arifba: i'm confused. i'd be more than glad if you could kindly rearrange this particular code using while or any other loop that doesn't use a block argument
[06:47:06] arifba: Quit: Page closed
[07:53:17] arifba: has joined #ruby
[07:55:24] arifba: is there a way to whitelist characters from regex?
[07:55:50] arifba: for instance, i'm using /[^a-z]/i to make sure that a string contains only alphabets
[07:56:11] arifba: here, i'd like to whitelist \s so the string can be of multiple words
[07:57:22] arifba: here's the code:
[08:03:18] arifba: Quit: Page closed
[08:09:12] arifba: has joined #ruby
[08:10:29] arifba: soo regarding my last question, i did some googling and settled with /[^\p{L} ]/i
[08:10:39] arifba: would this work now?
[08:10:47] arifba: or can it be improved further?
[08:11:32] arifba: and how do you even reply to someone on this chat?
[08:14:37] arifba: Quit: Page closed


[15:14:06] arifba: has joined #ruby
[15:14:35] arifba: guys i'm having trouble with a simple ruby program
[15:17:29] arifba:
[15:17:34] arifba: can someone take a look?
[15:18:10] arifba: when i run the program it prints nothing
[15:20:29] arifba: i'm really in the beginning stage of learning ruby and have no idea what Struct is
[15:21:36] arifba: i just learned the attr methods and was trying to implement them in a simple program
[15:21:51] arifba: is that where i went wrong? or was it the initialize part?
[15:22:18] arifba: what i'm expected to see: "sample"
[15:22:27] arifba: what i'm seeing instead: nothing
[15:25:04] arifba: so you mean @venue = venue instead of venue = @venue, for example?
[15:27:25] arifba: ahh silly me. thanks a ton!
[15:28:09] arifba: Quit: Page closed


[01:06:04] arifba: Quit: arif__
[02:22:02] arifba: has joined #RubyOnRails
[03:11:02] arifba: Quit: arif__
[03:14:37] arifba: has joined #RubyOnRails
[03:23:36] arifba: Quit: arif__


[20:18:43] arifba: has joined #RubyOnRails


[20:28:49] arifba: any idea how i can specify the prefix of the fields in the form using fields_for?
[20:29:24] arifba: like form_for, where you can pass the ???as:??? option
[20:29:52] arifba: for example field_for @user will use ???user??? as the prefix for the name of the input in the form
[20:30:01] arifba: i???d like to change that
[20:30:24] arifba: does that make sense?
[20:31:41] arifba: ie. form_for(@person, as: :client) do |f| would result in params[:client] getting submitted, not params[:person]
[20:31:48] arifba: i???d like to do the same thing using fields_for
[20:37:24] arifba: rhizome: thanks but no luck - the second parameter is just ignored
[20:38:58] arifba: the actual code is something like fields_for @flow.transfer_details, as: :transfer_details, however the html generated is has the class name of the transfer_details object as the prefix in the name of the inputs.
[20:39:23] arifba: just surprised i can???t dig up any others wanting this use case
[20:39:29] arifba: (on the web i mean)
[20:41:46] arifba: rhizome: you the man (or woman), thanks, you got me on the right track
[20:42:08] arifba: this worked: <%= fields_for :transfer_details, @flow.transfer_details do |gf| %>
[20:44:38] arifba: dminca: ???/msg nickserv help???
[20:44:43] arifba: should get you on the right track