Activity Graph

Page 1 of 124 | Next »


[07:46:59] rvanlieshout: has joined #RubyOnRails
[07:47:04] rvanlieshout: has left #RubyOnRails: ()
[07:47:35] rvanlieshout: has joined #RubyOnRails
[07:55:49] rvanlieshout: Quit: leaving


[04:32:12] rvanlieshout: has joined #RubyOnRails
[04:49:30] rvanlieshout: bluerail.nl :)
[04:51:32] rvanlieshout: hehe yeah. it's shameless spam, but you asked for it :) I co-own it
[04:53:06] rvanlieshout: am a bit ashamed to tell the site isn't written in rails...
[04:53:37] rvanlieshout: it's elixir + phoenix
[05:14:48] rvanlieshout: nadav: you mean a table with user_id:references article_id:references vote:something ?
[05:14:56] rvanlieshout: with a uniq index on [user_id, article_id]
[05:15:46] rvanlieshout: nadav: yeah sure. you might want to add a counter_cache if you expect a lot of votes
[05:16:43] rvanlieshout: nadav: to get the current vote status you'll have to query that table and sum (or whatever) vote
[05:17:15] rvanlieshout: that'll be fine if you add an index on article_id, but it might still be much if your articles are queried really often and you have a really big number of votes
[05:18:55] rvanlieshout: yeah. although iirc counter_cache only works for count, so you might need to create something yourself.
[05:19:02] rvanlieshout: something to consider when you've got this working :)
[05:19:53] rvanlieshout: nadav_: forget about it for now, after this is done read http://guides.rubyonrails.org/association_basics.html and seach for 'counter cache' in that guide
[05:20:02] rvanlieshout: it's in
[05:20:19] rvanlieshout: and has a hidden id: http://guides.rubyonrails.org/association_basics.html#options-for-belongs-to-counter-cache
[06:26:49] rvanlieshout: you can encapsulate anything
[06:27:04] rvanlieshout: fetch on server using http, using api, on client using ajax, iframe (juch)
[06:32:45] rvanlieshout: what exactly do you want to do?
[06:57:49] rvanlieshout: nadav_: ST3 for me to
[06:57:53] rvanlieshout: + vagrant with puppet :)
[07:31:24] rvanlieshout: syndikate: what gem?
[07:31:32] rvanlieshout: and what do you mean by locally vs globally?
[07:32:09] rvanlieshout: so use it in an other application?
[07:33:15] rvanlieshout: and how do you want to test it?
[07:34:35] rvanlieshout: is it a gem you use in a rails app?
[07:35:07] rvanlieshout: how would i use that gem?
[09:54:37] rvanlieshout: noob_on_rails: whut?
[15:09:28] rvanlieshout: Quit: leaving


[05:43:24] rvanlieshout: has joined #RubyOnRails
[06:26:56] rvanlieshout: noob_on_rails: you just commited all things, so there is nothing new to commit
[06:47:09] rvanlieshout: noob_on_rails: then you've got an outdated version yourself
[06:47:19] rvanlieshout: you need to pull changes first (which could cause a conflict)
[06:47:39] rvanlieshout: AimlessRaven: there are tons of tutorials available for that
[10:34:49] rvanlieshout: P4Titan: to do what?
[10:36:11] rvanlieshout: P4Titan: and what does 'handle' mean?
[10:36:47] rvanlieshout: the method (note: function != method) is called after all before_filters (deprecated -> use before_action)
[10:36:52] rvanlieshout: does that involve user interactin?
[10:37:16] rvanlieshout: then you'll have to redirect the user to somewhere else
[10:37:20] rvanlieshout: and redirect him back on a previous page
[10:37:28] rvanlieshout: to a previous page
[10:38:07] rvanlieshout: user requests FooController#bar, gets redirected to sign in, signs in an wants to go back to FooController#bar ?
[10:38:36] rvanlieshout: and what's your question? :)
[10:39:04] rvanlieshout: that method hasn't been executed yet
[10:39:07] rvanlieshout: you only have the params
[10:39:09] rvanlieshout: if applicable
[10:39:24] rvanlieshout: what's 'state'?
[10:39:59] rvanlieshout: that's not going to happen if you redirect from a before_filter
[10:40:17] rvanlieshout: nor should it. cause if you want that method to be executed, you don't want to redirect in a before_
[10:41:04] rvanlieshout: if you send the user to an authentication page you don't want that action to be performed
[10:41:13] rvanlieshout: cause there is a reason you redirect the user away
[10:41:22] rvanlieshout: so that action is supposed to be executed after the user signs in
[10:41:52] rvanlieshout: you redirect back to where they came from
[10:42:03] rvanlieshout: what are you using for authentication?
[10:43:36] rvanlieshout: doesn't it allow you to set a action to be called after sign in?
[10:44:09] rvanlieshout: ok. then before you redirect, save the requested url in the session
[10:44:26] rvanlieshout: then create an action where you redirect to after sign in. in that action redirect back to that saved url from the session
[10:45:16] rvanlieshout: request.url, or url_for(). save it in session
[10:46:02] rvanlieshout: because a flash is intendend to be displayed on the page
[10:46:09] rvanlieshout: just because of wrong purpose
[10:46:48] rvanlieshout: unless you remove it from the session
[10:57:55] rvanlieshout: snoobydoo: last_post.created_at.at_beginning_of_day
[11:00:11] rvanlieshout: and why does created_at > ? fail?
[11:01:31] rvanlieshout: what sql is executed and what are the two created_ats in the db?
[11:01:59] rvanlieshout: timestamp of what?
[11:02:16] rvanlieshout: show the actual sql and the created_at's of the two using select created_at from posts
[11:07:21] rvanlieshout: what db engine?
[11:07:59] rvanlieshout: you're using a string as argument?
[11:08:17] rvanlieshout: e.g. 2016-07-28T10:43:13.699Z ?
[11:08:56] rvanlieshout: i really can't follow you
[11:09:05] rvanlieshout: maybe you should gist it
[11:09:07] rvanlieshout: what line fails?
[11:12:00] rvanlieshout: GorillaApe: even if so, why not use a unique index?
[11:15:09] rvanlieshout: snoobydoo: it does. there is a slight difference in those 2 times
[11:15:27] rvanlieshout: the one you've created yourself doesn't include the msec
[11:15:33] rvanlieshout: but why would you want to create such a one yourself?
[11:16:58] rvanlieshout: snoobydoo: right. but what happens there is perfectly valid
[11:17:06] rvanlieshout: the one that is found, is actually created after the given timestamp
[11:20:03] rvanlieshout: well.. look at what's in the first query
[11:20:12] rvanlieshout: .669000 is lower then .669066
[13:26:49] rvanlieshout: alfiemax: don't you mean union the two?
[13:37:04] rvanlieshout: Quit: leaving


[05:10:48] rvanlieshout: has joined #RubyOnRails
[14:15:31] rvanlieshout: Quit: leaving


[04:20:34] rvanlieshout: has joined #RubyOnRails
[04:24:41] rvanlieshout: why do you even care
[04:25:46] rvanlieshout: it's not the same as having no query string
[04:25:51] rvanlieshout: that could matter
[04:28:19] rvanlieshout: Talltree: that thing is there for a good reason
[04:28:23] rvanlieshout: and is supposed to be a param
[04:29:35] rvanlieshout: i'd rather have my app working on as many places as possible then having some less data in the url that hardly any visitor will notice
[04:30:37] rvanlieshout: and commit=search is only there cause you gave your submit button a name
[07:23:44] rvanlieshout: conta: "#{a.content_type =~ %r(image) ? :images : :files}/:id/.." ?
[07:27:14] rvanlieshout: no, don't use a lambda
[07:27:30] rvanlieshout: the string is ok :)
[07:28:53] rvanlieshout: but that lambda is never called
[07:28:55] rvanlieshout: what's the full context here?
[07:32:06] rvanlieshout: conta: then just use a :file_type, ish and have a method file_type?
[07:32:18] rvanlieshout: similar to how :id, :base and stuff are parsed
[08:55:29] rvanlieshout: silpa: by not compressing them?
[08:55:34] rvanlieshout: why would you loose quality?
[08:56:06] rvanlieshout: and what exactly is your question then?
[08:57:12] rvanlieshout: but without losing quality?
[08:57:28] rvanlieshout: then use a loseless compression
[08:57:38] rvanlieshout: lossless even
[10:56:47] rvanlieshout: dionysus69: define 'pass'
[10:57:50] rvanlieshout: you could render to string, but why would you want to do that?
[10:58:22] rvanlieshout: http://api.rubyonrails.org/classes/AbstractController/Rendering.html#method-i-render_to_string
[10:58:44] rvanlieshout: oh. so just a variable
[10:58:47] rvanlieshout: you can use locals for that
[10:58:58] rvanlieshout: <%= render partial: 'foobar', locals: { variable: 'hi123' }
[10:59:10] rvanlieshout: the way you should use partials. if any of your partials contains any variable with @, it's wrong :)
[10:59:53] rvanlieshout: render partial: foobar
[11:09:37] rvanlieshout: does bundle install show you any errors, Torrone?
[13:14:31] rvanlieshout: MartinKragh: sure, go ahead
[13:16:04] rvanlieshout: you don't link forms, you either set the subject_id in the controller or using a hidden input
[13:17:40] rvanlieshout: could you gist the controller, form and request log for that second form
[13:18:31] rvanlieshout: Ankhers: no, and it shouldn't
[13:18:38] rvanlieshout: the controller performing that action should supply that info
[13:21:15] rvanlieshout: MartinKragh: !gist
[13:22:17] rvanlieshout: MartinKragh: yeah sure
[13:22:47] rvanlieshout: syndikate: base16, syntax for coffeescript, elixir, haml, puppet, sass
[13:24:07] rvanlieshout: are you looking for a particular one, syndikate?
[13:25:33] rvanlieshout: me too, those other syntax things are just there because it already has support for rails
[13:25:53] rvanlieshout: and i have a terminal window nearby, got many aliasses in there
[13:27:06] rvanlieshout: host is osx, dev is running in centos using virtualbox + vagrant + puppet
[13:28:20] rvanlieshout: :) i just don't want to keep track of all dependencies related to different projects
[13:29:38] rvanlieshout: syndikate: i'll add it to my todo list. thnx
[13:29:51] rvanlieshout: i don't use git operations much in my editor. mostly command line
[13:37:56] rvanlieshout: i don't have the file-bar open :)
[14:05:55] rvanlieshout: Quit: leaving


[04:57:05] rvanlieshout: has joined #RubyOnRails
[07:20:01] rvanlieshout: but you're not willing to invest time to find it out
[07:21:58] rvanlieshout: there indeed is a history to this
[07:26:10] rvanlieshout: elomatreb: AimlessRaven has been here for a long time, but still refuses to follow any tutorial or read documentation
[07:26:47] rvanlieshout: and i agree with both Scient and dminuoso. A ternary operator would reduce half of that code, as AimlessRaven requested. Moving it to a helper or a decorator are also possibilities. Feel free to have opinions on if they are the right one
[07:28:59] rvanlieshout: elomatreb: but that's just because it's been told over and over again
[07:30:53] rvanlieshout: elomatreb: imho it does matter
[10:02:04] rvanlieshout: AimlessRaven: just curious, why don't you feel any urge to invest some time to learn?
[10:55:44] rvanlieshout: AimlessRaven: and added stuff to your application.scss?
[10:56:06] rvanlieshout: show that you care
[10:56:12] rvanlieshout: a proper gist
[11:00:49] rvanlieshout: AimlessRaven: what version of that gem?
[11:04:50] rvanlieshout: what version of font awesome introduced that percent icon?
[11:06:51] rvanlieshout: abhinavmehta: i wasn't reading along. let me catch up a bit
[11:07:38] rvanlieshout: you've got the full stack trace nearby?
[11:10:31] rvanlieshout: the error seems to be on line 14 of your home.slim
[11:10:34] rvanlieshout: stylesheet-link_tag
[11:11:25] rvanlieshout: yeah. so that's weird. does it happen if you empty your stylesheet?
[11:12:01] rvanlieshout: javascript can be present
[11:12:10] rvanlieshout: and if we comment line 14 of that layout file?
[11:12:43] rvanlieshout: but even the partial stack of that image_tag leads to something else
[11:13:14] rvanlieshout: is that an assumption or you've already tried that?
[11:13:42] rvanlieshout: so it fails if you include just any
[11:14:02] rvanlieshout: could we try with only that css removed?
[11:15:44] rvanlieshout: and what's in app/extensions/controllers/app_base.rb:23:in `block (2 levels) in <module:AppBase>' ?
[11:18:18] rvanlieshout: could we remove that block just to get a cleaner stack trace?
[11:21:42] rvanlieshout: in what env is this app running?
[11:21:59] rvanlieshout: alfiemax: all that are valid on your server, there is a rake (or rails (for version 5)) task for it
[11:22:54] rvanlieshout: and the output i get here is from running in production?
[11:23:11] rvanlieshout: also edit https://github.com/lautis/uglifier/blob/master/lib/uglifier.rb#L161 (use bundle show uglifier to get the path to that gem)
[11:23:21] rvanlieshout: and have it puts the params
[11:23:25] rvanlieshout: to see what it's even trying to compile
[11:24:30] rvanlieshout: + following upgrade instructions
[11:24:55] rvanlieshout: alfiemax: iirc yes
[11:25:24] rvanlieshout: abhinavmehta: yes
[11:41:06] rvanlieshout: abhinavmehta: happy to hear that
[11:42:20] rvanlieshout: you're welcome
[12:47:27] rvanlieshout: Quit: leaving
[19:19:09] rvanlieshout: has joined #RubyOnRails
[20:08:22] rvanlieshout: Quit: leaving


[05:16:08] rvanlieshout: has joined #RubyOnRails
[09:35:07] rvanlieshout: i personally prefer centos over ubuntu, but that's just what you like
[09:53:32] rvanlieshout: bookies: could you gist that snippet?
[09:59:25] rvanlieshout: use a decorator / presenter
[09:59:31] rvanlieshout: then it would just be <%= @user.country %>
[09:59:38] rvanlieshout: and @users.decorate.each do |user|
[10:00:04] rvanlieshout: it's quite easy to implement yourself, or use a gem
[10:00:12] rvanlieshout: @users.map(&:decorate).each do |user|
[10:00:46] rvanlieshout: in that case you'll just need a #decorate on any activerecord instance that tries to doe a UserDecorator.new(usser). you can delegate everything to the object in there
[10:00:50] rvanlieshout: and create a def country
[10:01:15] rvanlieshout: https://github.com/drapergem/draper
[10:01:18] rvanlieshout: is one of those gems
[10:02:14] rvanlieshout: nope, not in the model
[10:02:29] rvanlieshout: the model shouldn't contain view-related stuff. it's going to be a new layer (app/decorators)
[10:02:38] rvanlieshout: somewhat like helpers, but then related to an instance
[10:03:13] rvanlieshout: nope. helpers are not instance related. you could create a helper, but that still feels ugly. then it would be something like <%= user_country(user) %>
[11:44:47] rvanlieshout: finnnnnnnnnnn: yes
[11:45:08] rvanlieshout: to find one users blogposts with those ids
[11:46:14] rvanlieshout: it exactly is :)
[11:55:29] rvanlieshout: and read the documentation
[11:55:36] rvanlieshout: don't know the question, but that's most often the answer
[12:03:16] rvanlieshout: abhinavmehta: why that second module?
[12:04:40] rvanlieshout: but that's not how this works iirc
[12:05:44] rvanlieshout: http://api.rubyonrails.org/classes/ActiveSupport/Concern.html
[12:05:52] rvanlieshout: there is nothing written about using a second module
[12:11:51] rvanlieshout: that api doc has all kinds of correct statements
[13:06:31] rvanlieshout: eva_: gems don't often install model files
[13:06:38] rvanlieshout: what gem are you using?
[13:07:15] rvanlieshout: and what model file would you expect it provides?
[13:08:05] rvanlieshout: eva_: nope, it creates stuff you can use in your own models
[13:08:53] rvanlieshout: eva_: you're talking about https://github.com/ivoreis/acts_as_taggable?
[13:10:18] rvanlieshout: ok. that gem allows you to use acts_as_taggable or acts_as_taggable_on within your own models
[13:10:41] rvanlieshout: in order to process that, it expects certain database table(s) to exist, for that it has a rake task to createa a migration (rake acts_as_taggable_on_engine:install:migrations)
[13:11:27] rvanlieshout: ah right. lemme check for this gem. could be
[13:11:51] rvanlieshout: https://github.com/mbleigh/acts-as-taggable-on/blob/master/lib/acts_as_taggable_on/tag.rb
[13:12:03] rvanlieshout: this indeed is a class > ActiveRecord::Base
[13:13:25] rvanlieshout: you're welcome
[13:15:30] rvanlieshout: why would you want to edit it? it'll prevent you from easy updating this gem
[13:16:01] rvanlieshout: what do you want to edit about it even?
[13:18:34] rvanlieshout: hmm. that tutorial uses some really non-railsy stuff
[13:18:43] rvanlieshout: you might not want to assume that's the proper way to go
[13:20:00] rvanlieshout: autocomplete isn't really hard
[13:20:03] rvanlieshout: what do you want to autocomplete?
[13:21:08] rvanlieshout: see something like https://github.com/peterwillcn/rails4-autocomplete
[13:21:12] rvanlieshout: stuff like this is not a job for a model
[13:21:29] rvanlieshout: a controller should return the right (json-)response for some client-side action
[13:22:22] rvanlieshout: eva_: and know that a model doesn't (and shouldn't) know about stuff happening outside of that context
[13:22:36] rvanlieshout: stuff related to requests, sessions, url's are not supposed to be in there
[14:19:20] rvanlieshout: Quit: leaving


[09:53:01] rvanlieshout: lkx: that error shows you it's on line 8 of your controller
[09:53:04] rvanlieshout: what's on line 8?
[10:05:26] rvanlieshout: it comes from the line where you use @content
[10:05:29] rvanlieshout: but you didn't define @content before
[11:00:44] rvanlieshout: Quit: leaving