« Back to channel list

#RubyOnRails - 10 October 2013

« Back 1 day Forward 1 day »
[00:00:49] optobear: you may find that shorter than waiting around. not saying it'll never complete if you don't
[00:01:56] AntelopeSalad: other than the .rvm and .gem folders in my home dir there's nothing else i need to clean up right?
[00:02:34] optobear: i thiiink that'll do it
[00:02:59] AntelopeSalad: ok, i'll go afk for 30ish and see if it finishes by then, it not then i'm going on an rm -rf killing spree
[00:03:20] optobear: also remove --rails here - https://gist.github.com/benmacleod/6910642#file-ruby-sh-L7
[00:03:58] AntelopeSalad: i didn't make the script, i just found it the other day, it worked successfully locally but not on ec2 so far
[00:04:21] optobear: that'll've been making rvm install rails, for which it will use its own version, options, etc.
[00:04:40] glaksmono: can someone help me with undefined method `scan' for {}:Hash >?
[00:04:41] AntelopeSalad: is that not good? i have everything working with rvm-capistrano locally
[00:04:44] glaksmono: not sure what's the issue
[00:04:48] helpa: glaksmono: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[00:04:48] Radar: glaksmono: !debug
[00:05:06] glaksmono: it highlights r.save
[00:05:12] glaksmono: i'm using hstore
[00:05:17] Radar: glaksmono: Show us the complete code with stacktrace please.
[00:06:02] optobear: AntelopeSalad: it's fine if it installs the rails version you're expecting and doesn't time out. i suspect it's causing your problem
[00:06:29] AntelopeSalad: ok, i'll just kill it and restart with the updated gist, thanks
[00:06:56] AntelopeSalad: i think something broke though, i can't even stop it, it may have hung entirely
[00:08:06] diggitydane: to anyone's knowledge, has anyone commited suicide while using the asset pipeline with heroku?
[00:08:59] terrellt: diggitydane: There have been a fair number of sudden silences. I like to think they just met with success and left.
[00:09:58] diggitydane: terrellt: ha :)
[00:27:03] dsrx_: I'm thinking about building assets in CI and deploying to heroku
[00:27:38] dsrx_: pretty soon we'll be moving our JS from the asset pipeline and into lineman so that will make more sense than building a custom buildpack for heroku
[00:49:27] AntelopeSalad: optobear: your gist with the .gemrc file installed fine, not sure if the cap deploy will work but at least it's installed
[00:49:47] optobear: AntelopeSalad: nice one
[00:50:11] AntelopeSalad: your no doc flags are not necessary tho right? since we added it to the gemrc file
[00:50:25] optobear: that's right
[01:27:09] linojon: hi, following https://devcenter.heroku.com/articles/rails-unicorn it recommends creating a config/initializers/timeout.rb with Rack::Timeout.timeout = 10 but that just gives me "uninitialized constant Rack::Timeout" ?
[01:27:36] bobbobbins: ok, so I'm trying to get active admin up and running, but the sass part seems to be messing up, @import "active_admin/mixins"; works in dev, but for some reason when i try to deploy to staging, it crashes???says it can't find mixins or it is unreadable???any idea what i can do to fix that?
[01:32:29] Radar: linojon: what version of Rails?
[01:32:59] Radar: bobbobbins: solution: do not use active_admin
[01:33:03] Radar: bobbobbins: as mentioned in !debug
[01:33:05] helpa: bobbobbins: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[01:33:05] Radar: bobbobbins: !debug
[01:33:23] bobbobbins: but i wanna use active_admin
[01:34:19] bobbobbins: Radar: i posted the error before: https://gist.github.com/bobbobbins/c80357f3697155c20817
[01:34:41] bobbobbins: you told me to run that command locally???i did that and it worked, but thats because the deploy hadn't occurred yet
[01:34:43] Radar: bobbobbins: Were you able to run that command locally?
[01:34:55] Radar: what difference should whether a deploy happen or not make?
[01:34:59] sevenseacat: did you bundle on the server as part of the deploy?
[01:35:12] bobbobbins: because the assets in the deploy are what is causing the error
[01:37:15] bobbobbins: i don't think i did
[01:37:36] Radar: *shrug*, sorry
[01:37:37] Radar: I have no idea
[01:37:44] sevenseacat: so... is active admin installed on your staging server then?
[01:37:46] Radar: I don't use active_admin because it leads down a path of insanity
[01:37:49] bobbobbins: sorry, I'm an idiot
[01:38:05] bobbobbins: is there a better option?
[01:38:15] bobbobbins: than active admin
[01:38:16] linojon: bobbobbins: did you try config.assets.initialize_on_precompile = false
[01:38:35] bobbobbins: linojon, no, i didn't try that
[01:39:07] Radar: bobbobbins: writing it yourself is typically the better option
[01:39:59] linojon: bobbobbins: application.rb: config.assets.initialize_on_precompile = false production.rb: config.assets.compile = true routes.rb: break if ARGV.join.include? 'assets:precompile'
[01:40:22] linojon: then rake assets:precompile
[01:40:58] sevenseacat: thats.... a bit silly
[01:41:07] bobbobbins: i have no idea what that is
[01:42:21] rhizome: where is active_admin/mixins?
[01:42:33] rhizome: and are you using require_tree?
[01:43:04] bobbobbins: i was using require tree, i just change it a minute ago???but when i got the error, i was
[01:43:26] rhizome: you were...
[01:43:34] bobbobbins: should i not?
[01:43:51] parndt: keep slappin on band aids!
[01:43:52] rhizome: oh, i understand now.
[01:44:47] bobbobbins: active_admin/mixins is in the gem somewhere
[01:45:03] sevenseacat: parndt: thats how most people like to fix their problems.
[01:45:13] sevenseacat: cover it with random shit until you just cant see it anymore.
[01:45:57] bobbobbins: i would think just putting the active admin directory in the right place would fix the issue???but i tried that, it didn't seem to work
[01:46:55] sevenseacat: (09:37:44) sevenseacat: so... is active admin installed on your staging server then?
[01:47:16] bobbobbins: sorry, i missed that
[01:47:33] christopherbull: I want to disable turbolinks for a form, do I add the data tag to the form or the submit button
[01:47:36] bobbobbins: i thought cap took care of that
[01:47:45] christopherbull: (sorry, should've been a "?" there...)
[01:48:02] sevenseacat: read the cap output and see?
[01:48:07] rhizome: my problem is that i've never needed to use its mixins before
[01:48:23] bobbobbins: that gist was from cap
[01:48:42] sevenseacat: and that isnt the entire cap output
[01:50:01] bobbobbins: the rest of the output doesn't mention it
[01:50:17] Radar: rest of the output could be relevant to the problem
[01:51:42] bobbobbins: https://gist.github.com/bobbobbins/7829d303b2029a9436c9
[01:52:19] bobbobbins: the actual error starts on line 69
[01:52:29] sevenseacat: right, so it is bundling
[01:53:08] sevenseacat: you havent done anything silly like put active admin in your development or test groups in your Gemfile, have you
[01:53:40] bobbobbins: um, i don't think so, lemmie check
[01:54:46] bobbobbins: nope, its in the right place
[01:55:07] sevenseacat: where is 'the right place'
[01:55:18] bobbobbins: not in any group
[01:56:42] sevenseacat: having a messy Gemfile like that would drive me nuts
[01:56:56] sevenseacat: ACTION has OCD about these things
[01:57:16] bobbobbins: yeah, i need to clean it up
[01:58:28] sevenseacat: might be a silly question, but why are you deploying a version before all the active admin fixes you made, some of which refer to CSS?
[01:59:30] sevenseacat: 'HEAD is now at 744a188 removing rails_admin'
[02:01:07] Radar: bobbobbins: Are you not deploying from the branch that you're working on?
[02:01:24] bobbobbins: oh, i think i tried a few things after the error i posted???so there are a few more commits after that, but the error still persists
[02:02:31] bobbobbins: basically, in order to allow cap to deploy, i changed the active_admin css file???but that doesn't' really address the problem, just lets me deploy for now
[02:03:27] AntelopeSalad: optobear: installing rails that way seems to have completely broken my cap config, do you think i can just install it the old way and the .gemrc file will stop the docs from being installed?
[02:04:13] sevenseacat: well the version you're deploying has a file called active_admin.css.scss_no in it
[02:04:29] sevenseacat: not saying its related, its just a big wtf
[02:04:56] optobear: AntelopeSalad: sure, i see no problem. curious what part of it is breaking, though
[02:05:23] bobbobbins: sevenseacat: hang on, i'll deploy the most recent version so that there is no confusion
[02:05:27] christopherbull: i'm trying to add this to my form ":data => {:"no-turbolink" => true}" but rails/haml spits out data-no-turbolink-"true" instead of just data-no-turbolink
[02:05:43] AntelopeSalad: optobear: it says the gemset doesn't exist so it couldn't use that ver of ruby
[02:06:13] AntelopeSalad: i spent close to 20 hours getting cap to work, i'm afraid to touch anything in the config or change how i set up rvm/ruby
[02:06:22] sevenseacat: christopherbull: same thing.
[02:07:55] christopherbull: sevenseacat: not working for you too?
[02:08:14] christopherbull: what do you mean by same thing?
[02:08:21] sevenseacat: the two outputs are equivalent.
[02:08:47] christopherbull: right, but why is it not outputting the boolean attr format?
[02:08:58] sevenseacat: it doesnt matter why
[02:09:06] christopherbull: i read somewhere that that means that HAML is not using :html5 mode?
[02:09:18] sevenseacat: its good form to have values on all your attributes
[02:10:15] optobear: AntelopeSalad: I understand your fear. be brave and you'll learn stuff tho :) none of the changes i made should've made any difference to the gemset. just checking my gist for stuff that may have been a problem
[02:10:26] Travis-42: I have a User model that has_many photos, and I want to return the users in an order such that the user who has most recently added a photo is first. I can't quite wrap my head around how to do this query, does anyone have an idea?
[02:11:41] tpayne84: I am trying to PATCH a nested resource when a user clicks on a table cell??? anyone know what sort of wrapping I can put the table cell in that will send HTTP PATCH to /game/{game_id}/{square_id} where square is the nested resource
[02:12:25] Radar: I have params[:order][:line_items] which returns the value of "{1=>{"price"=>0}}" How do I use strong_parameter's permit! on what this returns?
[02:12:38] Radar: for example, if under certain circumstances I want to exclude price
[02:12:53] optobear: AntelopeSalad: yeah, i don't see anything i changed that could be causing your problem. by all means revert and see how you go
[02:13:09] Radar: tpayne84: When rendering the square, perhaps put a data-url attribute on the element which can then be referenced by JS?
[02:13:28] AntelopeSalad: optobear: deleting those 2 folders didn't seem to be enough
[02:13:36] AntelopeSalad: it's detecting a ver of ruby already being installed
[02:13:43] sevenseacat: Radar: i dont know on that one
[02:14:05] Radar: sevenseacat: same
[02:14:17] tpayne84: Radar: I never render the square??? I am making a tic-tac-toe board and the game#show renders the game board and i populate the table cells (squares) with the value of the square from the nested resource
[02:14:35] sevenseacat: cant see anything in the strong params docs about a hash with numerical keys
[02:14:48] sevenseacat: ad you dont want to just whitelish the entire hash
[02:15:03] Radar: sevenseacat: yeah, I want to allow some parameters for line items and disable others
[02:15:04] tpayne84: Radar: I was looking at this solution, which I think is what you are suggesting.. http://stackoverflow.com/questions/9945620/making-a-table-row-into-a-link-in-rails
[02:15:17] Radar: tpayne84: yes, exactly that
[02:15:23] Radar: tpayne84: considering that I am that person, too :)
[02:15:42] optobear: AntelopeSalad: try rvm remove <your ruby> ?
[02:15:49] AntelopeSalad: optobear: rails also installed really fast this time, hmm
[02:16:08] tpayne84: Radar: you are that person ? as in the answer poster?
[02:16:21] optobear: AntelopeSalad: no doubt, doc install takes aaages
[02:16:36] Radar: tpayne84: yes
[02:16:39] AntelopeSalad: it didn't even try to install it i mean
[02:16:42] Radar: ACTION == Ryan Bigg
[02:16:48] AntelopeSalad: it didn't run through the gems, it just said it was installed
[02:16:49] tpayne84: Radar: have an up vote sir
[02:16:53] Radar: tpayne84: thx
[02:21:09] atal421: can someone point me in the right direction about how to properly namespace an api in rails without having duplicated code bewteeen certain api controlelrs and regular app controllers?
[02:21:29] Radar: atal421: https://github.com/spree/spree
[02:22:18] atal421: Radar: looking
[02:22:27] tpayne84: atal421: https://shellycloud.com/blog/2013/10/how-to-integrate-angularjs-with-rails-4 tutorial using angular does what I believe you are trying to do
[02:22:38] AntelopeSalad: optobear: i got the same error about the missing gemset, weird i ran these exact steps on a vm with the same setup as this ec2 instance
[02:22:42] AntelopeSalad: the vm version went without a hitch
[02:23:11] atal421: tpayne84: looking
[02:23:25] Radar: atal421: we namespace everything underneath Spree::Api
[02:23:39] Radar: Every controller in that namespace inherits from Spree::Api::BaseController
[02:24:28] Radar: sevenseacat: found a way to do it: https://gist.github.com/radar/8e69721d33f84f1bdc7c
[02:24:35] optobear: AntelopeSalad: you may want to rvm implode to completely remove rvm from yr ec2 instance and start again then
[02:25:44] atal421: Radar: does that mean that you have code throughout the app the references V1 and other code refrencing V2?
[02:26:10] Radar: atal421: No, not yet.
[02:26:33] Radar: atal421: we're using the versioncake gem for versioning the APi
[02:27:39] sevenseacat: Radar: thats sure one way to do it
[02:27:43] sevenseacat: surely theres a better way
[02:27:43] AntelopeSalad: optobear: i ran an rvm:create_gemset and that seems to have moved me forward, running a deploy now to see what happens
[02:27:45] atal421: Radar: ok,, i just need to sludge trhough the coebase to see??? right now it seems like the only way to have that is either if there is a great developer who has done this before, or someone that can predict the future of the api (features)
[02:27:47] Radar: sevenseacat: surely!
[02:28:15] bobbobbins: ok, so by some miracle, cap is working now???i have no idea why???so disregard everything
[02:28:36] Radar: bobbobbins: you were deploying the wrong branch, weren't you?
[02:29:03] bobbobbins: i don't think so, but i guess anything is possible
[03:06:13] Radar: hello agent_white
[03:06:18] Radar: you never PM'd me yesterday
[03:06:27] agent_white: I was just about to say, mind if I do now?
[03:07:23] s2013: aww Radar missed you
[03:07:50] parndt: TIL Radar requests PMs
[03:08:04] sevenseacat: until you abuse him in them
[03:08:08] sevenseacat: then he gets sad
[03:08:20] parndt: I wonder what he does with the Prime Ministers when he gets them
[03:08:26] parndt: maybe I don't want to know
[03:08:36] Radar: KRudd and I are just friends
[03:08:47] sevenseacat: durrr he not the PM anymore
[03:08:53] parndt: not elect
[03:09:10] parndt: Tony on the other hand, Radar..
[03:09:44] sevenseacat: him in those budgie smugglers
[03:09:50] Radar: Tony and I have a mutual agreement that if he and I were to be in the same room at the same time it would result in fisticuffs.
[03:10:10] parndt: but of course, I doubt he even knows you exist
[03:10:34] sevenseacat: Radar is more popular than Tony. fact.
[03:10:52] Radar: ACTION still can't believe more than 50% of the country voted for his party
[03:11:19] s2013: by any chance is anyone here an EE?
[03:11:29] sevenseacat: they were more votes against labor.
[03:11:46] s2013: i dont understand aussie politics
[03:11:53] jrobeson: hello peoples
[03:11:56] sevenseacat: neither do we
[03:12:00] s2013: all i remember was the whole carbon tax fiasco when i lived there
[03:12:01] sevenseacat: or most australians
[03:12:26] sevenseacat: 'i dun look at the policies, i vote for the shiny pretty person'
[03:12:30] s2013: isnt it required to vote?
[03:12:35] jrobeson: SHINY SHINY.. ME WANT
[03:18:37] parndt: Radar: just because his party isn't your choice :P
[03:34:20] tigris_: so how come if I run `RAILS_ENV=test rake db:reset` and a subsequent command for rake test, everything works swimmingly, but if I combine the rake tasks as `rake db:drop db:setup test`, the tests all fail cos no tables exist in the db?
[03:34:30] tigris_: what am I missing here?
[03:35:02] foucist: tigris_: db:reset does drop & setup
[03:35:25] tigris_: foucist: yep, but same applies... db is created but 0 tables
[03:35:39] stewart_: When not using rails how do I tell ActiveRecord what cache backend to use for SQL caching?
[03:36:14] foucist: tigris_: what happens with RAILS_ENV=test rake db:reset test
[03:36:24] tigris_: foucist: same thing
[03:36:38] foucist: tigris_: i think rake <foobar> <enviroment> might be happening? i.e. rake db:reset production, rake db:reset test
[03:36:42] foucist: rather than running the rake test
[03:36:59] tigris_: foucist: oic
[03:36:59] foucist: tigris_: what happens if you do rake db:reset test && rake test
[03:37:27] parndt: rake db:test:prepare
[03:37:48] foucist: tigris_: listen to him ^
[03:38:25] tigris_: db:test:prepare assumes db:create has already happened
[03:38:41] tigris_: i'm trying to create a 1 liner that works regardless if db exists already or not
[03:39:03] parndt: rake db:{create,test:prepare}
[03:39:16] foucist: parndt: does that work?
[03:39:25] parndt: or RAILS_ENV=test rake db:create && rake db:test:prepare
[03:39:36] parndt: I just use db:test:prepare
[03:39:52] foucist: does rake itself recognize "db:{create,test:prepare}" heh
[03:39:54] foucist: that'd be cool
[03:40:05] tigris_: parndt: you had to have rake db:created at some point to be able to prepare
[03:40:06] varun: hey guys... do you know how to access JS cookies in Rails 4 controller
[03:40:20] parndt: foucist: yes
[03:40:23] varun: previously in Rails 2.3 we could use something like cookies[:key]
[03:40:31] varun: wats the equivalent for Rails 4
[03:40:33] parndt: $ alias rdb
[03:40:33] parndt: alias rdb='be rake db:{drop,create,migrate}'
[03:40:37] parndt: I use this all the time ^
[03:40:45] sevenseacat: thats a damn good idea
[03:40:51] foucist: parndt: ew be :P
[03:40:51] sevenseacat: im forever typing out the whole line
[03:40:56] parndt: foucist: to each their own
[03:41:06] parndt: $ alias rdbs
[03:41:06] parndt: alias rdbs='rdb && be rake db:seed'
[03:41:08] foucist: parndt: nah i'm just poking fun at the whole 'bundle exec' thing
[03:41:13] parndt: sure I know
[03:41:22] parndt: can you access JS cookies inside Rails?
[03:41:25] sevenseacat: im always doing drop/create/migrate/seed/prepare
[03:41:32] tigris_: i have CI servers that get rebuilt once a week, so at any time my test script may or may not have an existing test db created
[03:41:32] varun: I always forget my nickserv password
[03:41:40] varun: can anyone even read my msgs
[03:41:42] parndt: tigris_: so run create first
[03:41:43] Radar: varun: no
[03:41:47] foucist: varun: sometimes
[03:42:04] tigris_: parndt: no, as i mentioned, create dies if the db is already there
[03:43:08] parndt: it _DIES_?
[03:43:14] sevenseacat: horribly and painfully.
[03:43:15] foucist: varun: http://stackoverflow.com/questions/3567527/reading-cookie-value-in-rails
[03:43:16] parndt: why does it have to be a one liner
[03:43:24] parndt: RAILS_ENV=test rake db:create
[03:43:27] parndt: rake db:test:prepare
[03:43:29] parndt: problem solved
[03:44:24] tigris_: well `RAILS_ENV=test rake db:drop || true ; RAILS_ENV=test db:create db:test:prepare` would be more correct
[03:44:36] foucist: one liners is easy if you string em with &&
[03:45:04] tigris_: but due to our shitty CI setup, i can only run 1 bash command with no && or nothing, as in whatever args i give this "script" will be rake args
[03:45:17] parndt: rake set_it_up_jeeves
[03:45:21] parndt: and write your own task
[03:45:32] varun: hmm just in the nick of time...
[03:45:50] tigris_: sure, but i assumed this shit would "just work", surely i'm missing something painstakingly obvious
[03:46:37] tigris_: why do the rake tasks "db:reset" and "test" work when run individually one after the other, but fail when run as part of the same rake run
[03:46:44] tigris_: that is my question
[03:47:23] sevenseacat: they work just fine
[03:47:28] parndt: sometimes you're not missing anything and it really is just broken
[03:47:29] foucist: yeah, doesn't rake test setup the database
[03:47:35] parndt: this is not one of those times
[03:47:41] parndt: rake db:test:prepare should just work?
[03:47:50] foucist: parndt: doesn't rake test create db, seed it, test, and tear it all down after ?
[03:48:23] dbcclarke1: If i have a database with data ... and my boss has the same database (but not with the data i just put in), how do commit that data into git? so that he can get it and it can be put in his copy of the database
[03:48:33] parndt: foucist: it doesn't seed it
[03:48:56] parndt: dbcclarke1: you shouldn't commit dbs into your git repo
[03:49:00] varun: I was just about to log out to renew my nick name and some one answered my question
[03:49:12] tigris_: rake can take multiple tasks as arguments right? so ignore any && or "run this first" crap
[03:49:16] rhizome: dbcclarke1: seed_dump gem
[03:49:29] varun: I am not able to check the old messges...
[03:49:34] dbcclarke1: parndt: oh, what should i do then?
[03:49:43] rhizome: tigris_: create a task that runs all the tasks you want to run
[03:50:04] tigris_: rhizome: that is what i intend to do, but thought i'd check here first as to WHY it doesn't "just work" as is
[03:50:09] varun: thank you anonymous IRC user for helping me out..... I was stuck on this for a while
[03:50:20] rhizome: tigris_: probably because computers don't know how to read you mind?
[03:50:35] sevenseacat: thats a distinct possibility
[03:50:57] dbcclarke1: rhizome: so i should run rake db:seed:dump ?
[03:51:23] Radar: varun: what was the answer to your question?
[03:51:31] parndt: Radar: 16:43:14 foucist: varun: http://stackoverflow.com/questions/3567527/reading-cookie-value-in-rails
[03:51:36] rhizome: dbcclarke1: you should read the documentation for that gem, and install and use it if it suits your needs
[03:51:40] Radar: oh, right
[03:51:40] tigris_: it is quite simple.... `RAILS_ENV=test rake db:reset && rake test` works perfectly fine.... `RAILS_ENV=test rake db:reset test` does not, the tests all fail because the database exists but is empty... i fail to see how I am doing anything wrong here
[03:52:04] dbcclarke1: rhizome: is there an easier way? than to install a gym. he suggested i create a migration
[03:52:26] rhizome: come on, man. not good enough?
[03:52:36] rhizome: have your boss help you, then.
[03:53:05] parndt: does your boss work in the same office? you may be able to share a SQL server or something
[03:54:02] dbcclarke1: parndt: no i work across the state
[03:54:07] foucist: Radar: the power of google (or bing in my case) compells thee!
[03:54:17] parndt: seeds are probably the best way
[03:54:17] Radar: foucist: you use bing?
[03:54:25] Radar: ./mode #rubyonrails +b foucist
[03:54:32] dbcclarke1: parndt: what do u mean by that?
[03:54:36] glaksmono: why i can't parse this in ruby JSON.parse? 757: unexpected token at '"[[-1,-1,-1],[-1,"P",-1],[-1,-1,-1]]"'
[03:54:45] parndt: dbcclarke1: exactly what rhizome was saying
[03:54:53] Radar: glaksmono: invalid JSON.
[03:54:53] glaksmono: it's a valid json
[03:55:12] dbcclarke1: rhizome: in order for me to get the data to him I "HAVE" to install a gem?
[03:55:15] Radar: glaksmono: Show me it parsing fine in irb.
[03:55:15] sevenseacat: if it was, it would work
[03:55:31] glaksmono: you use JSON.parse right?
[03:55:37] glaksmono: for some reason it shows as unexpected token for me
[03:55:55] Radar: glaksmono: Show me an example of JSON.parse and that string thing together
[03:55:56] rhizome: dbcclarke1: no, you don't HAVE to
[03:55:59] Radar: glaksmono: so I can try it on my compute
[03:56:34] dbcclarke1: rhizome: oh ok. that's why i ask if there was another way.
[03:56:41] parndt: it's not valid json
[03:56:43] rhizome: yes, there are a hundred ways
[03:56:49] rhizome: you could use PHP, for instance.
[03:56:58] rhizome: you could use Perl
[03:57:09] rhizome: you could use your db's management interface
[03:57:11] glaksmono: this is correct right ? round[:foo] = JSON.parse(round[:foo]);
[03:57:14] sevenseacat: you could use telepathy.
[03:57:20] Radar: glaksmono: Show us the value of round[:foo]
[03:57:35] rhizome: you could tell your boss to use networking magic to connect to the db running on your laptop
[03:58:01] Radar: dbcclarke1: You should use a seeds file.
[03:58:20] glaksmono: "[[-1,-1,-1],[-1,"P",-1],[-1,-1,-1]]"
[03:58:39] Radar: glaksmono: I don't understand how that's even a valid Ruby string./
[03:58:39] dbcclarke1: Radar: oh, the db/seeds.rb file?
[03:58:42] Radar: dbcclarke1: yes
[03:58:51] Radar: glaksmono: double quotes on the inside should cause a syntax error
[03:58:52] lgarvey: double double quote alert
[03:59:14] glaksmono: Radar: i'm passing from JSON.stringfy on JS
[03:59:26] Radar: So many people use foo and bar... so many people reinventing the foo wheel and the bar axle
[04:00:12] dbcclarke1: Radar: im loooking in the db/seeds.rb file and I dont see any of the data from my tables in there. I only see that tables.
[04:00:25] Radar: ........................
[04:00:30] Radar: dbcclarke1: Broseph./
[04:00:31] glaksmono: Radar: so originally was "[[-1,-1,-1],[-1,\"P\",-1],[-1,-1,-1]]"
[04:00:37] glaksmono: Radar: and i did gsub
[04:00:40] dbcclarke1: Radar: I dont know what u mean by use a seeds file
[04:00:40] Radar: dbcclarke1: You need to insert the data there yourself. It is not there automatically.
[04:01:05] rhizome: ACTION waits for the inevitable question
[04:01:06] Radar: dbcclarke1: If you want to share seed data with another developer, then you should be using the db/seeds.rb file to provide an easy way to set up that data.
[04:01:10] Radar: rhizome: 20 questions
[04:01:12] Radar: rhizome: then 200
[04:01:13] Radar: then 2000
[04:01:15] parndt: lgarvey: and that's no double double talk
[04:01:17] tomoyuki28jp: If we use paper_trail, there is no meaning to use acts_as_paranoid for the same model because paper_trail tracks all the changes? Or should we still use acts_as_paranoid to recover the record?
[04:01:18] rhizome: nope, that's not the one i'm talking about
[04:02:04] parndt: lgarvey: https://www.youtube.com/watch?v=l5tKYOTC5QI&hd=1
[04:02:38] rhizome: i think 2 and 2 are being put together right now
[04:02:43] lgarvey: parndt: is it just the bad quality, or do those "all beef patties" have an odd colour to them?
[04:02:51] parndt: and ONIONS
[04:02:58] parndt: it's just the bad quality*
[04:03:00] parndt: *of the burger patties
[04:03:04] foucist: dbcclarke1: your other choice is: rake db:fixtures:dump then you can do rake db:fixtures:load later
[04:03:27] foucist: dbcclarke1: just google for rake db:fixtures:dump and find the rake task code and stick it in lib/tasks/
[04:03:29] glaksmono: Radar: so how do you turn "[[-1,-1,-1],[-1,\"P\",-1],[-1,-1,-1]]" to multidimentional array in rails?
[04:03:50] Radar: first person to recommend ev... dammit
[04:03:53] dbcclarke1: ok thanks radar and foucist..ill get to working on this.
[04:03:55] dbcclarke1: and rhizome.
[04:04:08] Radar: Please do not use eval ever
[04:04:14] foucist: glaksmono: eval is evil, never use it
[04:04:19] parndt: ew whatever
[04:04:27] glaksmono: what's your suggestion please?
[04:04:30] parndt: don't use it on user input
[04:04:30] glaksmono: I wanted to use JSON.parse
[04:04:36] glaksmono: but it doesn't seem to be working correctly
[04:04:46] Radar: glaksmono: Uh, we don't have one?
[04:04:50] Radar: Well, I don't at least.
[04:04:55] foucist: Radar: noob :(
[04:05:00] optobear: glaksmono: er, JSON.parse works for that one
[04:05:09] parndt: JSON.parse("[[-1,-1,-1],[-1,\"P\",-1],[-1,-1,-1]]")
[04:05:09] parndt: => [[-1, -1, -1], [-1, "P", -1], [-1, -1, -1]]
[04:05:11] parndt: what's the problem
[04:05:19] lgarvey: JSON.parse('[[-1,-1,-1],[-1,"P",-1],[-1,-1,-1]]')
[04:05:28] lgarvey: but parndt is faster...
[04:05:31] Radar: Probably missing final ]
[04:06:55] optobear: glaksmono: your original was enclosed in both single and double quotes
[04:07:47] parndt: goodbye all
[04:11:56] rubyist: Hi, does anybody know why I'm receiving argument error for this line? "validates_numericality_of :number, :unless => lambda { errors[:number].any? }"
[04:12:11] rubyist: Wrong number of arguments (1 for 0)
[04:12:43] linojon: lambda {|post| post.errors??? }
[04:13:01] linojon: or something like that, the lambda takes the obj as a param
[04:13:19] sevenseacat: that would be 0 for 1 in the error then
[04:14:10] rubyist: that was my thinking. I'm not passing any args
[04:14:41] rubyist: I'm using a PORO that's mapped to a form. Could it possible be the :number attribute is conflicting?
[04:15:08] Radar: rubyist: any? takes a block I thikn
[04:15:34] glaksmono: so pretty much the reason why it wasn't working is because I FORGOT i put the damn ;
[04:15:37] glaksmono: at the end of the line
[04:15:49] Radar: glaksmono: LOL
[04:16:08] rubyist: glaksmono, that's what syntax checkers are for!
[04:21:30] Cakey: syntax chess
[04:24:15] rubyist: validates_numericality_of :number, :unless => lambda { errors[:number].any? }
[04:24:25] rubyist: wrong number of arguments (1 << for 0)
[04:24:26] rubyist: validates_numericality_of :number, :unless => lambda { |o| o.errors[:number].any? }
[04:24:33] rubyist: work that one out
[04:27:08] optobear: rubyist: your parameter-less lambda was being called with 1 parameter during validation?
[04:30:09] tweeeaks: should just about every field get a validation rule?
[04:30:21] sevenseacat: if you have rules that need applying.
[04:30:27] sevenseacat: thats business logic.
[04:32:13] tweeeaks: sevenseacat, roger. what about when its a field that may or may not have a value, is it better to have a rule with :allow_blank, or just not have a rule
[04:32:31] sevenseacat: have a rule where you need a rule.
[04:32:41] sevenseacat: allow_blank is a meaningless rule
[04:32:48] sevenseacat: its an addition to another rule
[04:33:06] sevenseacat: eg. validates_numericality_of :foo, allow_blank: true
[04:33:22] sevenseacat: allowa blabks, but if the field is present, validates that its a nuber
[04:33:26] sevenseacat: *allows blanks
[04:34:24] tweeeaks: that makes sense, thanks
[04:40:41] Kaylors: Hello, everyone :)
[04:40:52] Kaylors: Can you help me with a little issue?
[04:41:26] Kaylors: I need certain elements like the navigation and footer to be common site-wide. What's the best approach to that?
[04:41:35] sevenseacat: put them in the application layout
[04:42:29] Kaylors: Ah, okay...thanks :)
[04:46:06] kbl: I don't know why I can't open class and redefine methods in my test cases, also including module isn't overriding old method definition http://pastie.org/8390361 anybody could help?
[04:46:22] Cakey: grrr... need. ideas. for. railsrumble.
[04:46:39] sevenseacat: kbl: got an actual error?
[04:46:47] sevenseacat: also, lol spork
[04:46:48] helpa: http://i.imgur.com/JXpw3GO.jpg
[04:46:52] sevenseacat: not what i wanted
[04:47:03] sevenseacat: actually, that works
[04:47:54] Cakey: ACTION kicks logga
[04:48:20] kbl: sevenseacat: I don't get any error, but oryginal method is called, not that new one
[04:48:45] sevenseacat: try ditching spork for starters (or at the very least, restarting it)
[04:49:01] kbl: I've done this several times
[04:49:17] kbl: even not using spork but including module/opening class in setup isn't working
[04:49:32] kbl: (btw, why "spork lol"?)
[04:50:39] sevenseacat: because a) it doesnt solve a problem and b) it creates lots of problems
[04:51:52] kbl: hmm its speeds up running tests, so why "it doesnt solve a problem"?
[04:51:59] sevenseacat: it does no such thing
[04:52:11] sevenseacat: it attempts to speed up the loading of a rails environment by keeping it cached
[04:52:25] sevenseacat: which is where the other problems come in
[04:52:41] kbl: but going back to a actual problem, do you have any idea why I can't open class and override method/override method by including module?
[04:52:43] lgarvey: Stop write so many integration tests, and start writing more unit tests.
[04:53:48] kbl: lgarvey: I'm trying to do so, but to achive that I need to redefine some methods for test env
[04:53:51] sevenseacat: kbl: i suggest starting by removing spork.
[04:54:08] kbl: but then my whole env isn't cached and running rake test takes ages
[04:54:30] lgarvey: kbl: No, what you probably need to do is make more classes to hold your logic.
[04:54:42] sevenseacat: depending on your ruby/rails versions, it may take up to a couple seconds more to load your rails environment, yes
[04:55:12] lgarvey: kbl: If writing more unit tests is difficult, then that says something about your app code not about your tests.
[04:58:00] tweeeaks: sevenseacat, so I have an association between users and games, user has many games, games belong to a user. clearly a game needs a user, so should i use validates_associated - or is this taken care of with the associations just being there
[04:58:01] kbl: lgarvey: that's highly probable as I'm not full time ror/ruby dev, I used to work with Python/Javascrit/Java on production code, but doing ror stuff is just my own "evening project"
[04:58:18] sevenseacat: tweeeaks: it is not taken care of
[04:58:47] sevenseacat: validates_associated (on a Game) will validate any associated Users present, it will not ensure the presence of any Users
[04:59:28] kbl: sevenseacat: http://pastie.org/8391393
[05:00:02] sevenseacat: thats some slow tests
[05:00:17] tweeeaks: that line confuses me, isn't what you said both the same
[05:00:17] kbl: most of those test time is that method which I'd like to change - it's calling external ws to send sms messages
[05:00:18] sevenseacat: and a slow spinup time
[05:00:49] sevenseacat: tweeeaks: no - the first is 'if there are users present i will make sure they are all valid' and the second is 'i will make sure there are users present'
[05:01:13] kbl: and I'm trying to redefine that method for test env to only save in db important stuff, not to be dependant on external resource
[05:01:23] tweeeaks: its getting late, thanks again
[05:01:29] sevenseacat: tweeeaks: subtle but different :)
[05:02:18] sevenseacat: glad people remember that women do exist on the internet :P
[05:02:18] kbl: and there is still 20secs of "warm up" before every test run, that's too much
[05:02:50] sevenseacat: thats the loading of your rails environment, which is slow but thats what i would expect from an un-falcon-patched 1.9.3
[05:03:18] sevenseacat: on rails 4 and ruby 2 its about a second :P
[05:04:21] kbl: unfortunatelly I'm stuck with 1.9.3 :(
[05:12:11] kbl: sevenseacat: now, after removing spork dependencies, and changing my Guardfile/test_helper.rb I'm not able to run guard :)
[05:13:45] kbl: http://pastie.org/8391407
[05:14:38] sevenseacat: you're still trying to use spork, or drb at least
[05:14:48] Radar: kbl: Try running it without guard
[05:15:45] kbl: but here is the point, I'd like to have guard to run those test after any change
[05:15:59] Radar: Yes, but your testrdb script is causing it to fail
[05:15:59] sevenseacat: so remove all the spork/drb stuff
[05:16:06] Radar: So just for now, try running it without guard or remove the spork stuff
[05:16:15] sevenseacat: you cant remove half of it and expect things to keep working
[05:19:32] kbl: it works without guard, but I'm not sure what else needs to be removed - I've removed all fork gems from gemfile, run bundle install, budnle show fork says that such gem couldn't be find, I don't really know what "other half" is still there
[05:21:03] sevenseacat: bin/testdrb and whatever's using it? :)
[05:40:49] Radar: good morning tagrudev
[05:41:15] tagrudev: 1 sec slower :D
[05:41:15] Radar: I may/may not have a notification that pops up when you sign in.
[05:41:48] adammcarth: Awwwww yeah. http://imgkk.com/i/wav4.jpg
[05:42:18] tagrudev: looks like a bible
[05:42:40] adammcarth: Some would say that, tagrudev
[05:44:11] SilverKey: The shirt and tie don't help ;)
[05:46:02] adammcarth: Hahahaha, just got home from school. Jump right into it!
[05:59:04] _spiderman: Anyone know of a good chat gem?
[06:05:17] bambanx: how i can see the docs of on windows console ?
[06:06:59] sevenseacat: crossposting wont win you friends
[06:13:30] _spiderman: Has anyone successfully implemented ChatJS or Firechat on their rails app?
[06:14:44] _spiderman: http://www.chatjs.net/ | http://firebase.github.io/firechat/ respectively
[06:16:31] adammcarth: Guys, is there a way to check if a string ends with something, but allow anything after that condition? My first thought was to use an asterisk, but `"http://www.google.com".end_with?(".*")` returns => false
[06:19:05] adammcarth: tagrudev: Regex is scary
[06:19:13] sevenseacat: how can you end with something but then have something after that?
[06:19:15] adammcarth: I still don't understand how it works
[06:19:20] sevenseacat: that seems illogical
[06:20:43] adammcarth: sevenseacat: I don't think it's illogical, saying to someone "make sure it ends with a full stop followed by anything else you want" makes sense to me?
[06:20:53] adammcarth: regex might be the way to go
[06:21:08] sevenseacat: well it doesnt end with a full stop if you have something after the full stop, does it
[06:22:21] adammcarth: sevenseacat: So you can't say that you can end it with anything you want?
[06:22:57] tagrudev: man and I am not even drunk
[06:23:02] Senjai: adammcarth: Her point is that, your checking if something ends with a certain thing, then checking what comes after the ending, which would logically be nothing, since it is an ending
[06:23:43] Senjai: adammcarth: If you're trying to capture everything after a specific character or string, that's different
[06:23:57] Senjai: adammcarth: Either way this is a solved problem, the best solution is Regular Expressions. They are a necessary evil
[06:24:06] sevenseacat: thats different, and saying it would 'end with' that character is misleading
[06:24:16] Senjai: sevenseacat: yeah
[06:25:23] adammcarth: Senjai: If the string wasn't going to be dynamic I'd just do `.end_with?(".com")`, but `.com` could change to something like `.net` for example and it would return false :/
[06:25:38] Senjai: adammcarth: thats flawed design
[06:25:43] adammcarth: How would I do it using regular expressions
[06:25:43] sevenseacat: so basically, you want to make sure it has a dot in it?
[06:26:10] adammcarth: but I have no idea how to use regex
[06:26:23] sevenseacat: dont need regex
[06:26:30] sevenseacat: string.include?('.')
[06:26:46] adammcarth: ahhh, I did actually think of that sevenseacat
[06:26:47] Senjai: adammcarth: I still dont think that you just want to make sure that there isa dot somewhere in the string.
[06:26:54] adammcarth: but what if I encountered a subdomain
[06:27:07] Senjai: adammcarth: WHAT are you trying to do?
[06:27:08] sevenseacat: this does seem quite flawed
[06:27:16] sevenseacat: seems like he wantrs to validate a domain name
[06:27:16] Senjai: adammcarth: E.g. what are you trying to validate?
[06:27:28] adammcarth: haha, I'll explain guys
[06:28:06] Senjai: Example: This string should represent a domain name prefixed with http, and a subdomain if any, the last characters after the last dot should represent a legal top level domain
[06:28:38] sevenseacat: good luck with tracking legal top level domains
[06:28:40] Senjai: or in the case of .co.uk that'd be different
[06:28:41] sevenseacat: and validating them
[06:28:46] Senjai: sevenseacat: Exactly
[06:29:07] Senjai: adammcarth: Rule of thumb: Dont validate these things.. there's no good reason
[06:29:09] sevenseacat: this is like email regex - a problem you really dont want to solve
[06:29:16] Senjai: sevenseacat: xD
[06:29:38] Senjai: adammcarth: if its an improper format, your application will fail and make it obvious.
[06:29:49] Senjai: adammcarth: if someone gives you an improper email, they wont receive emails, and then they'll change it
[06:29:58] adammcarth: Yeah but if someone enters a website into the box and its wrong, it will show something ridiculous to the public under the comment
[06:30:04] adammcarth: or be buggy and make me look bad
[06:30:05] sevenseacat: thats their problem
[06:31:24] Senjai: adammcarth: this is a design problem, thats their problem. Imagine owning a forum that validated the integrity of every link in ever post before allowing it?
[06:31:30] Senjai: If its wrong, it wont work. Simple
[06:31:44] sevenseacat: emails are different because we might try and send emails to the listed address
[06:31:59] sevenseacat: for URLs, all we can do is display them, so if someone fucks up when entering theirs, good for them
[06:32:15] Senjai: And its on the user who put it there, not on the application
[06:32:16] sevenseacat: you can provide hints and examples
[06:32:39] sevenseacat: and maybe real basic validation like 'must start with http' and 'must have at least one dot' but thats about it
[06:32:51] Senjai: Even then, I'd leave that to javascript
[06:33:04] sevenseacat: i would never leave anything to javascript
[06:34:17] adammcarth: sevenseacat: For something as simple and unimportant as a website, if someone decides to fuck with the client side validation then it's their problem
[06:35:26] adammcarth: Here's my "mockup". valid_url? is checking to see if it's firstly in the correct format, and also adds "http://" before it gets saved into the database if it's not already present... https://gist.github.com/adammcarthur/6913977
[06:37:10] sevenseacat: it does not add http, no
[06:37:17] sevenseacat: it returns before that :p
[06:38:09] adammcarth: haha, it only returns before that if http:// or https:// is present at the start of the string?
[06:38:48] sevenseacat: https://gist.github.com/adammcarthur/6913977#file-comment-rb-L7
[06:39:45] adammcarth: sevenseacat: Thanks for that correction. Just for the record, I did actually have that in my real code - accidently left it out :P
[06:40:57] BrazenBraden: I seem to be missing something. I have an action with no view and after doing the work, want to render nothing but have a 200 success code to be detected by ajax and then do some stuff. After googling, seems people say to render json: {status: "ok"} or something along those lines. https://gist.github.com/brazenbraden/31cdc2624515e931ca22
[06:41:27] sevenseacat: if you want to render nothing, render nothing
[06:42:38] BrazenBraden: that is what i initially had. but head :ok? where does that go?
[06:42:43] sevenseacat: in the controller
[06:43:02] BrazenBraden: render nothing: true, head: :ok
[06:43:08] sevenseacat: just head :ok
[06:43:17] BrazenBraden: after the render nothing line?
[06:43:33] BrazenBraden: ok. no render call at all
[06:43:42] sevenseacat: however theres no point in setting a flash if you arent going to use it
[06:44:05] BrazenBraden: yea old code when i was doing something else. will do some housekeeping just now
[06:45:06] BrazenBraden: so to confirm, when you wish to handle ajax responses, you have to look for the events from the form element and NOT the embedded button or link or whatever elements correct?
[06:46:20] BrazenBraden: but my button and the button form have an id. in my js i am trying to see which one captures the event. (none at the moment)
[06:46:43] sevenseacat: thats nice, you havent shown that
[06:46:57] BrazenBraden: i have all three files in the gist
[06:47:31] sevenseacat: you havent shown the ID being applied, no
[06:47:53] BrazenBraden: it is there.. button_to "#{button[0]}", activate_user_path(user), class: "btn btn-large pull-right btn-#{button[1]}", id: 'activate_user_button', form: {id: 'activate_user_button_form'}, method: :patch, remote: true
[06:48:07] BrazenBraden: just falls of the screen cos no word-wrap in gist
[06:48:47] sevenseacat: thats nice. i dont know what HTML that generates
[06:49:04] BrazenBraden: i will get the html for you
[06:51:07] BrazenBraden: gist updated with rendered html
[06:53:57] sevenseacat: you need to wrap your js inside a document.ready block
[06:54:16] sevenseacat: not in that code
[06:54:34] sevenseacat: works for me if i add a document.ready block
[06:54:57] BrazenBraden: tis a snippet.. presumed the .ready() bit was obvious :P
[06:55:09] sevenseacat: i never presume anything is obvious with people like you.
[06:55:23] sevenseacat: quite welcome
[06:55:35] sevenseacat: if you add the block in and it still doesnt work, your problem is elsewhere
[06:55:50] BrazenBraden: so which one works? the button or the button_form?
[06:55:59] tagrudev: commentable -> comment what about rate
[06:56:30] sevenseacat: tagrudev: rateable
[06:57:12] tagrudev: sevenseacat, and for a model
[06:57:19] sevenseacat: i would say rating
[06:57:31] tagrudev: so it would be
[06:57:32] sevenseacat: a rating belongs to a rateable object
[06:57:48] BrazenBraden: i still get nothing popping up in my console
[06:57:51] sevenseacat: the polymorphic name shouldnt be stupid and doesnt have to relate to the model name-able
[06:57:52] tagrudev: I am lost :D
[06:58:15] sevenseacat: i saw someone use 'albumable' the other day, i was like wat
[06:58:22] sevenseacat: you cant just make up words
[06:58:35] adammcarth: hahahahaha, albumable ^
[06:59:03] BrazenBraden: *abominable ? :P
[06:59:09] jrobeson: uhmm.. yes you can.. and i do :)
[06:59:19] sevenseacat: quiet you >_>
[06:59:35] tagrudev: since I am not native
[06:59:43] tagrudev: speaker albumable sounds pretty cool
[07:00:13] dsrx_: you can add -able to any verb you like as long as it's the name of a mixin
[07:00:31] dsrx_: (or -ible)
[07:02:13] jrobeson: albumable .. is that for making an assocaiton act like a photo or music album?
[07:03:16] sevenseacat: yeah many objects could have albums
[07:03:24] sevenseacat: photo albums i believe it was
[07:13:02] adammcarth: Is there a way to get the remaining string after the last specific character
[07:13:25] adammcarth: eg - sub.domain.org.au would return as ".au"
[07:13:47] adammcarth: not ".domain.org.au"
[07:13:53] adammcarth: or ".org.au"
[07:15:53] optobear: adammcarth: http://rubular.com/r/luT0RjcpS0
[07:16:37] adammcarth: Thanks optobear, nice tool
[07:17:03] optobear: adammcarth: np. indeed it is. tool of choice in these parts
[07:17:45] sevenseacat: split('.').last is what i would do
[07:18:02] sevenseacat: bugger regex when you dont need it >_>
[07:18:45] optobear: +1 sevenseacat. regex is not "performant" and can be a bit obscure
[07:21:28] tbuehlmann: last time I checked, the regexp version of #split was faster than string. like, split(/\./). :)
[07:21:58] sevenseacat: possibly, i feel that is a micro-optimization though
[07:22:37] optobear: tbuehlmann: izzit? there you go. still, ^
[07:26:26] tbuehlmann: of course, it's not such a big deal
[07:36:29] sadfuzzy: Please, help: how to add validations on updating dependent models? Like transferring project with issues from one user to another?
[07:36:58] sevenseacat: what validations do you need to add?
[07:38:08] rails_ben: in rails controllers, how do instance variables work? can you just declare instance variables and specify an instance of the model class as its value?
[07:38:27] sadfuzzy: Like project.links.update_all user_id: user.id returns an error or db connection is lost
[07:46:13] tbuehlmann: rails_ben, yes. just set the instance variables and you're good
[07:49:55] rails_ben: tbuehlmann, thanks
[07:55:09] Kaylors: Hey guys...
[07:55:15] Kaylors: Can anyone help me with a little problem?
[07:55:27] tagrudev: depends can you ask it ?
[07:55:27] Kaylors: Yolo tagruved...
[07:56:04] Kaylors: Okay, so to make the navigation appear site-wide I put it in the layout/application.html.erb file...
[07:56:12] Kaylors: Was that the correct approach?
[07:56:44] sevenseacat: the correct approach hasnt changed in the last few hours
[07:56:57] Kaylors: Oh, hi...sevenseacat...
[07:57:13] Kaylors: Alright, the problem I'm facing...is getting JS to work...
[07:57:36] Kaylors: I attached a click trigger on the nav buttons..
[07:57:51] Kaylors: They work once but as soon as I go to another page...doesn't work anymore..
[07:58:07] Kaylors: Hang on...I'll share the gist..
[07:58:34] Kaylors: Though it's only a few lines, really....was testing out what works and what doesn't..
[07:59:06] Kaylors: https://gist.github.com/Kaylors/6914677
[07:59:30] Kaylors: I'm a newbie with all of these technologies so not sure if I did that right, but I think I did...
[07:59:40] sevenseacat: what HTML is this operating on?
[08:00:16] Kaylors: Refresh the gist...
[08:01:25] Kaylors: And the html is present on the application.html.erb file..
[08:05:34] BrazenBraden: ok, determined the problem why my ajax event is not being captured is due to turbolinks since the page has long since called ready and done stuff.. i found and followed this but to no avail.. http://stackoverflow.com/questions/18770517/rails-4-how-to-use-document-ready-with-turbo-links
[08:07:29] rwsq1: BrazenBraden, as a test, if you put your <script> inside the body then that should get loaded anyway
[08:07:58] rwsq1: if it doesn't work then, then it might not be to do with turbolinks AFAIK
[08:08:35] BrazenBraden: well, this is what i did to test which lead me to believe it was turbolinks
[08:09:37] BrazenBraden: my page loads. it gives a list of users. when you click a user, it ajax's in a page. that works. in the newely ajaxed page is a button which performs yet another ajax event. that one does not fire. if i load the initial ajax view up as html and then click the button, event gets captured
[08:10:04] BrazenBraden: its cos im referencing an element which does not yet exist?
[08:10:12] slim: i'm using the omniauth-instagram gem, anyone know how to get the "access_token" once you authenticate ?
[08:12:41] sevenseacat: ACTION tries it
[08:14:14] BrazenBraden: so I need to reference my element through another element that will always be available like the document... (i think)
[08:16:13] sevenseacat: Kaylors: i suspect something with turbolinks
[08:20:33] sevenseacat: Kaylors: something like `$(document).on('click', '.nav-button', function() { /* stuff here */ })` will do what you want
[08:21:02] sevenseacat: http://railscasts.com/episodes/390-turbolinks for a bit more info
[08:25:35] maloik: Anyone know of a good pattern to skip certain callbacks for admin type users? My colleague added an attr_accessor in the model but this hardly seems like the logical place so we're trying to figure out an alternative
[08:25:56] sevenseacat: i would ask why you would be wanting to do that
[08:26:52] maloik: an example would be adding a new domain to an application. an admin should be able to do that while skipping the callbacks that check if it's present in our dns servers, because that means he'll be doing all of that manually (or just did)
[08:26:59] maloik: whereas customers obviously need to be restricted
[08:27:08] sevenseacat: if he did, its all good, the check will pass
[08:27:16] codepodu: put it in a service object
[08:27:32] sevenseacat: also, 'check if its present' sounds like a validation, not a callback
[08:28:21] maloik: definately a validation, haven't finished my first coffee yet :D
[08:30:02] sevenseacat: also, i wouldnt feel comfortable saying 'its ok because he'll go add the domain to the dns server' because what if he doesnt?
[08:30:18] sevenseacat: the point of validations is to make sure your data is always in a valid state
[08:30:31] sevenseacat: sounds like saving a domain without the dns *isnt* a valid state
[08:37:01] Syrit: guys, i have created a custom action in my controller, i want to use it to delete a nested record of the parent object, i can't seem to find how to do so! i am using mongoDB , any ideas ? i got the params sent to the action in good shape using Ajax
[08:37:19] sevenseacat: thats wonderfully vague
[08:37:29] sevenseacat: what exactly are you stuck on, and dont say 'how to do it'
[08:37:58] Syrit: oh, sorry sevenseacat
[08:39:03] Syrit: my meeting model, has_many follow_ups, now, i am sending the follow_up id to the custom action via ajax, and i want to destroy it, i've tried @meeting.follow_ups_attributes = {id: ..., destory: }
[08:39:18] sevenseacat: full code helps.
[08:39:27] Syrit: just a sec
[08:39:29] sevenseacat: plus logs of what you're submitting.
[08:39:50] sevenseacat: i swear sometimes its harder to get a proper description of a problem, than it is to fix it
[08:40:15] Syrit: Oh my god sevenseacat i swear i thought that i am the only one that feels this ! really !
[08:46:25] Syrit: sevenseacat, https://gist.github.com/anonymous/2da6c845b66b1a4fcf13 please let me know if should include anything else
[08:47:37] sevenseacat: Syrit: are followups embedded or related to meetings?
[08:47:52] sevenseacat: ok cool, that makes it easy
[08:48:19] sevenseacat: i think you're overcomplicating it a bit - why cant you just do FollowUp.find(params[:followup_id]).destroy ?
[08:48:55] sevenseacat: also, it would make sense if this was done in the delete action of a followups controller, not the delete_followup action of a meeting controller
[08:49:19] Syrit: sevenseacat, i have no controller for followups
[08:49:46] sevenseacat: *destroy action, not delete
[08:50:41] sevenseacat: the reason its erroring is because a Meeting has many FollowUps, so when you assign the followup attributes, it expects a hash of many, eg. {0 => {id: 123}, 1=> {id: 234}}
[08:51:20] Syrit: so, is it really bad to keep this action the same, and fix it ?
[08:51:30] Syrit: i mean keept it in meetings controller
[08:51:52] sevenseacat: its not great, but if you must leave it, leave it
[08:52:46] Intrepidd: Hi everyone
[08:55:08] Syrit: thank you so much sevenseacat
[08:55:14] sevenseacat: Syrit: no probs
[09:12:11] BrazenBraden: can you have both LESS and SCSS installed at the same time?
[09:12:54] Intrepidd: Why do you need both ?
[09:13:15] BrazenBraden: well, i personally like to use scss but the template we bought for bootstrap is of the less variety
[09:13:30] BrazenBraden: so need less to do the template.. my custom css will be scss
[09:13:37] BrazenBraden: any problems with that?
[09:13:46] Intrepidd: I see, nope no problems, just curious
[09:14:13] Intrepidd: Consistency is better but in your case you can't really rewrite the whole template in scss :)
[09:14:23] BrazenBraden: didnt mean it in a defensive way.. was legitimately asking if i would experience any problems lol
[09:14:46] Intrepidd: I meant you won't experience any problems, already did it, it ran fine.
[09:15:14] universa1: BrazenBraden: have a look at the sass-bootstrap gem, it has some automatic conversion for the twitter bootstrap less stuff.
[09:15:17] BrazenBraden: yea i know :)
[09:15:50] BrazenBraden: universa1: yea i have used it before for the standard bootstrap but this is one of those "wrap-bootstrap" themes you can buy
[09:16:32] universa1: BrazenBraden: yes. i'm not talking about the sass-bootstrap, but the tool to convert bootstrap to sass...
[09:16:39] universa1: since bootstrap is in less.
[09:17:03] BrazenBraden: oh right. ok.. but it doesnt really concern me much as im not going to be tinkering in the theme code anyway
[09:18:22] BrazenBraden: what have i missed :/ "cannot load such file -- sass"
[09:19:35] Intrepidd: Can you paste your Gemfile into a gist and show it to us
[09:20:22] Intrepidd: You may be missing the sass-rails gem
[09:20:37] BrazenBraden: oh my bad.. mixing file types
[09:20:45] aleon: I am looking to add localization to a project. I need there to be dynamic content that gets translated as well...I was looking at the Globalize3 gem to help implement this, although it may be a bit much as only certain scopes will be effected. I was also looking at I18n backend with Redis...does anyone know of anything else or has implemented these in the past, comments?
[09:21:06] BrazenBraden: i got the gem. but my application was application.css.less and it was trying to require the scss files.. just gotta do some renaming
[09:22:15] universa1: aleon: define dynamic content
[09:24:01] BrazenBraden: ok, how do i include both less and scss files in a single css file?
[09:24:58] Intrepidd: BrazenBraden: Let's say you have file1.css.less and file2.css.scss
[09:25:20] Intrepidd: *= require file1 then *= require file2 should do it
[09:25:29] BrazenBraden: scss doesnt like require
[09:25:33] BrazenBraden: one must @import
[09:26:37] Intrepidd: I think that's inside a scss file when you want to import another one
[09:26:48] BrazenBraden: when i load my page, i get a blank page with the message "Error compiling CSS asset".. seen that before?
[09:26:53] Intrepidd: But in your application.css you can use require (correct me if I'm wrong)
[09:27:30] mrstbbons: Hey. Strange problem. When I call Model#build_association in the console it works but when I call it inside a Controller I get a "table not found" error. Ah, the Address model is namespaced (MasterData::Address) See code: https://gist.github.com/anonymous/53bcb9d7864c81d8e573
[09:27:58] Intrepidd: BrazenBraden: If you could post all significant files to a gist we could better understand your issue
[09:28:17] BrazenBraden: gimme a sec while i just double check all the imports, requires and file extensions
[09:32:24] mikecmpbll: TIL that rails is clever enough to factor include?() into the query
[09:32:31] universa1: mrstbbons: model code?
[09:33:11] mikecmpbll: i thought doing something like @user.posts.include?(@post) for example, would get all posts and do enumerable include? on it.
[09:33:46] universa1: mikecmpbll: count / size is also kinda clever, if you already fetched the association it shouldn't do a query, but if you haven't it just does a count query on the db
[09:34:14] BrazenBraden: Intrepidd: https://gist.github.com/brazenbraden/bb896ec56f2871310c4f (the comment at the top shows the chain order)
[09:34:54] mrstbbons: universal: Here: https://gist.github.com/anonymous/3beb379d9d102c246f78 But I don't think this is wrong since it is working fine within the rails-console
[09:35:17] Intrepidd: BrazenBraden: let me get back to you in a few minutes
[09:35:34] BrazenBraden: Intrepidd: updating gist so long with the error.. forgot it.
[09:37:17] universa1: mrstbbons: weird, though your code is not exactly the same, but Administration should already be in the top level namespace, so you won't need the first :: at line 5in your companies_controller.rb gist
[09:37:36] Intrepidd: BrazenBraden: Can you add your gemfile as well please ?
[09:39:32] mrstbbons: universal: true. but that does not affect the problem. I really don't get it. Rails bug?
[09:39:51] universa1: mrstbbons: doubt it.
[09:40:02] universa1: something is different between console and your controller
[09:40:17] mrstbbons: yeah. what and how to find out
[09:40:22] universa1: mrstbbons: does: Forgot::Address.new work?
[09:40:28] universa1: in your controller
[09:41:14] universa1: mrstbbons: hmm, restarted the server ?
[09:42:28] mrstbbons: i still don't get why
[09:43:08] universa1: mrstbbons: rails only picks up changes in directories whcih existed at server start, if you add a new directory, it needs a restart iirc.
[09:44:49] mrstbbons: universal: but i did not add any directory... Funny thing: After it worked I removed the call to MasterData::Address.new and suddenly there was the error again. I restarted the server - error was gone.
[09:45:39] universa1: mrstbbons: hmm, haven't used namespaced models in quite some time, but iirc it should nowadays just work ;)
[09:45:53] Intrepidd: BrazenBraden: is it any better with this ? https://gist.github.com/Intrepidd/0a1069c05388d6d07d80 (I removed the .css.scss in the requires and imports)
[09:47:01] mrstbbons: universal: anyway, thank you for your help
[09:47:18] BrazenBraden: Intrepidd: import does not work without the extensions
[09:47:19] universa1: mrstbbons: yw
[09:47:41] BrazenBraden: Intrepidd: fine in the require bits
[09:50:08] adammcarth: My new bible came today ;) http://imgkk.com/i/wav4.jpg
[09:54:09] dangerousdave: anyone know of good examples of displaying flash messages? tutorials? etc?
[09:54:22] universa1: dangerousdave: ?
[09:54:45] dangerousdave: universa1: UI examples, best practice
[09:55:02] universa1: dangerousdave: <div class="notices"><span class="alert"><%= flash[:alert] %></span></div>
[09:55:06] dangerousdave: top of screen, auto hide with JS or CSS3 ...
[09:55:27] dangerousdave: always visible
[09:55:44] dangerousdave: just wanted some options
[09:55:46] universa1: dangerousdave: !railscast announcements
[09:56:11] dangerousdave: perfect! thanks
[09:58:26] Intrepidd: BrazenBraden: maybe put the asset related gems in group :assets, even if I don't think that will really help
[10:05:32] mrstbbons: somehow i feel riddiculed by all this. Now, the active_record translations are not working. Here some examples: https://gist.github.com/anonymous/2563727e724285a3df34 and I followed this guide: http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models
[10:06:37] krz: what are some decent nosql document databases?
[10:06:55] _str: hi all, what the differences between "cache write" and "cache generate" and "cache fetch_hit" ?
[10:07:04] _str: what are *
[10:07:13] krz: by decent, i mean good documentation, ruby driver, and preferably a cloud storage solution (dbass)
[10:08:12] universa1: mrstbbons: http://stackoverflow.com/questions/7693040/how-to-translate-model-in-namespace
[10:09:14] mrstbbons: universal: thats what you get by reading only the answer that is marked correct.
[10:09:20] mrstbbons: universal: thanks
[10:10:16] universa1: mrstbbons: the important part is: Products::Car.model_name.i18n_key ;)
[10:14:55] mrstbbons: universal: that would be for me :"master_data/address"
[10:22:26] greengriminal: Has anyone used: https://github.com/gollum/gollum with ruby 2.0
[10:22:45] greengriminal: though it says: Ruby 1.8.7+ (1.9.3 recommended). So i guess I will be forced to used 1.9.3 then?
[10:26:55] jrobeson: greengriminal, when you see that, your best bet is to look at the issue reports and read any ones related to that
[10:27:25] jrobeson: there is in fact one related to that.. so it won't work with ruby 2.0.0 out of the box
[10:27:35] jrobeson: but that is what you should do in the future.. always read the issues
[10:27:44] greengriminal: jrobeson: Was just doing that you messaged me
[10:28:36] greengriminal: furthermore it doesn't work on windows. Just thought of a compatibility issue. Because if its being ran on a windows server it just won't work. Decided to go with stiki
[10:31:59] krz: anyone use rails with 2 postgres databases? one for oltp and the other for olap?
[10:32:10] krz: olt and olap are just examples
[10:32:23] thmzz: Can anyone tell me why I'm getting on the delete link "/admins.1" and not "/admins/1" ? https://gist.github.com/thomasstr/6916308
[10:32:29] krz: how hard is it to set rails up with two dbs?
[10:34:20] sypgame: hey guys, i'm going to start working on a new project. its a search engine and booking platform and i'm planning to use mongodb as i'm foreseeing that i can grow pretty big and since it's a search engine thing RDB is probably not a perfect fit but is there any gotchas that i need to be aware of when using mongo in terms of scaling, testing, or general development ?
[10:36:13] krz: sypgame: yea aggregation framework doesnt work with more than 1 level deep nested document
[10:36:27] krz: theres a jira ticket opened specifically on that issue since 2010
[10:36:42] krz: sypgame: documents have a limit of 16mb
[10:36:50] krz: ruby doc, not so updated
[10:37:00] krz: mongoid gem, no support for rails 4
[10:37:39] krz: i would suggest rethinkdb
[10:37:56] krz: not ready for production, but much better documentation
[10:38:06] sypgame: krz, ah, i didn't know that, so do you suggest any alternatives, maybe split db's
[10:38:18] krz: the things they are doing with it are quite interesting. rethink also falls under the category of nosql document based
[10:38:28] krz: sypgame: bigtable?
[10:38:37] krz: riak? cassandra?
[10:38:51] krz: rethinkdb is on my list
[10:39:46] jrobeson: or just postgres..
[10:40:37] ronalchn: easier to set up pg as a conventional db
[10:41:35] jrobeson: redis is nice also.. depending on the amount of data
[10:41:48] ronalchn: so, anyone used presenters with rails?
[10:41:55] rwsq1: I have a resource that has a field with textarea form entry - how would I go about validating each line of that?
[10:42:15] jrobeson: rwsq1, write a custom validator.. an example is in the validations guide
[10:42:24] rwsq1: jrobeson, ok thanks
[10:50:38] maxim0s: krz: mongoid is supported with rails 4 now.
[10:51:08] Ericx2x: anyone know a good irc for webapp hacking?
[10:51:26] krz: maxim0s: no its not
[10:51:43] maxim0s: but I am using it with my rails 4 app
[10:52:06] krz: you are probably using the master branch
[10:52:27] maxim0s: no, some little hack, http://stackoverflow.com/questions/17800000/cant-get-mongoid-working-with-rails-4
[10:53:16] maxim0s: yeah, master branch
[10:56:10] maxim0s: Guys, anyone used Elastic Search with MongoDB?
[10:56:25] krz: maxim0s: then its not the stable branch innit
[10:57:27] maxim0s: but time being, as long as I see everything working, I have to keep going.
[11:17:14] AntelopeSalad: for some reason when i try to sign in with devise it's using https , i've never seen this before , i tested locally in production mode and it never set https before , i did not enable https anywhere
[11:23:16] universa1: AntelopeSalad: it doesn't magically switch to https.
[11:24:16] universa1: AntelopeSalad: so do a search for ssl / https in your project and see what turns up
[11:25:55] AntelopeSalad: universa1: it really did though, i've ran it production mode locally and it never went with https
[11:26:11] AntelopeSalad: the only difference is now i'm behind nginx on ec2 instead of a local vm
[11:26:31] universa1: AntelopeSalad: there is a reason for the bejaviour, and the reason is in 99,99% of the cases something you've done
[11:26:47] universa1: AntelopeSalad: so check your nginx "vhost" config?!
[11:28:13] AntelopeSalad: universa1: i isolated it to something with devise because look at this...
[11:28:53] AntelopeSalad: accessing my site directly results in http , clicking around clicks via GET is http , submitting a form while not signed in with devise is http , as soon as i submit any form after signing in with devise it tries to use https
[11:29:01] AntelopeSalad: *clicks = links
[11:29:21] universa1: AntelopeSalad: so it's in your app code / devise configuration...
[11:30:22] AntelopeSalad: yeah but i never touched any config options with https/ssl info, and i've ran the site in production mode too without any probs like this
[11:30:42] universa1: AntelopeSalad: computers don't magically do things differently.
[11:30:55] universa1: something changed and it's either in your code or in your dependencies.
[11:31:32] Tarential: universa1: Once I had a windows system locked down with Deep Freeze that would offer different resolutions available at every boot.
[11:31:52] Tarential: universa1: I'm sure there is a perfectly logical reason for it, but it *seems* magic :P
[11:31:53] AntelopeSalad: i'm running an exact clone of the app code right now and it doesn't do anything with https
[11:32:02] AntelopeSalad: locally that is
[11:32:31] universa1: AntelopeSalad: so what is the difference between local and server? ...
[11:33:01] AntelopeSalad: nothing other than nginx, i'm logging into the server now to double check the conf
[11:33:46] universa1: so same os, same updates installed? even though that should be irrelevant to your problem.
[11:33:59] AntelopeSalad: yes, ubuntu 13.04 on both
[11:34:43] AntelopeSalad: i think i may have found it
[11:34:54] AntelopeSalad: proxy_set_header X-Forwarded-Proto https;
[11:35:37] universa1: AntelopeSalad: yeah... magic. :p
[11:35:54] AntelopeSalad: changing that and restarting nginx fixed it
[11:36:08] universa1: but then the real question is: why are you not using ssl?
[11:36:35] AntelopeSalad: one step at a time
[11:38:54] AntelopeSalad: i figured i'd get the deploy working and then worry about ssl if it really becomes an issue
[11:39:35] Tarential: AntelopeSalad: Define "really becomes an issue". Seems to me it becomes an issue anytime you have a login (and you are using devise, yes?)
[11:40:09] nettoweb: guys, I have a website with plans for user, I want to change the status to '0' of every record in the database if user change their plan to Free??? where is the best place to put this logic/method?
[11:41:08] AntelopeSalad: Tarential: yep, to me an issue is more than myself is using the site, i didn't launch a massive saas quite yet :D
[11:41:59] Tarential: AntelopeSalad: Fair enough. But use a throw-away password until you get ssl installed. Change other instances of it if you have used it multiple times.
[11:41:59] AntelopeSalad: nettoweb: i would probably put that in a migration
[11:42:40] workmad3: why, why, why do people still deploy sites without an SSL cert?
[11:42:46] AntelopeSalad: Tarential: yeah i always use a different password for everything
[11:42:47] workmad3: www.startssl.com <-- they're free!
[11:43:12] AntelopeSalad: if it's free then i might hook it up
[11:43:24] AntelopeSalad: i thought it was somewhat pricey for the certs
[11:43:25] nettoweb: AntelopeSalad: migration? i always use migration to create/delete fields in the db
[11:43:25] Tarential: workmad3: Before buying them I always just signed my own. I agree.
[11:43:39] workmad3: Tarential: yeah, I did that too :) and still do at times
[11:44:12] AntelopeSalad: hmm, do browsers let people through without any notices if you self sign?
[11:44:15] workmad3: Tarential: for one internal app, I actually created my own root CA and automatically created certs off that for fresh deploys... then I sent the root CA around to the users and said 'install this to avoid SSL warnings'
[11:44:19] workmad3: AntelopeSalad: no
[11:44:23] Tarential: AntelopeSalad: No. But you mentioned that it's just you.
[11:44:41] workmad3: AntelopeSalad: unless you pre-share the cert and get users to install it, or get the root CA into some certificate bundle that all your users install
[11:45:08] workmad3: AntelopeSalad: the startssl root CA is in most browsers/systems now :)
[11:45:16] AntelopeSalad: those notices about not being validatable are more scary to me than no ssl, it wouldn't matter in this case though if it's just me
[11:45:25] workmad3: AntelopeSalad: and so you now have a free option that doesn't trigger those warnings
[11:45:37] AntelopeSalad: yeah i'll definitely check em out
[11:46:09] workmad3: AntelopeSalad: it would be a bit disturbing if a browser could verify the identity of a self-signed cert
[11:46:28] workmad3: AntelopeSalad: I'd wonder why google are following me around and stealing the public certs of everything I generate :)
[11:46:28] universa1: workmad3: the nsa surely can ;)
[11:46:48] workmad3: universa1: doubt it ;)
[11:47:08] workmad3: universa1: after all, a self-signed cert doesn't *have* an identity to follow back to
[11:47:16] Tarential: live monitoring of private keys is beyond the powers of even the NSA currently, or there wouldn't be a lavabit scandal
[11:48:06] workmad3: universa1: unless you're claiming they've managed to backdoor all opensource key generation programs so that whenever a new key is generated, it phones back to the NSA with the key and machine info of the generator
[11:48:13] Tarential: but I wouldn't generate them on EC2, just in case...
[11:48:38] AntelopeSalad: btw do you guys also use cap for deploys?
[11:48:45] Tarential: AntelopeSalad: Yes ^^
[11:48:53] workmad3: AntelopeSalad: sometimes, if it's a small deploy on a machine I didn't set up myself
[11:48:59] workmad3: AntelopeSalad: otherwise I tend to deploy with chef
[11:49:17] universa1: starting to like mislav's git-deploy
[11:49:23] AntelopeSalad: how did you handle your shared assets not getting appended to by every deploy?
[11:49:24] Tarential: I've heard very good things about chef. Just haven't had a chance to try it yet.
[11:49:42] universa1: but then i've to look into dockers ;-)
[11:49:45] AntelopeSalad: everytime i deploy it just throws the assets in that dir, but there's no cleanup task
[11:50:03] Tarential: AntelopeSalad: Actually my front end is completely separate and I deploy with my own custom script. I just have a cap task that links the front end in to the release.
[11:50:17] AntelopeSalad: i think it's an underlying problem with cap
[11:50:28] AntelopeSalad: because if your assets are shared between deploys then there's no sane way to do a rollback
[11:50:37] workmad3: AntelopeSalad: sure there is
[11:50:47] AntelopeSalad: you would have to keep all of the stale assets in there
[11:50:58] universa1: AntelopeSalad: just recompile on a rollback?
[11:51:18] AntelopeSalad: yeah but when you recompile they all get different filenames
[11:51:22] workmad3: AntelopeSalad: no they don't
[11:51:23] universa1: tbh i've never rolled back a deploy
[11:51:34] Tarential: universa1: Lucky you.
[11:51:43] workmad3: AntelopeSalad: the filename digest is a hash of the contents
[11:51:47] AntelopeSalad: i've never rolled back either, but so far i've only pulled the cap deploy trigger twice haha
[11:51:48] workmad3: AntelopeSalad: that only changes if the asset itself changes
[11:51:49] universa1: and even if they did, who cares? the server needs to be restarted anyways
[11:52:24] workmad3: AntelopeSalad: and the digest gets stored in the manifest file, which is loaded and cached on server boot
[11:52:41] workmad3: AntelopeSalad: so you rollback, recompile to ensure the manifest is good, restart server
[11:52:57] ronalchn: hi, so I've built my own presenter interface today, anyone want to have a look and comment?
[11:53:31] workmad3: ronalchn: I think my comment would be 'oh, another presenter' :P
[11:53:55] ronalchn: well, initially it was kind of just another presenter
[11:54:03] ronalchn: but I didn't really like how draper calls them decorators
[11:54:17] workmad3: well, draper's things are decorators
[11:54:29] ronalchn: yes, but not all decorators are presenters
[11:54:32] workmad3: because they keep a 1-1 correspondance with models irrespective of views
[11:54:43] workmad3: ronalchn: and not all presenters are decorators either ;)
[11:55:07] ronalchn: but I've put in a strong parameters inspired permit check
[11:55:22] ronalchn: except instead of doing it for updates, it does it for each attribute presented
[11:55:50] ronalchn: this is my base presenter class: https://github.com/NZOI/nztrain/blob/master/lib/strong_presenter/base.rb
[11:56:40] workmad3: ronalchn: hmm... so you've kept a 1-1 model/presenter correspondance?
[11:57:08] workmad3: ronalchn: a.k.a. it's a decorator? :P
[11:57:25] universa1: not understanding your permit thing
[11:57:31] ronalchn: but I could in future have decorators that are not presenters
[11:57:44] ronalchn: the permit thing is supposed to work like strong parameters does, but for presenting
[11:57:59] workmad3: ronalchn: you could... but you're much more likely to have presenters that aren't decorators
[11:58:05] workmad3: ronalchn: that's the more common thing
[11:58:06] ronalchn: so I've got a view which does a "mass presentation" type thing https://github.com/NZOI/nztrain/blob/master/app/views/problems/index.html.erb
[11:58:08] universa1: yeah, not understanding that part: i'm the one writing the code
[11:58:19] universa1: so no user input, nothing to permit.
[11:58:29] ronalchn: then in my controller, I permit it at https://github.com/NZOI/nztrain/blob/master/app/controllers/problems_controller.rb
[11:58:40] workmad3: ^^ I'm kinda here too... why would I want to be jumping through hoops to trust myself?
[11:58:43] ronalchn: it's more of a convenience thing
[11:58:49] workmad3: ronalchn: how is it convenient?
[11:58:52] AntelopeSalad: is it a general rule of thumb such that if you edit anything in /config/ you cannot do a phased restart but instead a full restart?
[11:58:53] Tarential: universa1: I think I understand what he means. If a user can't edit a param, they shouldn't be able to "view" it either.
[11:58:59] ronalchn: its so that I don't have to do permission checks in the view
[11:59:20] ronalchn: well, there's separate permissions for viewing and updating
[11:59:37] ronalchn: but it means I can remove some if can? or if permitted_to? checks
[11:59:40] Tarential: universa1: Apparently not.
[11:59:40] ronalchn: from the view
[11:59:45] ronalchn: and keep it in the controller
[12:00:21] gildo: how can i override devise in order to call a method each time it creates a new user?
[12:00:45] universa1: gildo: the devise wiki has several examples for overriding stuff
[12:01:08] Tarential: gildo: But wouldn't an after_create hook in your user model work too?
[12:01:51] gildo: umh let's see
[12:02:06] bastilian: gildo: https://github.com/plataformatec/devise/wiki/How-To:-Redirect-to-a-specific-page-on-successful-sign-up-(registration)
[12:03:19] bastilian: gildo: in the new registration controller you can also override the create method. i would suggest to just set an attribute on the model and act on it in the model itself
[12:03:48] gildo: hmm i think after_create works for me
[12:06:45] gildo: bastilian, https://gist.github.com/gildo/33a4ae2395c566e77120
[12:07:43] bastilian: gildo: seems about right.
[12:08:27] gildo: bastilian, in seller_email: email, email is the right variable for the new registred user?
[12:08:58] bastilian: gildo: it should be, yes.
[12:10:19] BrazenBraden: whats the opposite to head :ok ?
[12:10:30] clocKwize: BrazenBraden :ok is just a 200 response
[12:10:37] clocKwize: so 500 is totally not ok
[12:10:39] BrazenBraden: yea, and a 500 ?
[12:10:48] BrazenBraden: head :epic_fail ?
[12:10:55] clocKwize: :internal_server_error maybe
[12:10:57] clocKwize: I don't actually know
[12:11:18] ryannielson: Are there any services out there to monitor gems and versions and tell me when there are updates available.
[12:11:36] tagrudev: rubygems :D
[12:12:06] ryannielson: tagrudev: automatically that is
[12:12:27] BrazenBraden: clocKwize: useful page: http://www.codyfauser.com/2008/7/4/rails-http-status-code-to-symbol-mapping :)
[12:12:38] clocKwize: I just found something similar, waiting for it to load
[12:12:59] clocKwize: http://apidock.com/rails/ActionController/StatusCodes
[12:13:03] BrazenBraden: if you try model.save and it freaks out, what would response code would i use?
[12:13:27] clocKwize: if its failing to save because the validation failed for stuff a user passed in
[12:13:54] clocKwize: 406, not acceptable?
[12:14:17] clocKwize: ACTION isn't all restful
[12:14:19] BrazenBraden: hmm ok.. guess an easy way to find out is look at the console when it fails and see the response
[12:14:55] clocKwize: someone is saying 403
[12:14:59] clocKwize: as in, forbidden
[12:15:18] clocKwize: The server understood your request, but refused to do it
[12:15:30] clocKwize: its not necessarily just for Authentication failures
[12:16:31] gildo: bastilian, any idea how can i call a field of the new user in the function?
[12:17:10] workmad3: clocKwize: a server shouldn't use a 403 to say 'unauthenticated' ;)
[12:17:10] bastilian: are you on rails 4? you might have to use "self.email"
[12:17:31] gildo: uhm let's see
[12:17:54] workmad3: clocKwize: a 401 is a 'you're not allowed to do this, but you may be able to after authentication'
[12:18:04] clocKwize: erm, yeah thats a 401
[12:18:28] clocKwize: but people often use 403 to say you aren't allowed to do this (eg forbidden from doing so)
[12:18:44] workmad3: yeah, that's correct
[12:18:53] workmad3: but not for unauthenticated users
[12:19:25] workmad3: and also not for authenticated users if you're using multile auth methods and allowing more access when using more forms of auth
[12:19:51] workmad3: e.g. you can browse when you've logged in with a password, but you need to also supply a session token in order to edit
[12:20:29] workmad3: a 403 is 'nope, no, you're not allowed to do that'
[12:20:39] workmad3: (complete authorization failure)
[12:21:24] koopee: Trying to debug controlle rspec test. I would like to see the session content in between the test, but the run complains that session is undefined.
[12:25:19] koopee: ok, sorry, wrong context. Printing of the session works fine in controller context but I was trying to print it in feature tests
[12:30:14] krz: think i may go with rspec
[12:30:24] krz: from minitest
[12:30:51] AntelopeSalad: for some reason nginx won't serve my /public assets (sitemap, robots.txt, etc.), am i correct to think i need to setup a specific route for them? i thought it would just pickup anything in /public
[12:31:30] Krikke: i think you need to tell it to server static assets
[12:31:39] AntelopeSalad: the location is: location ~ ^/(system|assets)/
[12:31:50] AntelopeSalad: would i need to hardcore in the sitemap and robots filenames?
[12:31:52] workmad3: AntelopeSalad: entire nginx config pls
[12:31:58] AntelopeSalad: foo|bar|baz, etc.
[12:33:32] AntelopeSalad: workmad3: http://pastie.org/8392211 , that's the vhost aspect of it
[12:33:37] AntelopeSalad: do you want to see the main confg as well?
[12:33:39] soahccc: AntelopeSalad: I think you look for try_files
[12:34:35] AntelopeSalad: it would sort of make sense if i had to put the filenames in that regex since the robots/sitemap does not live in /assets or /system
[12:34:45] AntelopeSalad: soahccc, oh i'll check that out
[12:37:46] soahccc: AntelopeSalad: This one is a bit older (no assets directive) but it might help https://gist.github.com/2called-chaos/94511825ef8cdb1b4808#file-nginx-L49
[12:38:34] AntelopeSalad: soahccc: how does it know the path for the error pages?
[12:38:47] soahccc: AntelopeSalad: I've set the root in line 14
[12:38:49] AntelopeSalad: oh, from the root
[12:40:03] AntelopeSalad: i'll try this config style out, it looks much cleaner than mine
[12:41:08] AntelopeSalad: soahccc: the only thing i'm confused about is...that @unicorn is using the /current/public page it seems
[12:42:42] soahccc: AntelopeSalad: you don't have to set the document root to something else for the backend process (he won't care)
[12:43:03] soahccc: It doesn't affect Rails.root or something
[12:43:11] AntelopeSalad: oh, i set mine to /home/deploy/www/foo , because i thought it lives in foo
[12:43:44] workmad3: AntelopeSalad: pretty much any guide tells you to set the web server's vhost root to the app/public directory :)
[12:44:03] workmad3: AntelopeSalad: so that static file serving can occur
[12:44:33] soahccc: AntelopeSalad: If you would set the root to your app directory and not passing everything to a backend you could download the application files
[12:45:09] AntelopeSalad: wow that would be a problem haha
[12:45:39] AntelopeSalad: what is $uri in this case btw, the entire full incoming address?
[12:46:01] soahccc: in other words, nothing publicly available should be in your root resp. public path
[12:47:19] ReBa_: Good afternoon
[12:47:24] clocKwize: gah, OmniAuth
[12:47:35] clocKwize: doing totally different things in development and any other environment
[12:47:46] AntelopeSalad: also i noticed the orderingof your proxy commands are different soahccc, does that matter?
[12:47:55] AntelopeSalad: for example you do the forwarding headers and then proxy pass
[12:48:04] clocKwize: dev: raise an error other: redirect to a different url --- /me handles this error, then everything blows up in staging :)
[12:49:01] soahccc: AntelopeSalad: http://wiki.nginx.org/HttpCoreModule#Variables
[12:49:40] starfox21: Hey guys I am setting up a way for users to unsubscribe from emails. Right now I have an unsubscribed_emails table and I if I am about to send an email I want to remove any email addresses in the .to field that are in the unsubscribed_emails table. What is the best way to do this?
[12:50:02] soahccc: AntelopeSalad: And I don't know exactly. I think the order is important in some parts but I don't know, too long ago when we first made this config (we just used it and modified it over and over again)
[12:50:23] AntelopeSalad: your ordering makes sense if it does matter
[12:50:30] AntelopeSalad: you would want the proxy headers to be set and then pass
[12:50:42] BrazenBraden: is there a shorter and prettier way to do http://hastebin.com/qatedijula.rb ?
[12:51:20] starfox21: btw I am using rails 3. What I was trying to do was to set up an interceptor, with a method delivering_email that does something along the lines message.to.reject! { |email| Unsubscription.unsubscribed?(email) }
[12:51:31] workmad3: BrazenBraden: are you sure you want to be toggling it?
[12:51:40] AntelopeSalad: soahccc: so far so good, i mimic'd your config and i can access those files now + the site still works
[12:51:45] BrazenBraden: workmad3: don't i?
[12:51:56] AntelopeSalad: i like how you handled errors too, that was next on my list but now it's a solved prob
[12:52:03] workmad3: BrazenBraden: or rather, are you sure you want to be raising a server error based on the result of that?
[12:52:15] workmad3: BrazenBraden: as that would mean you get a 500 result every time you deactivate a user ;)
[12:52:25] BrazenBraden: workmad3: will need some header response for ajax to work with ('ajax:error')
[12:52:37] AntelopeSalad: soahccc: i'm curious though, why aren't you using gzip?
[12:52:43] BrazenBraden: workmad3: no no.. only if the toggle fails to perform
[12:52:43] AntelopeSalad: or is that declared in your main conf?
[12:52:47] BrazenBraden: it toggles and saves fine
[12:53:01] soahccc: AntelopeSalad: We use gzip_static in newer projects (with asset pipeline)
[12:53:39] workmad3: BrazenBraden: ah, my mistake on what toggle! returns
[12:53:45] workmad3: BrazenBraden: I thought it returned the value
[12:54:05] AntelopeSalad: soahccc: ok i'm using that too, but that also means i do not need to define any other gzip definitions right?
[12:54:08] workmad3: BrazenBraden: looks fine as is tbh
[12:54:25] AntelopeSalad: i have gzip on with some params in my base conf, i guess that's not needed then since gzipping images would be useless?
[12:54:33] BrazenBraden: workmad3: no 1 liner version? blah ? foo : bar doesnt work with it
[12:54:41] workmad3: BrazenBraden: none that would be cleaner
[12:54:43] soahccc: AntelopeSalad: But we don't use dynamic gzip if you mean that, we only server precompile assets this way.
[12:54:56] BrazenBraden: workmad3: okie
[12:55:03] AntelopeSalad: i have mine precompiling .gz for css/js
[12:55:11] AntelopeSalad: and the sitemap (using sitemap_generator)
[12:55:30] BrazenBraden: so.. i have listened through the Pirates of the Carrebean and Gladiator soundtracks so far.. any new recommendations?
[12:55:31] workmad3: AntelopeSalad: depends on the image being gzipped really ;)
[12:55:46] workmad3: BrazenBraden: the complete works of william shatner
[12:55:55] workmad3: BrazenBraden: start with his rendition of Rocket Man
[12:56:21] AntelopeSalad: workmad3: i suppose, but for most cases with static_on you wouldn't need any other gzip right?
[12:56:44] soahccc: AntelopeSalad: then you might want something like this https://gist.github.com/2called-chaos/94511825ef8cdb1b4808#file-assets
[12:56:44] workmad3: AntelopeSalad: tbh, I'm still getting my head around certain aspects of nginx config :)
[12:56:56] AntelopeSalad: it's a lot to take in for sure
[12:56:58] soahccc: AntelopeSalad: Should be on there though :D
[12:57:31] BrazenBraden: workmad3: actually watching it
[12:57:32] workmad3: AntelopeSalad: until quite recently, I always used apache ;)
[12:57:36] BrazenBraden: workmad3: he is soo young!
[12:57:46] mikecmpbll: can anyone tell me what version of rails the lambda association conditions syntax was introduced?
[12:57:48] workmad3: BrazenBraden: hah
[12:57:52] soahccc: Apache </3
[12:58:01] workmad3: BrazenBraden: next, look up Leonard Nimoy's Bilbo Baggins song
[12:58:11] AntelopeSalad: apache/php ruined my life
[12:58:23] workmad3: AntelopeSalad: you can drop 'apache' from that ;)
[12:58:31] BrazenBraden: workmad3: Leonard Nimoy? That's the dude they keep talking about in BBT
[12:58:34] AntelopeSalad: everytime i had to rewrite a url in the htaccess file i died a little inside
[12:58:38] workmad3: BrazenBraden: he's Spock
[12:58:47] BrazenBraden: workmad3: oooohhh!!!
[12:58:52] workmad3: ACTION facepalms
[12:59:03] soahccc: workmad3: well php on nginx ruined my life. How would you get that working properly? :)
[12:59:23] workmad3: soahccc: what are you views on goat sacrifice?
[12:59:59] BrazenBraden: workmad3: omg what are you doing to my brain O.o
[13:00:07] BrazenBraden: workmad3: next thing i know i'll be watching the Teletubbies
[13:00:28] workmad3: BrazenBraden: hey... the Teletubbies are a step up from shatner's and nimoy's contributions to 'music'
[13:00:43] helpa: BrazenBraden: http://youtu.be/kfVsfOSbJY0
[13:00:43] workmad3: BrazenBraden: !friday is next ;)
[13:00:52] BrazenBraden: workmad3: take that away
[13:00:57] workmad3: BrazenBraden: or maybe yatta?
[13:01:16] BrazenBraden: workmad3: firstly it is only friday tomorrow, secondly, I drive alone so no need to struggle in choosing a seat
[13:01:47] BrazenBraden: this is how i often feel after a day fighting with JavaScript
[13:01:48] BrazenBraden: http://www.youtube.com/watch?v=hnzHtm1jhL4
[13:02:17] workmad3: BrazenBraden: http://www.youtube.com/watch?v=rW6M8D41ZWU
[13:02:34] workmad3: BrazenBraden: and http://www.youtube.com/watch?v=cKQ5XNjXWzM
[13:02:52] workmad3: ACTION waits for BrazenBraden's brain to start melting out his nostrils
[13:03:03] BrazenBraden: workmad3: http://www.youtube.com/watch?v=jofNR_WkoCE
[13:03:18] BrazenBraden: workmad3: now sit back and think "wtf"
[13:03:43] soahccc: wtf is the correct term for that
[13:04:40] workmad3: I wish I could
[13:04:48] workmad3: but as surreal videos go, that one's tame :P
[13:04:57] BrazenBraden: workmad3: I am slightly concerned for your mental state of being after experiencing your choice of "entertainment"
[13:06:06] Syrit: Guys, in my Meeting index view i am trying to list the sales_reps names (Meeting has_many sales_reps) , now i am finding it a bit difficult to sepearate the names with a comma , here what i've done https://gist.github.com/anonymous/c9536713ef9ed2994549 , but this way, there is a comma even if there is only one name !
[13:06:24] workmad3: BrazenBraden: I found http://www.youtube.com/watch?v=PaEnaoydUUo more disturbing than 'What the fox say'
[13:06:44] Syrit: is this ruby on rails channel ? :D :D lol
[13:07:13] helpa: BrazenBraden: http://www.youtube.com/watch?v=yzC4hFK5P3g
[13:07:13] workmad3: BrazenBraden: !ponpon
[13:07:34] workmad3: Syrit: not right now... check back again later ;)
[13:07:43] soahccc: We're pretending it to be friday I think
[13:08:05] BrazenBraden: workmad3: now that's more like it.. she's cute!
[13:08:23] universa1: Syrit: ["a", "b", "c"].join(", ")
[13:08:52] maoko: It just seems the right time to ask that "did you use ...?" question.) Did anyone try using wickedpdf or the wkhtmltopdf library itself? I can't get fonts working at the server side for the pdf generation. ;/
[13:09:03] Syrit: universa1, when i use .join, i get an error "undifined method join for String"
[13:09:24] ljarvis: Syrit: meeting.sales_reps.map(&:name).join(", ")
[13:09:34] AntelopeSalad: soahccc: hate to keep asking but do you know why this would cause an infinite redirect loop? return 301 $scheme://www.domainname.com$request_uri;
[13:09:53] Syrit: thanks ljarvis
[13:10:02] Syrit: universa1, is that what you meant as well ?
[13:10:06] soahccc: AntelopeSalad: What are you trying there?
[13:10:20] AntelopeSalad: trying to redirect foo.com to www.foo.com
[13:10:25] ljarvis: Syrit: universa1 was showing you how join works, it was your job to write it (not mine)
[13:10:37] universa1: Syrit: i haven't looked at your code, i gave you ane xample and expected you to be able to adopt it.
[13:10:38] BrazenBraden: workmad3: i'd tap that ponpon
[13:10:40] AntelopeSalad: a lot of SO answers/blog posts say return XXX is now part of the standard rewrite module
[13:11:13] universa1: AntelopeSalad: wiki.nginx.org/Pitfalls#Taxing_Rewrites
[13:11:33] Syrit: right, the map is what i needed ljarvis , thank you
[13:11:42] AntelopeSalad: universa1: i implemented the third one but visiting the site says it's an inifite redirect
[13:11:51] Syrit: thank you universa1
[13:12:34] universa1: AntelopeSalad: are you checking if your request is missing www.?
[13:12:34] soahccc: AntelopeSalad: We use separate vhost for that, are you doing it in one?
[13:12:58] AntelopeSalad: soahccc: i'm doing it inline with my current vhost
[13:13:05] AntelopeSalad: do you want me to gist the new copy?
[13:14:29] AntelopeSalad: http://pastie.org/8392342 , it's commented out on line 8
[13:15:48] soahccc: I don't know if we do it clever but this is how we do it https://gist.github.com/2called-chaos/94511825ef8cdb1b4808#file-redirect
[13:16:01] Macaveli: Can you compare dates in rails via "<" or ">" ?
[13:16:08] Macaveli: to see if the one is before the oteher
[13:16:13] ljarvis: Macaveli: try it
[13:16:37] ljarvis: it's not hard to do: 1.day.ago <= Time.now in a console
[13:16:39] Macaveli: irb says yes but just wondering if you better use function
[13:16:45] AntelopeSalad: soahccc: is it because i have my server defined as foo.com but it should be www.foo.com?
[13:16:56] ljarvis: Macaveli: < and > IS a function (well, a method)
[13:17:15] soahccc: AntelopeSalad: you just return everytime so you have an infinite loo??
[13:18:04] AntelopeSalad: hmm i followed this http://stackoverflow.com/a/7958540
[13:18:22] soahccc: AntelopeSalad: he use two vhosts
[13:19:13] lessless: what do I need to connect user in ember and on server?
[13:19:35] krz: doctor has_many patients through appointments. campaign has_many regions through _what_?
[13:19:51] AntelopeSalad: soahccc: i see, that's the best solution then?
[13:23:02] krz: anyone?
[13:28:04] nettoweb: i'm a column in db with int4, saving 0 and 1??? but in the view when I try to print, always show 0
[13:30:19] universa1: nettoweb: checked what values actually are in the db?
[13:31:54] nettoweb: 0 and 1 respectively
[13:31:59] nettoweb: but I always get 0
[13:32:14] universa1: nettoweb: so what happens if you do it in the console
[13:32:17] nettoweb: <%= @service.status %>
[13:32:40] universa1: nettoweb: Service.columns -- look for status, probably the mapping is off.
[13:33:08] Macaveli: ljarvis https://gist.github.com/YOUConsulting/14d6e230f78b3d5637fe why does it no go to the echO ?
[13:33:11] nettoweb: console: => 1
[13:33:19] Macaveli: start date is bigger than end da
[13:34:49] alex88: hello guys, which gem you use for livereloading your ror app?
[13:35:43] seba4: hi to all... hope someone can give me some direction how i can make this
[13:35:45] seba4: https://gist.github.com/seba4/6918422
[13:37:45] Intrepidd: alex88: What do you mean by livereloading ?
[13:37:46] Macaveli: ljarvis seems that I have to parse the date :)
[13:37:49] universa1: alex88: none, well guard runs the tests and if i need to jump into the browser: ctrl+r is my friend
[13:38:09] universa1: seba4: look for inspect etc.
[13:38:18] alex88: Intrepidd: reloading page/css when changing files automatically
[13:38:20] nettoweb: universa1: look for 'ativo' https://gist.github.com/anonymous/f97b5e584b75c6341f03
[13:38:27] Intrepidd: alex88: In development mode or in production ?
[13:38:31] Syrit: guys, i have a memo field, and sometimes it can be realy long, so, i don't want the coloumn displaying it to get so big, is truncate the right way to go, to disply a certain amount of the text ? or is there a better way ?
[13:38:33] nettoweb: universa1: the column in truth is 'ativo'
[13:38:39] alex88: Intrepidd: development ofc, no need to such an overhead in production
[13:38:53] tbuehlmann: seba4, define an #inspect method
[13:39:02] Intrepidd: alex88: It should already do it in development. config.cache_classes should be false, and assets are generated for each request
[13:39:02] BrazenBraden: what are the options you can pass along with 'head'? I would like to do something like head :ok, user: user.id; or something like that in order to set a reponse variable for ajax to pick up on... or should i be passing that with json or something in a format.json {} ?
[13:39:03] seba4: universa1, THX u d man:)
[13:39:11] seba4: tbuehlmann, ANd same to u:)
[13:39:18] alex88: universa1: I've tried guard but with ruby it works fine, with jruby it uses about 20/40% of cpu
[13:39:22] BrazenBraden: Intrepidd: I was an idiot earlier with the whole scss thing...
[13:39:35] Intrepidd: BrazenBraden: Oh, what was the problem
[13:39:35] alex88: Intrepidd: oh not that, I mean reloading browser automatically
[13:39:44] BrazenBraden: Intrepidd: clever me installs a new gem but fails to restart the server lol
[13:39:53] Intrepidd: BrazenBraden: hahaha
[13:40:06] Intrepidd: alex88: Oh ok I did not understand that ^^
[13:40:19] alex88: Intrepidd: maybe I explained it badly :)
[13:40:25] bennyzr: workmad3: any insights on my issue?
[13:41:52] maloik: Anyone aware of the proper way to do logging in pure rack apps? I've seen commonlogger being used, as well as stdout (which is slow), but no proper explanations
[13:41:59] bennyzr: workmad3: yes
[13:43:01] bennyzr: workmad3: yesterday I gave that gist about a where method not finding a record when evaluating true or 1.
[13:43:17] workmad3: bennyzr: oh, that one
[13:43:28] workmad3: bennyzr: the one where I couldn't see you setting the 'is_current' to 1 anywhere at all
[13:43:55] bennyzr: workmad3: right, i did respond that it's a default value in the db
[13:44:51] dangerousdave: I sign into my app, then sign out, then sign in incorrectly and devise gives my the following: "Signed out successfully." and "Invalid email or password." I understand why this is happening i think, due to renders. Not sure how to fix it though.
[13:45:46] clocKwize: man who's idea was it to put omniauth in a middleware. its cool, until you want it to do something different, then its totally disconnected from your app
[13:47:49] workmad3: clocKwize: the idea is that all the oauth stuff should be handled by omniauth without hitting your app, and then the results get pushed up to your app
[13:48:51] tagrudev: http://vimeo.com/32424001
[13:48:54] clocKwize: but if you decline authorization, it redirects to a path losing all the request parameters, or raises an error (configurable)
[13:49:06] clocKwize: you can't catch the error because it happens outside your app
[13:49:20] BrazenBraden: ajax:success(event, data)... how can i pop things in data in my controller?
[13:50:18] relix: hey guys, so I'm heavily caching some things
[13:50:27] Fly80: Hello! O'm looking at OSM RailsPort implementation and I've found an object BoundingBox. Is it defined in which gem/package? Where may I found documentation on this class?
[13:50:39] relix: in the view (fragment caching), but every time a small change is made, a lot of the cache needs to be thrown away (i'm using touch for that)
[13:51:08] relix: these changes are often done with ajax, so the cache is not rebuild right after the request, but rather when the user refreshes the page, or whatever, which incurrs a large delay
[13:51:14] workmad3: BrazenBraden: you add them to the json object you send back
[13:51:39] BrazenBraden: workmad3: ok, so i must do a f.json {} instead of head :ok then ?
[13:51:41] relix: is there a best practices or something, where after the modification of the model, I can set the view to automatically "reload" itself, which recreates the caches, before the user actually visits the page again?
[13:52:00] workmad3: BrazenBraden: you could also do a 'render :json => {whatever}'
[13:52:09] relix: the naive approach would be an observer to the model, which loads the URL after_save
[13:52:12] workmad3: BrazenBraden: or use a responder
[13:52:18] relix: the show_model_path
[13:52:30] relix: not sure if that's a good idea or not (and how to get that path in the model)
[13:52:48] BrazenBraden: workmad3: what is a responder? googling found me this: "response.headers['something'] = 'else'"
[13:53:12] Macaveli: I know how to use first and last in rails but is it possible to get for example the second index
[13:53:40] workmad3: BrazenBraden: it's when you use a line like 'respond_to :json' at the top of your controller (outside any methods and actions) and then do 'respond_with(@some_model)' in your model action
[13:53:53] BrazenBraden: workmad3: oh. i had that before
[13:56:04] BrazenBraden: workmad3: brilliant :)
[13:56:34] workmad3: BrazenBraden: if you're doing a lot of json stuff, you may want to look at active-model-serializers too ;)
[13:56:57] BrazenBraden: workmad3: do I even need the negative response? Like in that snippet, if true head :ok else head :fail; Wont head :fail be implied if not true?
[13:57:31] BrazenBraden: workmad3: first time im doing the render :json thing..
[13:57:52] workmad3: BrazenBraden: tbh, I'd mostly expect any failure out of that toggle! to be an exception
[13:58:12] chrisan: Do people use rspec disable test-unit entirely?
[13:58:37] BrazenBraden: workmad3: most likely yes.. therefore implying i dont need to bother with headers at that point
[13:59:19] workmad3: BrazenBraden: rails would be sending back a 500 in production for that anyway
[13:59:26] BrazenBraden: workmad3: cool
[14:00:04] BrazenBraden: so i could just do something like: head :ok unless false sorta thing?
[14:03:15] alex88: universa1: any way to run guard directly when running rails server on development? to not have to run it separately
[14:05:23] workmad3: alex88: also, why not have guard run your rails server?
[14:05:50] alex88: workmad3: ? isn't it intended to run just with guard start -P livereload
[14:06:33] workmad3: alex88: sure... for just a 'livereload' profile in your Guardfile
[14:06:52] workmad3: alex88: plenty of guard plugins out there for various things
[14:06:56] alex88: yeah, but since I'm running puma I've to start guard separately
[14:07:05] alex88: oh maybe I can just use my IDE livereload feature
[14:07:13] workmad3: alex88: or you could start your rails server with guard
[14:07:25] workmad3: alex88: 'because I'm using puma' doesn't mean you can't use guard to run it
[14:07:29] alex88: workmad3: mmhh like how?
[14:07:38] workmad3: ACTION checks
[14:07:41] workmad3: nope, my name isn't google
[14:08:27] workmad3: hell, you could probably do that one on an 'I'm feeling lucky'
[14:08:34] Intrepidd: alex88: try runnning bundle exec guard help start
[14:08:44] foucist: workmad3: i'm NEVER feeling lucky
[14:08:49] clocKwize: so I'm writing an ActiveSupport::Concern for Sidekiq workers, it needs to wrap perform(*args) and send some metrics.. I'm doing it with alias_method_chain but then I can only include my concern *after* the method is defined, but usually "include WorkerMetrics" would be at the top??? any way around this?
[14:09:16] bennyzr: workmad3: do I post this as a bug on the rails gem?
[14:09:34] foucist: bennyzr: what bug
[14:09:43] workmad3: bennyzr: tbh, I suspect it's an issue somewhere in your app
[14:09:55] alex88: oh ok thanks guys :D
[14:10:05] workmad3: bennyzr: if you think it really is a bug, you should be able to recreate it in a bare-minimum rails app
[14:10:20] alex88: so I start both rails and livereload plugins that does both the work
[14:10:32] foucist: clocKwize: it seems fine to have include happen after the alias method chain, both at the top ?
[14:10:42] workmad3: bennyzr: and if so, a) that would be weird because I've not encountered hundreds of people having issues with simple queries not working, b) that would be the time to post a bug report
[14:10:46] bennyzr: workmad3: the app works fine, it's only in testing that I found this behaviour.
[14:11:02] workmad3: bennyzr: which further indicates that it's an issue with your test, not with rails
[14:11:10] clocKwize: no the alias_method_chain is inside the Concern, but that needs to happen before def perform(*args), or it complains that perform NoMethodError..
[14:11:54] bennyzr: workmad3: also, the test worked fine before I upgraded from rails 3.0.3 to 3.1.11
[14:13:17] someish: I have the following code, which creates a temporary table, loads some data into it. Now, I'm trying to query that temporary table. What's the best way of going about that? Line 8 doesn't seem to work. https://gist.github.com/saturday/f089fe4bd82b16860a92
[14:14:12] ljarvis: so I'm using guard-rspec for the first time, am I confusing it with something else in that I thought it ran single specs rather the entire file when you save it?
[14:16:54] elfenars: it depends on how you configure it
[14:17:00] elfenars: it can do both
[14:21:15] ReBa_: https://gist.github.com/RemiSpot/d8800e46ed28c6bf2a08 I have some errors in my polymorphic association... I want to add a picture to an ablum (which becomes albumable) and now I want to add an image related to an album... but there seems to be some problems (Look at gist album.rb -> line 15)
[14:21:19] jlebrech: there should be a rubular for routes
[14:21:50] mfilipe: I don't know what is the problem here: https://gist.github.com/mfilipe/6919182
[14:22:07] mfilipe: I have the bundle installed
[14:27:04] arastu: what is the best way to debug the rails core source ?
[14:27:10] silasdavis: I'm trying to use bootstrap-sass with rails 4 and the asset pipeline
[14:27:21] silasdavis: in the sass source the image-url helper is used
[14:27:30] silasdavis: but it does not link to my precompiled, fingerprinted assets
[14:27:46] jlebrech: arastu: git clone, change the path to rails in gemfile to where you've cloned
[14:27:48] silasdavis: if not how does one use it with rails?
[14:27:52] tpayne84: I have resource :games do resource :squares ??? and I am trying to make a link that will update the nested resource 'value' property to 'X' ??? <%= link_to([@game, @board_squares[i]], :controller => "squares", :method => "patch", :value => 'X') do %> image link here <% end %> ??? but I am getting the right controller and action with the game id and square id ??? but that value isn't being passed in the params??? what am I doin
[14:27:54] ljarvis: elfenars: any idea how I can configure that? the docs do not help
[14:28:31] bklane: Is there a way to do a set number of nested fields? So with a shirt I have 4 Skus (S, M, L, XL) and want to always have the field available for each, any ideas?
[14:28:54] AntelopeSalad: silasdavis: i think so, although i always use: asset-url() and it works
[14:28:57] arastu: jlebrech, then all the rails gem ( active_record etc ) will be referred from my clone ?
[14:29:01] elfenars: ljarfvis: honestly, i don't remember since i haven't used guard-rspec in a while
[14:29:19] elfenars: but there's info around
[14:29:22] clocKwize: Wah! Just used ruby 2.0 prepend!
[14:29:26] silasdavis: AntelopeSalad: bootstrap-sass doesn't mention anything in its rails guide, and it clearly is used in rails heavily
[14:29:32] jlebrech: arastu: ah, i don't know :)
[14:29:59] AntelopeSalad: silasdavis: i don't use bootstrap-sass but i do use the url helpers in my own sass files without issues
[14:30:06] AntelopeSalad: are you compiling your assets with the correct env?
[14:31:22] arastu: i am using vagrant with rails-dev-box , when i execute this file https://github.com/rails/rails/blob/master/activerecord/examples/simple.rb
[14:32:08] arastu: using "ruby examples/simple.rb" then it just executes with any problem , but when i try to debug the file using "ruby -rdebug examples/simple.rb" then it just throws some exception
[14:37:06] silasdavis: AntelopeSalad: I thought I was
[14:37:20] silasdavis: RAILS_ENV=production rake assets:precompile right?
[14:38:36] silasdavis: background: url(<%= asset_path 'cream_pixels.png' %>);
[14:38:48] silasdavis: in my application.css.scss.erb
[14:39:06] elfenars: no erb needed
[14:39:16] ljarvis: asset-path
[14:39:20] silasdavis: then assets/cream_pixels-ac2b2ae3cda4fd5fd752cddf60dbb9da.png is generated
[14:39:38] silasdavis: but in the precompiled css it still uses body{background:url(/assets/cream_pixels.png)}
[14:39:51] jlebrech: something like this for routes http://raml.org/ ?
[14:39:57] silasdavis: I seem to remember I used the erb because I didn't trust the sass helpers
[14:39:57] ljarvis: then you dont want asset path
[14:40:00] ljarvis: you want asset url
[14:40:09] silasdavis: in any case the ERB version should work shouldn't it
[14:40:31] silasdavis: but it is not linking to the precompiled asset in the css
[14:41:41] gcds: Hello, maybe someone could drop some ideas how to make navigation plugin for rails with ability to add items from modules?
[14:41:47] arastu: anybody debugged the rails core itself ? need help ..I just want to debug the rails core source step by step to find out how rails define activerecord's model class's attribute on fly
[14:41:58] gcds: because every navigation gem doesnt support dynamic items
[14:42:00] arastu: but I do not know how to setup my environment and which debugger i should use
[14:42:16] arastu: i am using vagrant with rails-dev-box , but rdebug just does not work for me there :(
[14:42:30] arastu: how professionals develop rails core ?
[14:43:11] gcds: like from module call function Navigation::Menu.addItem("Hello World", path)
[14:43:19] tpayne84: Anyone know how to pass a property in the params on a nested resource link_to?
[14:44:55] tpayne84: silasdavis: you shouldn't need the extra still at all??? background: url('cream_pixels.png');
[14:45:43] csaunders: arastu: I believe it's just storing all the values in a hash
[14:46:03] csaunders: and using method_missing to generate accessors if that database field exists
[14:46:15] csaunders: maybe you should look into "Rebuilding Rails"
[14:46:42] silasdavis: tpayne84: url on it's own doesn't work, however asset-path does
[14:47:50] silasdavis: this is with rails 4, sass-rails from git
[14:49:10] ReBa_: https://gist.github.com/RemiSpot/d8800e46ed28c6bf2a08 Sorry guys, I really don't get my problem. My polymorphic association works for users, but it doesn't work for images
[14:49:29] tpayne84: silasdavis: post your css and the actual path in a pastie link I will look @ it??? I am doing what you are trying to do successfully on one of my heroku sites (which also uses the prcompile
[14:50:29] silasdavis: when you say the actual path, what do you mean exactly?
[14:51:09] jaustin_: Hi all - anyone have experience with implementing Twitter style hash tags? acts-as-taggable-on gem looks very thorough, but out of the box does not look like it supports a prefixed delimiter, only suffix.. anyone got any suggestions about where to look?
[14:51:17] krawchyk: so i'm confused about how to migrate mongoid nested attributes, i'm trying to change a field in a nested attr's model
[14:51:57] krawchyk: I've been looking here http://mongoid.org/en/mongoid/docs/nested_attributes.html but I'm not sure I am supposed to change the attr name with this instead of the model itself
[14:52:10] tpayne84: silasdavis: body { your code here } then a little farther down separate from the css a RAILS_ROOT/path/to/image ??? I would like to see it as that is interesting to me, bc I am pretty certain I didn't use the asset_path in mine
[14:55:09] greengriminal: Can anyone shed a little light on this gist: https://gist.github.com/anonymous/6919711 for which I have also included a description also.
[14:56:25] silasdavis: https://www.refheap.com/19609
[14:56:37] silasdavis: seems like image-url works in my files, but not in gem vendor's files...
[14:58:36] silasdavis: all my font-awesome-rails fonts appear as boxes too
[14:58:45] tpayne84: silasdavis: crazy??? here is code directly outa my custom.css.scss ??? body {background: url('bg.png');}
[14:59:00] silasdavis: rails version?
[14:59:11] silasdavis: do you have sass-rails in the gem file?
[14:59:19] silasdavis: maybe I should be using that from git
[14:59:25] silasdavis: I _think_ i had to at the time
[14:59:29] workmad3: silasdavis: 'url' isn't a sass helper
[14:59:40] workmad3: silasdavis: it's never been a sass helper
[14:59:54] workmad3: silasdavis: you always needed to do asset-url, image-url, etc
[14:59:55] tpayne84: gem 'sass-rails', '~> 4.0.0'
[15:00:07] workmad3: silasdavis: or url(asset-path(...))
[15:00:41] workmad3: silasdavis: or, in other words, lines 11-14 of that refheap not working... exactly as expected ;)
[15:00:51] tpayne84: https://github.com/tpayne84/test_tracker
[15:00:51] tpayne84: army bad wrong link
[15:00:51] tpayne84: silasdavis: https://github.com/tpayne84/flash_card
[15:05:13] momomomomo: God damned the Facebook API documentation
[15:05:48] momomomomo: Is there a trick to getting 'Summary' response data from a request? &summary=1 doesn't seem to be doing it :/
[15:06:13] tpayne84: workmad3: I wasn't saying that it should have??? just interesting to me, as it works in one of my apps (and now I am unsure why)
[15:07:24] mikecmpbll: just trying to upgrade to rails 4 and can't get this query working: https://gist.github.com/mikecmpbll/66c342833b1c44989cea
[15:07:39] mikecmpbll: doesn't seem to do the joins on the association.
[15:08:00] workmad3: tpayne84: oh, on a rails 3.2 app with the asset pipeline, that becomes a relative path within the file
[15:08:09] workmad3: tpayne84: so it resolves to '/assets/whatever.png'
[15:08:24] workmad3: tpayne84: and the rails 3.2 asset pipeline would generate assets without digests and with digests
[15:08:41] workmad3: tpayne84: on 4.0 though, they fixed that really crappy behaviour :)
[15:11:17] tpayne84: workmad3: so in v4 the simple url('link.png') syntax works ??? but it did not in 3.2 ??? good info to know, I have only been diving in rails for around 2 months
[15:11:17] tpayne84: workmad3: I have no v3 experience for reference
[15:11:30] workmad3: tpayne84: other way around ;)
[15:11:54] workmad3: tpayne84: it would also work in development
[15:12:29] tpayne84: workmad3: bah, well I am confused again then??? My app is rails 4??? and I am using the url() syntax but it is displaying the background image
[15:13:35] mikecmpbll: can you specify a joins condition on an association?
[15:14:49] jlebrech: can you give a simple_form a custom id?
[15:15:53] momomomomo: Ah, got the damned query to work - but not by following what was recommended on FB docs - http://stackoverflow.com/questions/17755753/how-to-get-likes-count-when-searching-facebook-graph-api-with-search-xxx
[15:16:11] sevenseacat: jlebrech: yes.
[15:16:22] sevenseacat: have you checked the simple_form docs
[15:16:51] tewlz: whats a good way to "comment out" files in vim with nerdtree. I.E. is there a way that I can change the filename quickly so that stylesheets aren't loaded, etc.
[15:17:48] silasdavis: tpayne84: workmad3 may be getting to the bottom of this, boostrap-sass image-url seems to be working when it wasn't shortly after the rails 4 release
[15:17:51] tewlz: i typically just underscore in front of the name, but in nerdtrees move file command it doesn't recognize normal vim movement keys so I have to left arrow all the way to the front
[15:18:16] silasdavis: I just fixed my awesome-font icons my @import'ing it in my scss overrides rather than requiring it in the top of application.scss
[15:20:09] OhGodWhy: guys what are your thoughts on this
[15:20:17] OhGodWhy: i have an s3 file
[15:20:30] OhGodWhy: i can either use a redirect to send people there or I can use send_data
[15:21:09] OhGodWhy: the redirect shows the URl(which i don't want) and the send_data takes a lot of time since it first has to download from s3
[15:21:30] silasdavis: OhGodWhy: why do you want to hide the URL?
[15:21:39] OhGodWhy: that's our USP
[15:22:51] silasdavis: do you want to hide the URL per se or the content at that url?
[15:23:05] silasdavis: if the latter
[15:23:08] silasdavis: you could use a pre-signed url
[15:23:09] silasdavis: http://s3.amazonaws.com/doc/s3-developer-guide/RESTAuthentication.html
[15:24:36] tpayne84: I have asked a couple times, but maybe someone new is active in the room: how can I update a nested resource's property via a link? I am able to link to the controller and action, just can't figure out how to pass the value i want to update in the params
[15:26:25] tubbo: OhGodWhy: you know you can CNAME buckets right?
[15:26:58] tubbo: OhGodWhy: http://files.waxpoeticrecords.com/assets/application-07cc4c974eb706f7cdc9a894541af4fb.js is an S3 bucket.
[15:27:01] tubbo: is on an*
[15:27:39] silasdavis: tubbo: that doesn't help if you want to authenticate access to application.js
[15:28:06] OhGodWhy: i still don't want that
[15:28:08] tubbo: silasdavis: agreed, but there's no real solution to that problem other than using IAM on amazon's side.
[15:28:26] silasdavis: tubbo: there's the link I posted
[15:28:27] tubbo: basically you give per-user access control with expiration on S3
[15:28:30] OhGodWhy: i don't want anyone to have access to the raw
[15:28:42] tubbo: silasdavis: haha ya that's what i was getting at...you put it more eloquently than me ;)
[15:30:40] silasdavis: OhGodWhy: then use an expiring pre-signed url - it has no re-share value because it's ephemeral
[15:33:04] silasdavis: tpayne84: when you say update a resources property could you expand on what you mean
[15:35:19] tpayne84: my 'Square' model has :id, :value, :name, and :game_id properties ??? from the show action of game i am displaying a table with each square of the game. I would like to click on a link to the square and update the string :value => "X"
[15:35:35] tpayne84: silasdavis: forgot to tag you in previous msg
[15:37:25] tubbo: tpayne84: you could perhaps make the link submit a form..
[15:37:30] tubbo: or a button instead
[15:37:30] tpayne84: silasdavis: I am able to do this with a form_for([@game, @board_squares[i]]) and a hidden field ??? but I would like to know if it can be done with a link only
[15:37:59] tpayne84: tubbo: you sir are correct, thats my work around.
[15:38:02] tubbo: forms are how you pass data with the browser, so you basically just hide the form and make it look like just a link. people do this all the time...ever see a random <button> with no visible form around it?
[15:38:34] tubbo: there's most likely a <form> wrapping it so the button can be clicked (even when JS is disabled) and an action can be performed.
[15:38:41] tubbo: s/can be performed/will be performed
[15:38:47] tpayne84: tubbo: for what I am trying to accomplish, would that be a best practice for how to achieve it?
[15:39:40] tubbo: tpayne84: absolutely. certainly the *easiest* way to go about it. if you wish, you can look into how to pass JSON around asynchronously
[15:40:11] tubbo: that's a little more complicated and error-prone but it also lets you do more with the UI
[15:40:22] tpayne84: tubbo: thats how I will implement it then, thanks
[15:40:57] tpayne84: tubbo: I was trying to build a nested json api to do this with ajax yesterday??? but I am not familiar enough with rails yet, so I am just using a reidrect_to
[15:48:13] jgadbois: /msg nickserv help
[15:48:44] tannerj: Good Morning! I'm trying to setup a rails production environment with ruby 2.0.0-p247 and rails 4 on RHEL6. I have yet been able to get things up and running without installing the "Development Tools" in centos. I'd really like avoiding installing a compiler on a production box because that just seesm wrong. Currently I'm looking at creating an rpm for ruby which has worked, but when I
[15:48:44] tannerj: then attempt to gem install rails, everything fails unless I install a compiler. Has anyone had any experience with this? Thanks for any help!
[15:53:24] tubbo: tpayne84: it's not too hard once you get the hang of it. the request should be `PUT /your_model/some_id` with the payload { "your_model": { "attribute": "overridden_value", "nested_attributes": [ { "id": 1, "name": "whatever" }, { "id": 2, "name": "delete me", "_destroy": true }] }
[15:53:31] tubbo: just gotta get the syntax down
[15:55:49] omarqureshi: tannerj: you could try using https://github.com/hansode/ruby-2.0.0-rpm/blob/master/ruby200.spec to get you an RPM
[15:56:15] Syrit: guys, in my app, i have custom controller action , and i am using ajax call on dropdown list change to list some checkboxes, now, the checkboxes are checked in they are assigned, but if i change them by jQuery, and re-list them again, i loose there original checked values, here is a gist https://gist.github.com/anonymous/1ab29e9f112aae93b457 , what can i do to prevent loosing the values?
[15:56:22] omarqureshi: you'd have to maintain it yourself and set up your own yum repo to do so
[15:57:04] omarqureshi: i dont have much redhat experience though - just enough to get by
[15:58:27] tubbo: tannerj: first of all, don't download ruby with a package manager.
[15:58:38] tubbo: tannerj: second of all, don't be afraid of installing a compiler. if you're using unix you already have one. gcc.
[15:58:42] tubbo: s/unix/linux
[15:59:05] tubbo: tannerj: you *need* a compiler to compile your gems' C extensions. if you use Nokogiri you need a C compiler, period.
[15:59:15] helpa: Awesome hat, crappy linux.
[15:59:17] helpa: Fedora's ulgy step-sister.
[15:59:21] tubbo: ahahaha awesome
[15:59:57] tubbo: tannerj: sorry, i don't know of any guides :)
[16:00:05] omarqureshi: packaged ruby is fine, if you know what you are doing
[16:00:12] omarqureshi: that is a very big if though.
[16:00:34] breakingthings: I think helpa is a neckbeard.
[16:00:46] workmad3: breakingthings: fedoras *are* awesome
[16:01:28] workmad3: tubbo: gcc doesn't come automatically installed in many distro setups ;)
[16:01:40] tubbo: i did not know this
[16:01:53] omarqureshi: debian and centos dont
[16:01:57] workmad3: tubbo: that was tannerj's point... he doesn't want to install the development tools that pull in gcc
[16:01:59] omarqureshi: debian doesnt even come with sudo
[16:02:00] tubbo: i guess i just use good distros ;)
[16:02:18] omarqureshi: s/good/non-stable/
[16:02:20] tubbo: heh, in any case tannerj...you're gonna need 'em
[16:02:24] tubbo: unfortunately
[16:02:26] tubbo: for compiling gems
[16:02:28] workmad3: tannerj: what you could do is have a packaging box that creates an rpm
[16:02:55] omarqureshi: the problem with making the RPM, is that you're going to have to make the RPM every few months
[16:03:04] workmad3: tannerj: and in that rpm creation, you run a 'bundle install' that builds your gems
[16:03:30] workmad3: omarqureshi: ideally, the packaging will be built into an automated build pipeline
[16:03:36] Syrit: guys, in my app, i have custom controller action , and i am using ajax call on dropdown list change to list some checkboxes, now, the checkboxes are checked in they are assigned, but if i change them by jQuery, and re-list them again, i loose there original checked values, here is a gist https://gist.github.com/anonymous/1ab29e9f112aae93b457 , what can i do to prevent loosing the values?
[16:03:37] tannerj: ok, sorry I had to step away for a second.
[16:03:43] workmad3: omarqureshi: and then it can be run every few minutes or hours ;)
[16:03:49] omarqureshi: thats one way
[16:04:13] omarqureshi: there was a gem that created your entire rails app as a debian package
[16:04:26] tannerj: so can I create an rpm for each gem I need?
[16:04:26] workmad3: yeah, pkgr wasn't it?
[16:04:37] omarqureshi: in theory, good idea
[16:04:41] omarqureshi: in practice - fucking painful
[16:04:41] workmad3: tannerj: you could... it would be more sensible to just make an RPM for your entire app though
[16:04:59] workmad3: tannerj: and bundle all your gems into that RPM
[16:04:59] tannerj: right. I think that makes a lot of sense
[16:05:41] tannerj: I'm really new to ruby/rails and only have about a year experience with linux...starting to feel like I'm running down a rabbit hole.
[16:06:00] workmad3: tannerj: it would be much easier to just install dev tools on your prod box ;)
[16:06:23] omarqureshi: get some pain under your belt
[16:06:33] omarqureshi: revisit this when you've experienced it
[16:07:07] tannerj: omarquereshi: I've done it that way, rvm, I'm just trying to find a better way.
[16:07:16] omarqureshi: alternatively, hire a sysadmin to do it for you
[16:07:40] omarqureshi: if you have a few weeks to kill, then maybe its worth looking at
[16:07:44] tannerj: LOL, I'm the sysadmin, developer, and designer...unfortunately that isn't an option
[16:07:44] omarqureshi: though honestly - i wouldnt.;
[16:08:39] tannerj: omarqureshi: Yea, I do have time but I wanted to get a feel for how people are doing this in production. Thanks, I've got to go. Take care everyone and thanks for the advise!
[16:18:08] justanotherjason: how can i rewrite this..
[16:18:10] justanotherjason: things.each { |thing| @id = thing["id"] if thing["name"] }
[16:18:13] justanotherjason: to something like this..
[16:18:35] justanotherjason: @id = things.each { |thing| thing["id"] if thing["name"] }
[16:18:57] tubbo: justanotherjason: @id = things.select { |thing| thing['name'] }.reduce(0) { |id, thing| id = thing['id'] }.first
[16:18:58] justanotherjason: i would think it would return thing["id"] and assign it to @id but it doesnt
[16:19:10] tubbo: justanotherjason: each() returns an iterator. you want reduce()
[16:19:20] justanotherjason: awesome, thank you
[16:20:11] TeckniX: anyone uses activeadmin ?
[16:21:14] helpa: TeckniX: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[16:21:14] tubbo: TeckniX: !used
[16:21:33] TeckniX: tubbo: yup - was more fishing for people alive. lol
[16:22:05] tubbo: TeckniX: there are 111 issues and 13 PRs on gregbell/activeadmin. i think someone out there uses it ;)
[16:22:14] tubbo: active_admin* that is
[16:22:29] workmad3: tubbo: oh, people use it
[16:22:30] tubbo: TeckniX: anyway if you're asking does it work with rails 4 the answer is NO. :( i was very upset.
[16:22:40] workmad3: tubbo: just not the sort of people who answer questions in here..
[16:22:50] tubbo: stopped using AA altogether actually...got me to learn more about ember.js :)
[16:22:57] omarqureshi: i unfortunately do use it
[16:23:07] omarqureshi: do not use it
[16:23:09] tubbo: i don't mind it honestly
[16:23:18] tubbo: i use it on personal projects where the admin panel doesn't matter
[16:23:21] tubbo: like, it's just for me basically.
[16:23:37] omarqureshi: its fine as an admin interface
[16:23:42] tubbo: but i'd never ship something with AA in it meant for people to use
[16:23:44] omarqureshi: its just very intrustive.
[16:23:51] tubbo: yeah, it can be
[16:23:57] krz: tubbo: you prefer ember or angular?
[16:24:04] tubbo: i hate it when AA throws errors and breaks the rest of the app :(
[16:24:09] tubbo: krz: ember all the way.
[16:24:19] tubbo: krz: http://www.emberscript.com http://www.emblemjs.com
[16:25:07] TeckniX: I'm trying to understand how I can create Admin related methods, while keeping the front-end different?
[16:25:46] breakingthings: Is it possible to have a relation from A to C thru B, where A belongs_to B?
[16:25:51] TeckniX: from a quick glance at the user model that's created, it seems I need to create a new model for say product, and call it AdminProduct ?
[16:27:40] nettoweb: guys, I have a column (int4) in my db with a value of '1', but when I try to print this value in my view, I always get the '0' value.
[16:29:26] tubbo: breakingthings: has_one through?
[16:29:43] breakingthings: tubbo: That's what I'm looking at but I don't quite follow the docs so I was trying to get confirmation
[16:29:53] tubbo: TeckniX: no, the objects are in app/admin but they're called "dashboards".
[16:30:00] tubbo: TeckniX: those objects just dictate to AA how to set up your view.
[16:30:01] breakingthings: C has_many B, B has_many A
[16:30:18] tubbo: breakingthings: ah yeah, just do a has_many through
[16:30:22] tubbo: C has_many B through A
[16:30:27] tubbo: err C has_many A through B actually
[16:30:48] glaksmono: anyone have idea why when i'm printing a variable, that's suppose to be multidimentional array it becomes like this? https://gist.github.com/glaksmono/b759dc45950dcc3e4ab4
[16:30:52] breakingthings: Oh, and that's what the read-only section is talking about, right?
[16:30:52] glaksmono: i'm using "puts"
[16:31:02] breakingthings: (I'm okay with it being read-only)
[16:31:06] glaksmono: i can't set the index :(
[16:31:27] TeckniX: tubbo: well I'd like to prevent /admin/products/edit/1 and /products/edit/1 to both work/be accessible
[16:32:09] tubbo: TeckniX: when i make apps with AA, i don't code in any actions that allow the front-end to modify things. so if i have /admin/products, i probably won't have create, update, destroy, edit or new actions on ProductsController.
[16:32:26] TeckniX: so where do you put the,?
[16:32:32] TeckniX: (s/the,/them/) correction: so where do you put them?
[16:32:45] tubbo: TeckniX: active_admin handles CRUD for you, so you don't need that code. hence why active_admin is useful.
[16:32:47] omarqureshi: :only => [:show, :index]
[16:33:13] omarqureshi: https://www.youtube.com/watch?v=_7HkG6OSo3E
[16:33:27] omarqureshi: HIGHWAY TO THE DANGER ZONE!
[16:33:47] TeckniX: but your listing of existing items should be an index call, shouldn't?
[16:34:14] TeckniX: or do you pull the same data, but filter it out via the dashboard rules?
[16:34:28] omarqureshi: you have admin/products to handle admin shit
[16:34:33] omarqureshi: and products to handle front-end shit
[16:34:48] TeckniX: archer is the best
[16:35:00] omarqureshi: you DONT have edit, update or destroy actions on the products controller
[16:35:01] rhizome: you don't want those actions? don't implement them.
[16:35:17] omarqureshi: you tell the router to restrict to only show+index
[16:35:21] TeckniX: ok I'm starting to see the light
[16:35:36] TeckniX: coming from the php side of mvc and it's done quite a bit differently
[16:35:44] TeckniX: I appreciate the explanations
[16:36:14] comjf: how would I determine if db:create has been run from a rake task
[16:36:41] omarqureshi: try connecting to the database.
[16:36:47] comjf: if the db already exists, I don't want to db:load_schema
[16:37:27] comjf: is there a simple rake task I can do to connect
[16:37:46] rhizome: db:version will probably be zero/nil/error if the db doesn't exist
[16:37:52] omarqureshi: youd have to look at existing rake tasks
[16:37:58] comjf: I'll try it out, thanks
[16:38:06] omarqureshi: fwiw, rake db:create has a message that appears if the db already exists
[16:38:10] omarqureshi: see how that works.
[16:40:56] foucist: anyone ever tried to do a content-locker type of thing in rails/js ? basically grey out entire screen except for one div, and prevent clicks except within that div
[16:41:13] someish: I have the following code which creates a temporary table and loads some data into it. The temporary file contains the correct data, and the temporary table is created; however anytime I try to query the table I get an empty array returned. Why might this be? https://gist.github.com/saturday/0851467cf0e657bbd48d
[16:47:37] interactionjaxsn: someish: where are you trying to query the table? your call to connection.execute("SELECT * FROM xml_results_temp") never gets stored into a variable or returned and your method ensures that the table is dropped. in this method you are getting the results of file.unlink?
[16:48:27] someish: interactionjaxsn: I attempt to query the table in the debugger
[16:49:43] interactionjaxsn: someish: is that the intent or are you doing that as a stop gap while you develop?
[16:50:03] someish: interactionjaxsn: it's just a stop gap for now.
[16:52:44] terrellt: foucist: No, but it seems pretty straight forward. Just a modified lightbox.
[16:53:49] interactionjaxsn: someish: how big do the files get and how long do you intend to keep the temp table around? i ask because storing this in some other fashion may be better.
[16:55:03] someish: interactionjaxsn: the files won't get too big. generally we're looking at the size of a typical questionnaire. the way i'm doing it here is purposeful.
[16:55:12] gcds: how to add migrations to rails from the gem?
[16:55:14] interactionjaxsn: someish: also, method definitions are implicitly also exception blocks, so instead of writing begin ensure end you can just write ensure
[16:55:17] gcds: use generators?
[16:57:56] someish: interactionjaxsn: I made the flow change. In any case I'm using connection.select for the select statement instead of connection.execute and I'm getting the empty array.
[16:58:17] arastu: is debugger incompatible with ruby 2.0 ?
[16:58:37] rhizome: "debugger?"
[16:58:39] arastu: what about pry ? is pry compatible with ruby 2.0 ? I heard somewhere that there are some issues
[16:58:39] interactionjaxsn: gcds: the generators create files for you... rails g model user email:string creates a migration file in db/migrate/migration_file_name.rb and your model. app/models/user. you could create those by hand if you so desired
[16:58:48] rhizome: arastu: where?
[16:59:20] Lion__: ACTION roars!
[16:59:40] gcds: interactionjaxsn: Nope I mean I want to add migrations to current rails project then adding this gem
[16:59:53] arastu: rhizome, http://stackoverflow.com/questions/16697970/is-there-a-pry-debug-setup-that-works-with-ruby-2-0
[17:00:28] arastu: rhizome, https://coderwall.com/p/cmlxzw
[17:00:45] interactionjaxsn: gcds: rails generate migration will work for you but i am lost as to what you mean by 'this' gem
[17:01:24] gcds: interactionjaxsn: I am making a gem which needs table inside rails db
[17:01:40] gcds: imaginationcoder: how to create that table without adding manually
[17:02:11] arastu: rhizome, debugger ----- https://github.com/cldwalker/debugger
[17:02:12] interactionjaxsn: someish: any reason you can't just create the temp table as a proper table and just truncate the table before you start processing your xml?
[17:02:31] dangerousdave: I sign into my app, then sign out, then sign in incorrectly and devise gives me the following: "Signed out successfully." and "Invalid email or password." I understand why this is happening i think, due to renders. Not sure how to fix it though.
[17:02:47] rhizome: arastu: what version of pry are you using?
[17:04:21] dobry-den: Does anyone know the name of one of those minimal WYSIWYG Markdown editor toolbars for a textarea?
[17:04:31] someish: interactionjaxsn: that's a great idea; however the reason I need to use a temporary table is because there will be multiple requests like this at any given time.
[17:05:13] dobry-den: one pops up on HN every month, and every time i go "Surely i'll remember this when I need it"
[17:05:50] AntelopeSalad: dobry-den: i'm having great success with https://code.google.com/p/pagedown/wiki/PageDown
[17:07:07] rhizome: coderwall: if you didn't think SO had enough whitespace!
[17:09:14] mike: so i have a rails-powered AJAX app - the problem i'm experiencing is that a response type of application/json (apparently if it's unexpected) will cause IE8 to popup a download dialog for the response
[17:09:27] mike9292: i was wondering if anyone's experienced this
[17:09:40] mike9292: or can give me a quick hack to detect IE and override application/json to text/plain
[17:19:21] rhizome: mike9292: lmgtfy
[17:20:54] someish: interactionjaxsn: when I use connection.exec_query instead I get the following result, but there are no rows, so the table exists with the proper columns, but it doesn't appear that LOAD XML is doing anything, https://gist.github.com/saturday/bd59edaf62f9f66e34d6
[17:20:56] mike9292: i did google it
[17:21:40] mike9292: is it ok to use text/x-json instead of application/json?
[17:24:12] rhizome: https://www.google.com/search?q=ie8+json+download
[17:25:16] mike9292: i know thats what i've been looking at
[17:25:21] mike9292: my question's how to handle it in rails
[17:25:56] rhizome: what does "it" mean there?
[17:26:41] mike9292: handle overriding the mime type for json requests depending on the user-agent
[17:29:52] terrellt: mike9292: I assume this is something you can do from the javascript side of things.
[17:30:13] mike9292: both solutions seem pretty awful at this point
[17:31:20] terrellt: mike9292: If you have to do it in rails, in your JSON response block just set :content_type => 'text/plain'
[17:33:11] mike9292: is IE ever going to die, its like that line in hotel california where they "just can't kill the beast"
[17:37:51] rhizome: what you do is charge 50% more money or double your longest time estimate
[17:38:44] terrellt: I'll develop for old IE versions all you want. Your money.
[17:45:24] tannerj: Good Morning, sorry for repeating myself, I had to leave abruptly about an hour ago so I'm going to repost my question: I'm deploying ruby 2.0.0-p247 with rails 4.0 to a RHEL6 server and I'm concerned about groupinstalling 'Development Tools' on a production server in order to get the stack installed. I've built an rpm for ruby 2.0.0-p247 to be deployed to the production box but I still
[17:45:24] tannerj: need the developer tools to gem install rails. The consenus was that going the rpm route is needlessly complicated and not worth the effort. I'm still not real happy about putting a compiler on a production server. It just seems wrong. How are you guys handling this, anyone doing automated deployment to multiple servers? Thanks for any help!
[17:47:44] elfenars: "I'm still not real happy about putting a compiler on a production server. It just seems wrong."
[17:47:57] elfenars: because "it just seems wrong" really isn't an argument
[17:48:27] terrellt: ...You're concerned that somebody's going to compile something on your box?
[17:48:43] elfenars: what's going to be insecure?
[17:48:50] terrellt: I assume if somebody's in a position to compile something they're in a position to install a compiler.
[17:49:00] remi: I'm wondering if it???s possible to differentiate two association instances ??? one that was eager loaded and one that wasn't. example: https://gist.github.com/remiprev/3dbe87971e0841e2930f
[17:49:08] nigerianceo: Anyone ever done lazy user registration/soft sign-up with Sorcery ?
[17:49:19] nigerianceo: I'm about half way through implementation and fairly stuck
[17:49:21] terrellt: tannerj: The short answer is we all install compilers on our production servers.
[17:49:23] elfenars: tannerj: maybe you should ask around #ruby channel
[17:49:46] elfenars: because as terrellt said, installing compilers in prod servers is a VERY common practice
[17:49:52] _HolyCow: You could solve all security issues if you cut the ethernet.
[17:49:53] tannerj: elfenars: I hear ya. my fears started a while back while reading some posts on stackoverflow.
[17:50:08] chrisan: couldnt he compile in a VM that matches his production server and deploy the whole package?
[17:50:13] webdestroya: heroku has a compiler on all of its dynos... so far there arent any problems there
[17:50:24] elfenars: you can try docker, or vagrant or some other kind or virtualization
[17:50:31] webdestroya: i cant fathom how a compiler would be a security risk any more than a text editor would
[17:50:37] elfenars: if you dont wanna touch the host OS
[17:51:46] tannerj: elfenars: I've got ruby into an rpm, it's rails that I still need te compiler for.
[17:52:06] tannerj: elfenars: I get what your saying and I don't have a good argument.
[17:52:12] bastilian: tannerj: rails has c-extensions? that's new...
[17:52:37] elfenars: tannerj: either way, try a VM inside your prod server
[17:52:47] elfenars: cause honestly, you'll need a compiler at some point
[17:53:09] mva3212: proquestion: qwery or sizzle.js?
[17:53:43] tannerj: elfenars: I'm not sure I follow. Right now I'm working for a University and I've been given a VM with RHEL, you'd install another vm inside the vm?
[17:53:53] bastilian: using a VM is just the same issue in a VM... compilers are not a security issue. being able as a user to use them on your machine is.
[17:54:11] chrisan: tannerj: what about http://serverascode.com/ruby/2012/01/17/Deploying-ruby-on-rails-applications-via-rpm-packaging.html
[17:54:24] elfenars: tannerj: look??? you'll need a compiler on your prod server sooner or later
[17:54:31] elfenars: either for 3er dependencies
[17:54:35] elfenars: or core dependencies
[17:54:40] elfenars: or even OS dependencies
[17:54:47] elfenars: so avoiding that might be possible
[17:54:54] elfenars: but it will just give you headaches
[17:55:31] elfenars: if you want a fully stable stack (that's going to be VERY rigid btw), you can use tools like docker or similar
[17:55:55] tannerj: elfenars: right, I think the question is at what point is it worth it. The other point I read on this is if rubygems.org goes down and I'm trying to update, I'm at their mercy.
[17:56:13] elfenars: tannerj: but if you even get the sensation you will be changing even something little like system libraries for other gems or w/e??? compiler is your friend
[17:57:02] tannerj: Oh, I'm all for compiling, just not on production box. I've got a ton of development VM's I use.
[17:57:05] elfenars: not so much, if your gem bundle is *sort* of stable
[17:57:15] elfenars: you can mount your own bundle server
[17:57:22] elfenars: or even bundle the gems within the app
[17:57:25] tannerj: I think I'd like to be able to do all the compiling on a development box, rap it in an rpm and send it to the production box.
[17:57:40] chrisan: tannerj: see link i posted above for that
[17:57:42] mike9292: Radar: you're everywhere man, one day i mention you to my friend, and then 20 seconds ago i look up and realize im looking at your page
[17:58:04] tannerj: chrisan: will do.
[17:58:29] nigerianceo: Anyone ever done lazy user registration/soft sign-up with Sorcery ?
[17:58:33] elfenars: ugh apache D:
[17:58:38] mike9292: elfenars: nginx
[17:58:58] bastilian: tannerj: you will need a compiler. many gems rails uses have c-extensions. therefore need a compiler. or are you planning on packing them up too?
[17:59:12] tannerj: chrisan: I missed your first post. That is exactly what I'm trying to do. I've got a centos dev box that I'd like to compile everything I need on and bounce to production
[17:59:33] tannerj: bastilian: I'd like to package them up.
[18:00:00] bastilian: tannerj: https://github.com/jruby/warbler you could use jruby.
[18:00:03] tannerj: But I'll admit I'm new to rails and haven't done any of this in practice. It just seems like the most robust solution. Maybe not worth it
[18:00:29] bastilian: but be aware jruby does not support c-extensions.
[18:00:40] tannerj: bastilian: That is one of the next avenues I'm going to try. I just wanted to get a feel for what everyone else does to solve this.
[18:00:50] FooBarWidget: or you can just run 'bundle install', then uninstall the compiler, then package up the entire filesystem as a container, and deploy that
[18:00:58] FooBarWidget: no jruby needed
[18:01:47] bastilian: tannerj: i don't know anyone who compiles locally, or uses war files to deploy. compilers on production are common.
[18:02:33] pduersteler: is there a rails4 equivalent to reset_column_information? I need to use the column i added in a migration directly after adding it...
[18:03:49] tannerj: bastilian: And maybe I just need to come to terms with that. I read something a few days ago on hacker news about this and basically it desended into The problems that are avoided by compiling locally and deploying to a production server are so miniscule, that its not worth it.
[18:05:02] tannerj: The big plus to it is you control the dependencies and don't have to be concerned with other network's failures. I.E. github, ruby-lang.org, rubygems.
[18:05:13] FooBarWidget: tannerj: which article did you read?
[18:05:14] |PiP|: using the asset pipeline, how do i deliver different sets of JS/CSS files (depending on the user, for example)
[18:05:17] bastilian: tannerj: i would love to read that.
[18:05:42] bastilian: tannerj: ahm.... where do you get your dependecies locally?
[18:06:04] fbernier: Do people really calculate taxes for every countries all by themselves ?
[18:06:07] terrellt: tannerj: What university?
[18:06:13] tannerj: I don't remember, and this all came out of the comments, not so much the article. Unfortunatly I can't save articles on hacker news right now.
[18:06:18] fbernier: or theres some sort of magic solution I'm missing
[18:06:33] tannerj: terrellt: East Carolina
[18:06:42] bastilian: tannerj: if deployment fails when one service you require is down. you deployement process is failure.
[18:06:55] terrellt: tannerj: Ah. Well, Oregon State puts compilers on its systems, just copy us - we're pretty cool.
[18:07:11] tannerj: terrellt: lol.
[18:07:58] tannerj: bastilian: I understand, I have to confess I'm in a research phase right now and I've never done any of this in practice.
[18:08:27] tannerj: Right now the site I admin is in php and I'm trying to port it. And I need to have my ducks in a row before I push it live.
[18:08:43] tubbo: tannerj: i'm currently writing an upgrade script for our machines, which sometimes need to be upgraded offline (the box is not connected to the internet at all)
[18:08:59] tubbo: we prepare a USB HD and give it to the client, then they plug it in and the machine upgrades itself
[18:09:32] chrisan: if your VM and production server were exactly the same, what would be the need for a compiler? Your code repo would be huge but everything else should just work, no?
[18:09:45] bastilian: tannerj: if you follow the rails security guide, setup up your firewall correctly, you are safe.
[18:09:46] tubbo: the HD consists of the latest code and an apache server to run the rubygems server, which is used to install gems onto the machine
[18:09:57] terrellt: File permissions are important too. ;)
[18:10:05] hadees: i'm having a problem with my form, i'm passing in [:admin, @batch] for the route /admin/:shop_id/batches/:id/edit it works fine with new but for editing an existing one it doesn't get the shop_id right here is the code and the error http://pastebin.com/HAvAtL3t
[18:10:11] terrellt: tubbo: Hah, that's cool.
[18:10:12] tubbo: chrisan: when you want to upgrade a rubygem and it needs c extensions.
[18:10:21] tubbo: terrellt: it's pretty bleh :P
[18:10:30] bricker: "Repushing of gem versions is not allowed. Please use `gem yank` to remove bad gem releases." I did that already. Do I have to wait or something?
[18:10:31] chrisan: tubbo: wouldnt you upgrade that rubygem locally to verify it works before compiling in production?
[18:10:46] hadees: :( i'm on a flight and couldn't get the other paste bins to work
[18:10:52] hadees: stupid southwest
[18:10:52] tubbo: chrisan: yeah, but if your VM and prod box are exactly the same, surely one of them needs a compiler, thus they both have a compiler.
[18:11:12] tubbo: chrisan: you could just make the VM locally and push the whole image up to a hypervisor
[18:11:27] chrisan: tubbo: touche :) lets assume for his argument compiler is only on the VM
[18:11:56] tannerj: Yea, starting to get over my head...
[18:12:05] tubbo: chrisan: i guess it wouldn't matter, but seems like a lot of work just to make this limitation. seems pointless actually.
[18:12:36] tubbo: like especially if no one is touching the shell of this box
[18:12:45] chrisan: tubbo: I agree, just asking for my own curiousity. I use a compiler in production myself (like the rest of the world)
[18:12:52] denom: Is there a way to get access to the orm scope chain within a named scope's block?
[18:13:05] tubbo: denom: scope chain?
[18:13:19] denom: Model.active.foo.bar
[18:13:31] tubbo: oh, like what scopes are being used right now?
[18:13:33] nigerianceo: https://gist.github.com/coolmatt/57fb3c8700a262f40b30
[18:13:35] tonz: howdy everyone
[18:13:38] nigerianceo: Feedback me !
[18:13:39] tannerj: chrisan: And I think that's what I needed to hear. If it's not a big deal, I won't worry about it
[18:13:44] tubbo: nah i don't think so. scopes are just methods that tack on partial queries to an AR::Relation
[18:13:45] denom: yeah something like that
[18:14:02] tubbo: so AR::Relation doesn't know or care which scopes were used to compose its query
[18:14:10] tannerj: I had just read more than once that a production server shouldn't contain build tools.
[18:14:31] tubbo: nigerianceo: i will but first can you give me your bank account and routing number? i just need to transfer you some money.
[18:14:31] tonz: cart.line_items.group(:product_id).sum(:quantity) I am tyring to figure out what.group and .sum are doing in this line of code
[18:14:43] nigerianceo: Yes of course!
[18:14:53] denom: Well I just need access that that AR relation maybe, I need the ordering underwhich the current scope is running
[18:14:55] nigerianceo: Do you accept travellers cheques
[18:15:25] tubbo: nigerianceo: only wire transfers
[18:15:39] nigerianceo: Don't patronize me, my friend
[18:15:44] chrisan: tannerj: you can create a deploy user (who updates code/runs compiler) and create a web user that apache/nginx uses to run the web app if you are worried about security. FooBarWidget did a talk about that http://www.livestream.com/pivotallabs/video?clipId=pla_419c1a8b-157a-4b10-9d1a-390645e91083
[18:16:06] tannerj: chrisan, bastilian: do you use capistrono, puppet, any other automated deploy tools?
[18:16:08] tubbo: nigerianceo: when does not_authenticated() get called?
[18:16:25] chrisan: if people are running compiler commands on your box you have other issues :)
[18:16:30] hadees: is there anyway to change url_for so that in my admin controllers it uses the id instead of to_param? i'm using friendly_id but in my admin panel I'd rather use ids
[18:16:36] tannerj: chrisan: lol, i hear ya.
[18:17:02] bastilian: tannerj: i use chef and capistrano depending on size of the project and server. or just simple git push.
[18:17:46] tubbo: nigerianceo: you might need to tack on an `and return` there to break you out of the loop.
[18:17:50] tannerj: bastilain: are you using RVM?
[18:18:01] bastilian: tannerj: yup.
[18:18:07] tubbo: and i usually store data in session[], not cookies[].
[18:18:10] bastilian: on dev and production.
[18:18:25] nigerianceo: tubbo, yeah i dont like storing in cookie
[18:18:47] tubbo: and as far as SecureRandom is concerned, it's just a "uuid" so i don't think it matters too much.
[18:19:28] tubbo: nigerianceo: if you want it to be a standard UUID, check out https://www.ruby-toolbox.com/search?q=uuid for libs on how to generate one.
[18:19:50] tubbo: though for your purposes, doesn't seem to be any inter-application communication so a true UUID probably isn't necessary
[18:19:53] epochwolf: tubbo: there's the uuid gem
[18:19:58] bennyzr: anybody know why assigns(:model) would contain a nil record as the last record of the collection?
[18:20:10] tannerj: bastilian: Are you using passenger, unicorn, or etc?
[18:20:17] nigerianceo: Thanks tubbo, figured using SecureRandom wasn't entirely...secure
[18:20:29] tubbo: nigerianceo: hah, it's more secure than Random though
[18:20:33] arastu: somebody please help me , who actually defines the attribute-methods of the model on the fly in activerecord ? I thought it was active_record/attribute_method's method_missing
[18:20:48] tubbo: it's the basis for all this other stuff but UUID is a standard
[18:20:49] bastilian: tannerj: passenger. unicorn on bigger setups.
[18:21:15] arastu: but even before i hit the method_missing, my model's attributes are defined
[18:21:32] tubbo: arastu: ohai
[18:21:39] FooBarWidget: bastilian: why reason why you would not be using passenger there?
[18:21:48] tubbo: arastu: you wouldn't happen to have a table with names like 'Name', 'Date', etc.? :)
[18:21:57] tubbo: arastu: told you it would be hard.
[18:22:49] |PiP|: why does carrierwave use the default tmp directory as in the app?
[18:22:59] tubbo: FooBarWidget: dolla dolla billz ;P
[18:23:02] |PiP|: why doesn't it use /tmp?
[18:23:18] bastilian: FooBarWidget: because on bigger setups i do not need a full blown webserver on an app-server. the webserver/load-balancer proxies to app serves assets directly.
[18:23:39] tubbo: passenger enterprise is an easier unicorn realistically.
[18:23:45] arastu: tubbo, i have tables , but if my model does not have a method on object level then ruby will call method_missing ? what else is getting called which defines those methogs ?
[18:23:58] FooBarWidget: bastilian: passenger standalone is a nice small app server
[18:24:11] bastilian: uses nginx. ;)
[18:24:34] FooBarWidget: yeah. internally. but it's still very small. uses less memory than unicorn actually
[18:25:09] tubbo: FooBarWidget: have you tried passenger on rbx 2.0 yet?
[18:25:26] FooBarWidget: tubbo: not on 2.0 specifically. it is compatible with rubinius 1.x
[18:25:28] tubbo: arastu: i have no idea.
[18:25:32] FooBarWidget: as well as jruby
[18:25:52] FooBarWidget: I've been wondering whether there would be any demand for an even more stripped down version of passenger standalone that is meant for pure reverse proxying
[18:26:11] tubbo: FooBarWidget: what do you mean? "pure reverse proxying"? so basically i'd need my own app server?
[18:26:45] FooBarWidget: I mean for environments in which the load balancer/reverse proxy forwards requests to passenger
[18:26:52] tubbo: ah, right
[18:26:59] FooBarWidget: it is true that passenger standalone has an nginx layer
[18:27:04] FooBarWidget: but it uses like??? 2 MB of memory
[18:27:20] FooBarWidget: I'm not sure whether it's worth removing that
[18:27:21] terrellt: 2 MB of memory?! Who do you think I am, scrooge mcduck?
[18:27:23] bobbobbins: hello, here is my ugly routes file: https://gist.github.com/bobbobbins/19fd13a932fe5e5d4c14 I'm having an issue with lines 62 & 63???when i do a get call to orders/confirm???its routing to orders/show???can someone tell me why?
[18:27:25] terrellt: Payin' for all that memory, shoot.
[18:28:04] FooBarWidget: I just get the feeling that if I introduce a mode in Standalone that doesn't have nginx, that passenger will become too complicated
[18:28:09] bastilian: FooBarWidget: passenger standalone is an option. i totally agree. it is just a matter of preference. i have never encountered issues with unicorn, therefore i would not switch.
[18:28:11] FooBarWidget: like passenger doesn't have enough modes and options already
[18:28:16] tubbo: FooBarWidget: i would be down with passenger standalone not using nginx at all.
[18:28:37] FooBarWidget: bastilian: fair enough :)
[18:28:41] tubbo: if that's the case then surely standlone doesn't need nginx
[18:28:46] tubbo: standalone*
[18:29:05] tubbo: i assumed it was just out of ease, b/c you already made the apache/nginx module so this just a binary that runs nginx with a default configuration.
[18:29:10] FooBarWidget: it depends on the use case. the nginx in standalone is useful if:
[18:29:23] FooBarWidget: - you want to expose standalone directly on the internet
[18:29:42] FooBarWidget: - the reverse proxy does not have access to the static assets, which may very well be the case for security reasons
[18:29:56] FooBarWidget: in both cases, the nginx in standalone is a useful feature
[18:30:32] FooBarWidget: but yes, it was originally written this way out of ease :)
[18:31:45] tubbo: FooBarWidget: i'd like to use passenger as my development webserver, since we use passenger in production. just always been a habit of mine to try to use the same server on both sides.
[18:33:24] s2013: how do i change this kind of time 2013-10-10 14:27:38 -0400 to show just the date and 2:27:38PM
[18:33:49] terrellt: Hrm, Travis doesn't seem to be building this new branch I pushed up.
[18:34:44] toretore: what is "this kind of time"?
[18:34:53] s2013: nevermind, got it.
[18:35:01] s2013: i gave a pretty good example
[18:43:51] tpayne84: I know this has to be simple, but how do I make an array of arrays for instance x = [ a[],b[],c[] ] ??? this is not working for me
[18:44:51] dpswireless: is there any downside to adding touch true on belongs_to relationship? any potential database locking or issues of too children objects updating simultaneously?
[18:46:38] terrellt: dpswireless: It's one more query each time you save the object is all. It doesn't update child objects - it updates the parent object.
[18:47:07] jcf: @tpayne84 something like `Array.new(3, [])` ?
[18:49:35] dpswireless: @terrellt yeah that was my question, when 15 children are updated the touch:true will try and update that item 15 times? any potential problems with that?
[18:50:24] tjbiddle: Hey guys - so I know how to scope a validation inside the same module; but what if I don't want the 'name' unique inside the module, scoped by another attribute, and then also unique when compared with another module (but no scope?)
[18:57:16] jamest3: hi i was wondering if anyone could tell me how to check if my rvm rubies are using readline or libedit?
[18:58:16] jamest3: sorry libedit or libreadline? i'm trying to get guard notifications to work
[19:01:54] luckyruby: Ugh, so frustrating having to swap out this Stripe api code with xml/soap bullshit
[19:02:34] toretore: somebody made too many assumptions
[19:03:49] tobobo: hi, does anybody know how to determine if cache_classes is operating? i have to restart my server every time i make a change even though config.cache_classes is set to true
[19:04:19] bastilian: tobobo: you have to set it to false.
[19:04:40] gcds: Hmm, how to implement module system on rails? Like some actions on front end and admin side settings ?
[19:04:42] tobobo: bastilian: sorry, that's what i meant. it's currently false.
[19:05:24] bastilian: tobobo: when you change things in models or controllers you have to restart?
[19:05:34] tobobo: bastilian: correct
[19:05:55] bastilian: tobobo: maybe checked if it is reenabled in environments/developemnt.rb?
[19:06:12] bastilian: tobobo: maybe check if you server actually starts in dev.
[19:06:29] rhizome: dpswireless: premature optimization
[19:08:57] dangerousdave: can someone help please? http://stackoverflow.com/questions/19303878/devise-and-handling-the-flash
[19:10:19] ecnalyr: I have a model that uses validates_inclusion_of and uses an array of words to check for validation. This works fine when I explicitly list words for the array. However, I want to clean this up by referencing a method within the same model that returns the list of words. How can I get this to work? I have a gist here where line 6 works as expected, but line 5 attempts to reference the method and I get a method m
[19:10:19] ecnalyr: issing error when it is called: https://gist.github.com/ecnalyr/67a71e11695598264acb
[19:11:14] s2013: i have this very odd problem. basically i want to display information for @followups. problem is that if @followups is empty i get exception errors.
[19:11:34] s2013: however, it never shows followups as empty cause its size is 1 even if there is no followups
[19:11:40] s2013: https://gist.github.com/ss2k/6017c2e254dd5264dbac
[19:11:51] s2013: im 99.999% sure its cause im instantiating a new followup in the form
[19:11:58] s2013: how do i get around it?
[19:13:20] dangerousdave: s2013: http://api.rubyonrails.org/classes/Object.html#method-i-try
[19:13:30] s2013: no i dont want to use try
[19:13:42] s2013: i dont want an entire section to show up if the array is empty
[19:13:56] toretore: more code s2013
[19:13:58] s2013: thing is that checking if its empty or not always returns false.
[19:14:18] toretore: theres something youre not telling us
[19:14:29] s2013: https://gist.github.com/ss2k/6017c2e254dd5264dbac
[19:14:42] s2013: what am i not telling you? i pretty much diagnosed the issue, just want to know how to get around it
[19:14:58] s2013: @followups.size returns 1 even though it is empty
[19:15:15] toretore: no it doesnt
[19:15:43] s2013: yes it does
[19:15:51] toretore: it has 1 item, the one you created
[19:16:00] toretore: use build not new
[19:16:19] rhizome: s2013: put all that in a partial and use render @followups. nothing will be printed if @followups is empty (though it has to exist)
[19:16:35] s2013: k one sec
[19:17:05] s2013: i took out the entire form and it still returns false for @followups.empty?
[19:17:12] s2013: i also changed new ot build
[19:17:13] Encore: what's the diference between a put and post request?
[19:17:19] s2013: put is for updating
[19:17:25] rhizome: remove that followups.empty? line, too
[19:17:25] s2013: put is technically a masked post request
[19:17:39] toretore: s2013: update gist with new code
[19:17:41] Encore: 2013, perfect, k thanks.
[19:18:24] toretore: add <%= @followups.inspect %>
[19:18:42] s2013: https://gist.github.com/ss2k/6017c2e254dd5264dbac
[19:18:52] s2013: toretore, i did. it shows the object i pasted earlier
[19:19:14] rhizome: killing me
[19:19:36] toretore: right, so there you have it then
[19:19:45] s2013: [#<SupportResponse id: nil, ticket_id: 15, staff_id: nil, response_text: nil, created_at: nil, updated_at: nil>]
[19:20:08] s2013: thats for .inspect
[19:20:29] s2013: i know why its doing that. i just want to know how to get around it.
[19:20:47] s2013: i guess the partial thing, if i move it to a different controller would work?
[19:20:51] s2013: but i doubt it
[19:20:57] toretore: use Followup.new
[19:21:04] s2013: toretore, it was .new
[19:21:09] s2013: you are the one that said to use .build
[19:21:13] s2013: its the same result either way
[19:21:28] s2013: <toretore> use build not new
[19:22:00] mvpgraff: good place to start learning ror? I'm a php developer, but I keep pushing my limits. I would search, but I would like to know where the pro's can send me
[19:22:07] tobobo: bastilian: i'm doing rails s -e development. i'm going to try moving cache_classes = false to the end of the config file to ensure it's not overwritten
[19:22:08] s2013: google hartl mvpgraff
[19:22:19] mvpgraff: muchas gracias
[19:22:34] dangerousdave: can anyone help me with this please? http://stackoverflow.com/questions/19303878/devise-and-handling-the-flash
[19:23:16] elfenars: dude have you tried flash.now ?
[19:23:32] elfenars: or cleaning up the flash var?
[19:23:44] dangerousdave: elfenars: nope, devise handles all that jazz
[19:24:01] elfenars: well of course it does, but some refactoring can help you too
[19:24:17] elfenars: i don't really know why that happens to you
[19:24:30] dangerousdave: overlod the devise controller?
[19:24:35] elfenars: but i think its a problem of your code
[19:24:55] dangerousdave: elfenars: wouldn't surprise me
[19:25:12] elfenars: maybe the way you're rendering the flash messages
[19:25:27] dangerousdave: shown in the link
[19:26:51] elfenars: mmm the ony thing i can tell you is that from what i'm seeing on the stackoverflow post
[19:26:56] elfenars: nothing seems wrong
[19:27:11] dangerousdave: perhaps the solution is to give my code the finger, crack open a beer, and watch the new die hard movie that's just arrived.
[19:27:27] njero: dangerousdave: good call
[19:27:37] elfenars: sounds good to me
[19:27:43] dangerousdave: settled then, cheerio all
[19:29:56] tubbo: update tyme
[19:32:58] tobobo: anyone ever experienced problems with cache_classes = false not working? as in, you have to restart your app whenever you make a change anyway?
[19:33:11] rhizome: heard you the first time
[19:36:18] liamat_: Hi everybody. I am interested in deploying my RoR project as one discrete package (via gem). How best do I do that?
[19:36:35] pipework: Your gemspec file, probably,
[19:39:03] juo: if I've extracted a has_and_belongs_to_many association into its own model, do i need to put validations on that model?
[19:39:30] juo: I have null: false on the database migrations
[19:44:27] tobobo: rhizome: thanks, helpful
[19:58:04] rbennacer: anybody here?
[19:59:28] bennyzr: where do I find the definition of the process method used here: ret = process(request.parameters[:action])
[20:00:08] bennyzr: in ActionController::Testing::process_with_new_base_test(request, response)
[20:04:46] |PiP|: File.open('some_file', 'w').write(huge_text) <---- why am i only get 4094 characters max?
[20:05:22] koopee: How do you use debugger with rspec tests?
[20:06:15] koopee: I'm using Netbeans IDE and it works quite well except I'm not able to use debugger with rspec tests
[20:08:02] dobry-den: 20 minutes of "debugging" down the drain because I could stare at "verticle" for 20 minutes and not see that it was misspelled
[20:12:42] RubyPanther: dobry-den: I once spent 8 hours looking for a bug that turned out to be a typo that wasn't caught because I didn't have Perl's strict mode turned on.
[20:14:02] jrobeson: dobry-den, only two minutes.. you're lucky
[20:14:18] jrobeson: i did that once with verticle also before :)
[20:14:48] nettoweb: hi guys, How I order this select: @user.services[1, 5].map(&:id) to get descrecent ids?
[20:15:15] nettoweb: I want to get always to old entrys
[20:15:19] tomorrow: never mind. hi.
[20:15:21] RubyPanther: nettoweb: comeon that is in the basic howto stuff, if you have to ask that one, just give up now
[20:15:40] RubyPanther: sorry to phrase it so bluntly.
[20:15:43] jrobeson: nettoweb, read the ruby methods available on the object that is the result of map
[20:16:37] tewlz: RubyPanther: let's be honest, you aren't sorry.
[20:16:57] tewlz: you're just rude.
[20:17:11] koopee: hey, I have not so basic question, I would like to debug rspec tests and I'm getting nowhere. I'm using Netbeans and all other debugging works nice.
[20:17:22] RubyPanther: tewlz: I was, I felt a little bad for not having held his hand and explained the importance of documentation
[20:18:02] parndt: RubyPanther: point to docs then
[20:18:23] tewlz: RubyPanther: I often feel bad two seconds after donig something and then make no attempt to correct my actions, too.......
[20:18:25] tomorrow: I need a help. Trying to do a preview for article. User clicks a button -> ajax goes to server and gets compiled partial. Question is how to pass parameters from not submited form in ajax request to server?
[20:18:43] RubyPanther: parndt: pointing to the docs is great when somebody can't find them, there was nothing there to indicate that was the case, and if somebody read the basic howtos it is right there
[20:18:53] RubyPanther: even a poorly executed search would find that doc
[20:18:53] parndt: point to the basic howtos
[20:19:13] tewlz: or say nothing.
[20:19:29] parndt: if you're not going to help, don't drive people away
[20:19:53] RubyPanther: tewlz: I disagree. The important thing here is to teach them to look it up.
[20:20:13] parndt: but you didn't
[20:20:17] RubyPanther: parndt: nor did you
[20:20:26] koopee: Perhaps this: http://stackoverflow.com/questions/742700/rails-active-record-findall-order-issue
[20:20:26] tewlz: RubyPanther: I agree, maybe next time you can teach them to look it up.
[20:20:29] nettoweb: I know the order attribute, but in this case, I'm get form one value to another, so I dont know where I must sort
[20:20:37] koopee: no api, but...
[20:20:50] RubyPanther: And yet, you're also commenting, and also in a negative way. Even in a way that could be construed as trying to drive somebody away (me)
[20:20:53] parndt: RubyPanther: jrobeson already suggested something useful
[20:21:18] parndt: you could get defensive about it or just take the criticism on board, it's up to you
[20:21:51] tomorrow: So... any ideas? Sure I can just manually pass params by js, but is there any good looking solution for that?
[20:21:58] RubyPanther: parndt: I actually think his comment is less helpful than telling somebody to RTFM. Looking at the methods on the object should be the next step, after having read the docs, or after you're already somewhat familiar with the API you're using.
[20:22:14] RubyPanther: For intermediate or advanced users, sure, you can start there.
[20:22:55] RubyPanther: If beginners start there they end up trying to use stuff without ever having seen how it is normally used
[20:23:25] tewlz: I don't really care what your opinions is. I just don't like people telling someone "to just give up now" as if that helps anyone.
[20:23:25] koopee: Could somebody point me to the API how to get rails debugging work on rspec tests?
[20:24:24] RubyPanther: tewlz: If you don't care what others opinions are, why should those exact others care about your own opinion? If you don't want to exchange ideas, why even talk to me? If he was just being lazy, then my comment wouldn't be discouraging at all.
[20:24:36] tomorrow: Ok. Thx for help. Looks like you have a serious discussion here. Nevermind then.
[20:24:49] parndt: tomorrow: we don't
[20:25:17] parndt: tomorrow: you should be able to send params with the AJAX request via JS?
[20:25:24] jstrong: serious discussions? where!
[20:25:27] tewlz: RubyPanther: I care what others opinons are. Just not yours. You've proven to be rude and I don't care to converse with you.
[20:25:29] RubyPanther: Presumably the normal response somebody would have to what I said wouldn't be to be discouraged at all, it would be to laugh and say, "yeah, I didn't rtfm before asking, you're right"
[20:25:47] parndt: just drop it please
[20:26:25] RubyPanther: tewlz: so stop talking about not talking to me, and just don't do it. :P I do care about your opinion, IF you agree to care about mine. So I'll listen against next time. But this time, you contributed nothing.
[20:26:31] tomorrow: parndt, its a bit ugly to select all data from form and then pass it through ajax. There is got to be a normal way for that
[20:26:36] Redstoner: Hi, I ran into a very weird problem where I froze rails for over 20 minutes with a single 2MB post. Can anyone help me figuring how/why this happened? All info is here: http://pastebin.com/nsW7ffAj
[20:27:20] parndt: tomorrow: I think your options are either to submit the form or to selectively pass parameters manually
[20:27:28] Redstoner: Here's the same thing on pastie: http://pastie.org/8393329
[20:29:53] RubyPanther: Redstoner: I didn't look at your link, but 2MB is a traditional default POST size limit in some webservers
[20:30:08] tomorrow: parndt, ok...thx
[20:31:12] tomorrow: parndt, I think i can submit it with remote for preview button and without it for submit.
[20:35:44] cored: how can I make Rails to autoload a group of classes that are not part of the default directory structure
[20:36:05] parndt: you could use ruby's "require" method
[20:36:05] cored: something like app/my_thing/classes.rb implying that those clases will be containing inside a module
[20:36:17] cored: can I have it auto loaded
[20:36:46] elaptics: have you got shift bound to <return>? :)
[20:40:27] elaptics: cored: you can add a path to the config.autoload_paths in config/application.rb
[20:41:45] cored: elaptics: and how can I do that on Rails 4
[20:44:17] kebomix: hello when using form_tag, how to make it ignore posting empty text_fields so url won't be like this (country=&start_date=&end_date=)
[20:44:23] elaptics: cored: I assume it's still the same. Have you tried it?
[20:44:26] RubyPanther: cored: You also should make sure you're following file naming conventions, the autoloader doesn't just load everything at the start, it loads things when they're used. If you want to load it all at the start, just do it explicitly instead of autoloading
[20:45:05] parndt: kebomix: that's a behaviour of HTML forms
[20:45:17] RubyPanther: cored: and put them in lib/ not in app/
[20:45:27] kebomix: parndt: thanks
[20:49:53] Senjai: parndt: o/
[20:50:24] jrobeson: the right order is \o then o/
[20:50:30] jrobeson: like ping and pong
[20:50:35] Senjai: parndt: I fired you a response to your email, albeit late, havent got one back :P
[20:51:23] parndt: I'll trawl my email, I get so many
[20:51:35] pipework: Oh ho ho, look who's so damn popular.
[20:51:47] tewlz: pipework: get out of my mind
[20:51:50] Senjai: parndt: Just pinged it, should be fresh in your inbox now :P
[20:52:16] parndt: yeah I already found it ;P
[20:52:35] kaldrenon: Is the stuff in config/environments/foo.rb supposed to supersede the stuff in config/application.rb?
[20:52:43] kaldrenon: I was under the impression it is.
[20:52:48] tewlz: does anyone know someone who actually makes these emoji faces for real?
[20:52:52] jstrong: kaldrenon correct!
[20:53:06] parndt: Senjai: to answer your question I can't remember what got me interested in ruby/rails
[20:53:15] jstrong: kladrenon: but you're probably safer not defining stuff in application.rb that's used in the environments and instead putting them exclusively in the environment files
[20:53:39] Senjai: parndt: may I query?
[20:53:42] parndt: Senjai: and the best tips I can give involve commit to as much open source as you can handle :D
[20:53:42] kaldrenon: jstrong: I had an issue but I think it was actually with how I set my environment vars. One moment, convfirming
[20:53:45] pipework: kaldrenon: Yeah. Read the initialization guide.
[20:53:45] parndt: Senjai: yep
[20:53:53] helpa: kaldrenon: http://guides.rubyonrails.org/initialization.html
[20:53:53] pipework: kaldrenon: !initialization
[20:54:23] kaldrenon: jstrong: Yep! I didn't have RAILS_ENV set correctly on a given launch of rails console, so the values weren't right.
[20:54:31] kaldrenon: pipework: Thanks for the reference!
[20:54:47] jstrong: parndt: you are one of the core contributors to refinery, correct?
[20:55:59] Senjai: lol, /topic #RubyOnRails RoR, the parndt edition ;)
[20:56:09] tewlz: and one of the core contributors to the hearts of the people
[20:57:02] parndt: jstrong: yep
[20:57:07] parndt: tewlz: yep!
[20:57:28] jstrong: parndt: thank you for that. we'll start using it in an application and possibly two that is underway
[20:57:39] jstrong: open source warms my heart
[20:58:35] tewlz: alcohol warms mine
[20:58:45] parndt: jstrong: you're welcome, hope it works for you
[21:00:53] jstrong: I'll be sure to contribute if we need to extend it
[21:39:24] brianpWins: TextHelper#simple_formate calls a method #split_paragraph. I think I'm just overlooking it but I can't tell where that's defined (http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-simple_format)
[21:43:35] smathy: ( hint line 399 consists of only a seven letter word that starts with p and ends with e )
[21:44:15] rhizome: click "on GitHub," ctrl-f "split_para" F3 F3
[21:44:38] brianpWins: smathy: Thanks. I don't know why my search didn't find that earlier.
[21:45:03] brianpWins: rhizome: you are a god. I used "t" all the time but didn't realize they had ctrl-f
[21:45:03] rhizome: "wrap search"
[21:45:27] brianpWins: oh it's not a real thing
[21:45:30] brianpWins: you had be excited
[21:45:31] rhizome: they? this is just browser
[21:45:33] brianpWins: in browser search
[21:45:50] brianpWins: I was hoping ctrl was something special =P
[21:46:13] rhizome: only in apple world :)
[21:47:17] parndt: control is special in apple world?
[21:48:40] parndt: cool, wondered if I was missing out on something
[21:51:35] rhizome: well, it's not cmd
[21:53:41] tpayne84: what would be the nicest cleanest way to check how many items in an array have a given value?
[21:54:09] bricker: array.select { |e| e == 1 }.size
[21:54:22] bricker: to see how many items in the array are 1
[21:54:39] tpayne84: bricker: thank you
[21:54:44] parndt: array.count {|e| e == 1}
[21:54:56] bricker: actually, just array.count(1) would work
[21:55:15] parndt: it sure would
[21:55:49] tpayne84: to be specific to what I am trying to do i have an array of objects, and I want to see how many of those objects.name == 'foo'
[21:55:55] tewlz: now what's the dirtiest way to do the same job
[21:56:25] bricker: i = 0; array.each { |e| i += 1 if e == 1 }
[21:56:41] parndt: elements = []; Array(array).each do |e| elements << e if e == 1 }; elements.size
[21:56:43] tpayne84: of the three ways described I am thinking the array.count {|e| e.name == 'foo'}
[21:56:55] parndt: elements = []; Array(array).each { |e| elements << e if e == 1 }; elements.size
[21:57:24] elaptics: parndt: if you're going for crappy use a for loop not each :)
[21:57:30] pipework: I woudl use inject, I believe.
[21:58:09] pipework: It's much closer to what you seem to be doing.
[21:58:22] parndt: closer to the metal
[21:58:35] tewlz: maybe ask for user to click button when their number hits the screen then display rand.
[21:58:53] tewlz: then search for it
[21:58:57] tewlz: gorgeous.
[22:00:15] parndt: $counter = 0; increment_counter = proc { $counter += 1 }; array.size.times { |i| increment_counter.call if array[i] == 1 }; $counter
[22:01:09] parndt: <-- available for hire
[22:01:18] pipework: <-- available for higher.
[22:01:42] tewlz: <-- just available :*(
[22:01:51] foucist: <-- easy lay
[22:01:58] pipework: <-- Illiterate.
[22:02:03] parndt: <-- likes arrows
[22:02:15] tewlz: <- to scale arrow
[22:02:20] foucist: dudes, i was implying you were all prositutes when i said i was an easy lay!
[22:02:35] foucist: cuz i reframed what you were for hire for! muahaha
[22:02:40] parndt: this escalated
[22:02:54] tewlz: not that quickly, though.
[22:03:36] parndt: relatively drawn out
[22:06:39] axsuul: naming is so hard =/
[22:07:11] parndt: I'm sure that it was one of the easiest things in software
[22:07:25] tewlz: try naming with a three character limit.
[22:07:35] tewlz: I've seen it before.
[22:07:50] pipework: parndt and I are just compensating for a lack of arrow length in other aspects of life.
[22:08:02] parndt: all variables containing integers should be prefixed with i and followed by 1 through 50
[22:08:05] parndt: i12 = 50;
[22:08:28] tewlz: you've seen that before?
[22:08:42] parndt: if I have I blotted it out
[22:08:44] axsuul: I'm dealing with recurring appointments right now, and so far I have methods with recurrenced, recurring, recur, recurred
[22:08:46] pipework: To date, all programs have required no more than 50 integer variables at any one time. Reassign as necessary.
[22:09:04] tewlz: because I mean I actually saw a database with all columns named in a three character convention.
[22:09:27] pipework: fck off would be my favorite tables to join.
[22:10:13] tewlz: le giggle
[22:10:25] adh1003: nbd nds mr thn 3 chr ne way
[22:10:42] tewlz: holy crap, I read that so easily.
[22:10:53] adh1003: you yng ppl and yr bloat - oh, damn.
[22:11:11] dsrx: can anyone sum up the difference between a form object and service object? seems like a form object is a service object which is written specifically for use with an html form
[22:11:24] tewlz: dde, yng ppl mad ths lng
[22:11:56] parndt: axsuul: why not use the word recrudesce
[22:12:09] adh1003: I can see I'm going to be what we technical types call "fucked" regarding my SQLite / Postgres / Rails adapter & BETWEEN issue.
[22:12:26] adh1003: ACTION is astonished that lots of other people haven't hit this before though - and often.
[22:12:35] adh1003: But then I only just noticed it myself as I've steadfastly ignored SQlite for 6 years.
[22:12:39] parndt: what issue
[22:12:55] adh1003: Oh, the messages didn't arrive? My net connection is awful.
[22:12:58] adh1003: https://gist.github.com/pond/6926387
[22:14:07] adh1003: If I were to ask for "d..d+1" then (say) SQLite might find 14 records, while Postgres would find 28.
[22:14:52] adh1003: Basically SQLite is really dumb and just says "this range means from the start of this date to <my head hurts>" as its start range is inclusive but its end range appears to be exclusive
[22:15:22] adh1003: (Which is why it's kind of obvious that end ranges ought to always be inclusive, as per PostgreSQL, but the SQL spec is ambiguous and database authors aren't always entirely clever).
[22:16:00] parndt: and this is rails' problem?
[22:16:02] adh1003: I can't just ask for "where( :date => d )" because that matches the date *precisely* on all databases so of course finds no records, unless something by complete chance was created at a time of 00:00:00.000000!
[22:16:29] adh1003: parndt: That's partly my question. Rails database adapters are supposed to abstract between database differences. If they didn't need to do this, they wouldn't need to exist. We could just talk SQL.
[22:16:53] parndt: SELECT CONTENT FROM WITTY_REPLIES LIMIT 1;
[22:17:01] tewlz: i prefer talking in binary myself, but if you insist...
[22:17:41] adh1003: parndt: Anyway as I said, the lack of response indicates that nobody has really noticed / thought about it / is even aware of inclusive vs exclusive issues for BETWEEN and Rails hasn't coped with it.
[22:17:59] adh1003: parndt: If I searched hard enough in the Rails issue list I'll probably find a bug that's about 3 years old with a zillion comments asking when it'll be fixed :P#
[22:18:12] parndt: >= AND <=
[22:18:33] adh1003: But that requires rewriting every single AREL query in my application with hard coded SQL instead.
[22:18:41] adh1003: It might be a viable option for the specific case of BETWEEN perhaps.
[22:19:01] parndt: or monkey patching the BETWEEN code in arel
[22:19:04] adh1003: There's only one hitch, it's not the same as BETWEEN for dates I fear...
[22:19:28] adh1003: ...but I could do ">= date, < date + 1 day".
[22:19:28] parndt: you could fix the database adapter and improve everyone's day
[22:19:42] adh1003: No point, I'd submit a patch with tests and i'll be ignored for years like all the others.
[22:19:42] terrellt: Pull request awaited.
[22:19:48] parndt: adh1003: untrue
[22:19:51] helpa: Why don't you try it and find out for yourself?
[22:19:51] terrellt: That is the wrong 'tude.
[22:19:59] adh1003: I'm afraid it's from experience.
[22:20:07] adh1003: Still I'll consider it because it's a good point you make.
[22:20:16] adh1003: This is what I'd call a really critical bug in the adapter so fixing it would help.
[22:20:25] parndt: you just have to make a bad pun at tenderlove on Twitter and link to the issue
[22:20:36] adh1003: But if it didn't get pushed out, my app is b0rked. "To run my app, install six miles high Rails stack, then install this new SQlite adapter which you can only get from me" :)
[22:20:56] parndt: fix the db adapter, insert shim in your own app
[22:21:02] smathy: My first Rails contribution was for the sqlite adapter.
[22:21:24] adh1003: parndt: I suppose I start at the app first, re-run all tests and thus verify that the equivalence is there, then look at the adapter.
[22:21:36] terrellt: Yes, send a pull request and monkey patch.
[22:21:53] adh1003: OK good call. Consider me motivated. I'll get onto it. Thanks all.
[22:22:23] smathy: I've never had a patch that fixed something and actually had tests anything but gleefully received.
[22:22:30] tewlz: Then insert "Rails contributor" on your resume and vuala you're done.
[22:22:50] adh1003: tewlz: "voila". Not to be confused with viola. C'est le frenchy.
[22:23:08] adh1003: Baguette, piscine. Oui. Etc.
[22:23:18] tewlz: adh1003: Here in 'merica you're wrong.
[22:23:34] adh1003: But didn't you guys shut down?
[22:23:45] adh1003: I heard your government had a kernel panic and it needed to be closed for maintenance.
[22:23:54] tewlz: only our government, not our hamburger joints or our military :p
[22:23:57] kurt21: If I am in the "rails console" REPL, how do I import 'ActionView::Helpers::TagHelper' so that I can run: content_tag(:p, "Hello world!"
[22:24:07] tewlz: our government never did anything anyways, not much changed
[22:24:21] adh1003: kurt21: "helper.content_tag..."
[22:24:38] adh1003: kurt21: Magic variable "helper" very useful. But doesn't help much with named routes etc., which is a PITA.
[22:24:42] kurt21: wow, that works.
[22:25:06] adh1003: kurt21: np. See also magic variable "app".
[22:25:14] kurt21: Is that really a magic variable? That seems hackish
[22:25:29] adh1003: kurt21: Welcome to Ruby On Rails. Please enjoy your stay. :-P
[22:25:38] kurt21: lol. are there any docs on these magic variables?
[22:25:49] dsrx: it isn't a magic variable
[22:25:54] adh1003: I was just wondering that. I think I picked that one up from StackOverflow or IRC.
[22:26:13] meowsus: Hey guys. I'm working with a bunch of Rails eCommerce sites that are hooked into a CI server. Before committing (before it's pushed to the CI server) I'm looking to be able to preview the site in its entirety on a smartphone, making my local machine a localized server. We're using Unicorn as our rack server, and I was curious if theres a way for Rails to handle this natively. My previous solution was using Burp Suite to create a proxy on the local
[22:26:13] meowsus: machine, then editing the smartphone's wifi connection to proxy to the local machine. This works, but it's a bit of a pain, especially for new people trying to do this. Does anyone know how to do something similar to this?
[22:26:18] adh1003: dsrx: Pls explain? Ta. I've always wanted to learn more about that stuff (seriously).
[22:26:18] kurt21: are there docs on it?
[22:26:51] dsrx: they're methods on Rails::ConsoleMethods
[22:26:52] dsrx: http://api.rubyonrails.org/classes/Rails/ConsoleMethods.html
[22:27:41] adh1003: That's not terribly useful documentation...!
[22:27:48] scyllinice: meowsus: You can use something like localtunnel, http://progrium.com/localtunnel/
[22:27:57] meowsus: scyllinice: ooh, let me peep that
[22:28:38] adh1003: dsrx: But at least I know where to find the list, anyway.
[22:29:07] tewlz: meowsus: not really an answer, but I always dev on nitrous.io just so I can run the webrick on the cloud and check from many devices
[22:29:18] meowsus: scyllinice: holy hell, this looks good
[22:29:45] scyllinice: meowsus: Yeah, it's pretty easy. There are a few like this
[22:29:57] meowsus: tewlz: Yeah, I don't know if that will work for us. But I'll look into it too.
[22:30:07] bricker: meowsus: Chrome actually also has this built-in
[22:30:18] bricker: meowsus: for android anyways
[22:30:33] meowsus: bricker: Does it now?
[22:30:36] dsrx: you can use xip.io as well if the devices are on the same network
[22:30:42] dsrx: xip.io integrates nicely with pow
[22:31:07] bricker: meowsus: yep, reverse port forwarding. https://developers.google.com/chrome-developer-tools/docs/remote-debugging
[22:31:12] meowsus: dsrx: This didn't work for us, because the checkout process requires us to switch ports and that broke, apparently
[22:31:38] scyllinice: meowsus: This one might work as well too, http://www.ultrahook.com/
[22:32:12] scyllinice: That doesn't require the ssh key
[22:32:49] scyllinice: Well, that one looks like it only does post
[22:32:54] scyllinice: So yeah.. localtunnel
[22:33:54] meowsus: scyllinice: LocalTunnel is looking like a good solution.
[22:34:01] meowsus: I wonder how it would handle SSL switches
[22:34:41] terrellt: So how is your problem any different than "open your firewall port"?
[22:35:02] meowsus: terrellt: you talking to me?
[22:35:59] meowsus: terrellt: Well, we run a bunch of sites locally, and they're all tied to hostnames, and the hostnames are static. So if you connect to the development machine via IP address then none of the links work, since it's always trying to reference the hostname.
[22:36:30] meowsus: terrellt: should have prefaced that with "that's an unchangeable aspect of our development" so I don't get endlessly mocked
[22:37:02] meowsus: Like, I can switch from Unicorn to Webric and just access the IP address, but since the hostname is locked into each link, I can't get around the site.
[22:37:41] toretore: whyis the hostname "locked into each link"?
[22:37:56] terrellt: ^ It might not be endlessly, but this might happen.
[22:38:08] glaksmono: guys, I have a constant attribute on ActiveRecord::Foo.. How do I pass that constant attribute on the web response?
[22:38:20] glaksmono: I want to always include that
[22:38:23] parndt: use _path not _url
[22:38:27] toretore: u make no sense
[22:38:42] scyllinice: glaksmono: Why would you ever want to do that?
[22:38:43] glaksmono: toretore: ?
[22:38:53] glaksmono: toretore: well.. i'm defining a configuration..
[22:39:01] toretore: code code code
[22:39:29] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[22:39:34] helpa: !!!!!!!!!!
[22:40:21] s2013: damn it. how come i dont have access to helpa
[22:40:27] helpa: You are worthy of this bot!
[22:40:27] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[22:40:28] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[22:40:40] helpa: glaksmono: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[22:40:40] Radar: glaksmono: !fake
[22:40:56] glaksmono: https://gist.github.com/glaksmono/bc281e45834ee3491522
[22:40:58] scyllinice: Helpa doesn't like me either, so I cry a little at night
[22:41:03] s2013: i cry a lot
[22:41:21] parndt: because the bot can be abused
[22:41:31] toretore: helpa y u not case insentisivniw
[22:41:46] scyllinice: glaksmono: For real though.. paste your actual code
[22:42:20] toretore: also, explain better what you want to do
[22:43:31] Radar: scyllinice: Have you ever spoken nicely to helpa?
[22:43:47] adh1003: OK, I have absolutely no idea how the SQLite3 adapter for Rails works. Where does it even make SQL statements? Sigh.
[22:43:52] scyllinice: Radar: I probably didn't say the right things
[22:43:55] adh1003: #cannotmakeheadortail
[22:44:02] Radar: scyllinice: ok. All is forigiven now.
[22:44:19] Radar: adh1003: The answer to that is quite Long Form.
[22:44:24] Radar: adh1003: How much is it worth to you to know?
[22:44:43] terrellt: adh1003: Probably in the generic SQL adapter?
[22:45:01] adh1003: Radar: Ask the Rails team. I'm trying to patch a serious bug in the way it doesn't sensibly behave with BETWEEN statements. I also might patch its serious faults with time formats while I'm here.
[22:45:22] adh1003: (I didn't ask about that one - but SQLite things the time "12:44:20.553" is not the same as "12:44:20.553000", for example).
[22:45:51] adh1003: The SQLite adapter is on reflection a bit of a wreck really. It doesn't abstract SQLite's quirks at all.
[22:46:20] adh1003: I'm tempted to just tell SQLite people they're S.O.L. and to either use another database or not use my app.
[22:46:33] adh1003: Even though I'm routing everything through Rails / AREL like a good boy :P LOL
[22:48:50] meowsus: terrellt: sorry, stepped away for a second. I have no idea why they did it that way, actually.
[22:49:06] meowsus: I'm on the front-end team. The rails developers do whatever they do, seemingly for reason.
[22:49:25] adh1003_: Most developers do what they do for reasons :D
[22:49:36] Radar: adh1003_: I didn't think that sqlite3 was supposed to be a Serious Database anyway
[22:50:00] adh1003_: Radar: Quite. But I have users that want to use it, because this is just for a small business orientated application and they already had a hard enough time just getting Rails up.
[22:50:08] adh1003_: With the right Ruby versions, gems, etc. etc...
[22:50:18] scyllinice: adh1003_: Make money selling virtual appliances
[22:50:26] ecnalyr: I'm having a hard time with a validates_uniqueness_of statement where I have an added condition. Anyone familiar with this type of validation? My question is posted in its entirety here: http://stackoverflow.com/questions/19307539/having-difficulty-using-validates-uniqueness-of-with-a-specific-condition
[22:50:29] adh1003_: Radar: And Rails database adapters *are* supposed to abstract this stuff. So it's definitely IMO a bug.
[22:50:31] scyllinice: Or consulting fees to help them setup
[22:50:57] adh1003_: I tell you, if I had a UK pound for every time someone used my application, I'd have at least a fiver by now.
[22:51:12] adh1003_: It's like so super-popular, the pressure is immense.
[22:52:37] scyllinice: Exaggeration or not, why spend the extra time on it?
[22:52:48] adh1003: I hate finding bugs like this then just ignoring them.
[22:53:16] scyllinice: Report it with a reproducable example. You're not ignoring it then :)
[22:53:21] adh1003: It's catastrophic for the app - only about 10% of tests pass (!) since many of the tests are explicitly based around numeric accuracy for output reports and so-on and deliberately exercise edge cases for dates and ranges since I knew they'd be a pain point.
[22:53:41] adh1003: But I didn't expect the SQLite adapter to be so impenetrable.
[22:54:19] adh1003: (Because I've no idea how adapters actually work, and it's non-obvious to someone used to working with the "upper side" of rails, not the underside).
[22:54:52] adh1003: I'll work on this for 2-3 days or so I think. Then maybe just give up and report it. But that's a bit of a crap answer.
[22:56:06] adh1003: Hmm, yeah I think the issue is one of ownership. The SQLite3 gem isn't a Rails database adapter, it's just a sort of generic Ruby interface to SQLite.
[22:56:28] adh1003: So I'm looking in the wrong place, dammit. Now I've no idea where the code I should be examining is. Who's responsible for database independence?
[22:57:15] Radar: adh1003: If you're looking for the bridge between Rails and that SQLite3 adapter, it's in Active Record.
[22:57:25] Radar: adh1003: The code for database independence is within Active Record.
[22:57:34] adh1003: Radar: Ah, I'm in totally the wrong place. Thanks.
[22:57:35] Radar: Active Record determines what database adapter class to use.
[22:57:43] Radar: adh1003: That'll be $50 thanks
[22:57:53] adh1003: Radar: $50 <-- there you go
[22:58:02] Radar: thank yuo
[22:58:21] Radar: I think it's specifically the SQLite3Adapter class and friends you want to look at.
[23:01:06] adh1003: Yes, active_record/connection_adapters/sqlite_adapter.rb has most of it
[23:01:26] adh1003: No obvious mapping for BETWEEN, closest for that is sanitize_sql_hash_for_conditions in sanitization.rb
[23:03:08] platzhirsch: I want to display "No data available page" if data is missing for a certain resource. How is this normally solved? Test if the data is there and render another page then or something more conventional ?
[23:03:46] glaksmono: can we initialize attr_reader?
[23:03:50] adh1003: Radar: Still can't find where abstract Rails-y stuff is converted into SQL in a database independent manner.
[23:04:16] Radar: adh1003: Deep within the source of Active Record.
[23:04:19] Radar: and ARel.
[23:04:31] Radar: I said it was a long form answer
[23:04:33] helpa: glaksmono: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[23:04:33] Radar: glaksmono: !explain
[23:04:40] adh1003: Radar: Yes, but for example a na??ve search within the ActiveRecord 3.2.14 source code for "between" case insensitive turns up nothing.
[23:04:43] Radar: platzhirsch: ^ same for you too
[23:04:55] Radar: adh1003: probably because ARel is handling it, not ActiveRecord.
[23:04:59] scyllinice: You could write a book on it
[23:05:08] scyllinice: You as in not you personally.. anyone
[23:05:13] glaksmono: Radar: ?. i'm just asking about attr_reader..
[23:05:34] Radar: glaksmono: No, yuo're asking about initializing an attr_reader, which is a non-sensical question
[23:05:40] Radar: glaksmono: explain what problem you're trying to solve, and we'll help you solve it
[23:05:45] Radar: scyllinice: Yes, you could :)
[23:05:54] Radar: scyllinice: During the writing you would probably go insane.
[23:05:54] parndt: attr_reader :thing
[23:05:58] parndt: @thing = 'something'
[23:06:07] scyllinice: Radar: I'm barely sane as it is
[23:06:19] adh1003: Radar: That was my point about ownership. If AREL's doing it, that's separate from Active Record's source and separate from the database adapters. So again, who's responsible for varying the SQL to cope with database differences?
[23:06:32] adh1003: Surely it's not attempting to work on a lowest common denominator works-for-all-databases basis is it? That'd never work...
[23:06:33] Radar: adh1003: Answer: everyone :D
[23:06:48] adh1003: LOL :) I meant "who" in terms of software components.
[23:07:03] adh1003: "what" might've been a better word. Or "where". Or "why".
[23:07:17] platzhirsch: Should the decision whether an error page should be render be made inside the respective controller method or somewhere else? The error is not triggered by an exception, otherwise I could display it based on the exception raised
[23:07:35] Radar: adh1003: ActiveRecord, ARel and Sqlite3 are the big players
[23:07:46] Radar: adh1003: if you want more deeper answers, this is the kind of stuff I get paid to do sooooo
[23:07:57] Radar: adh1003: deep dives of Rails are very much outside the scope of this channel
[23:08:19] adh1003: But I'm not paid, I'm in fact losing money spending time on fixing this bug, if I do indeed manage to fix it.
[23:08:59] adh1003: So please do bear in mind my temptation to say "fuck this shit" when faced with a million lines of convoluted source code across multiple components and just give up, hacking a workaround in my app instead.
[23:09:14] Radar: The collective effort of this channel is better spent helping a lot of people for very short amounts of time, rather than one person for a huge period of time
[23:09:39] adh1003: Will continue digging. It's kind of interesting in and of itself.
[23:09:52] scyllinice: adh1003: "BETWEEN" is in here, but it's probably not what you want: https://github.com/brynary/arel/blob/master/lib/arel/visitors/to_sql.rb
[23:10:54] adh1003: scyllinice: Yeah, found that via source search in that component, but quite how that plugs into database independence is a complete mystery. How would I say that for SQLite in Rails, it should use ">= foo AND < bar"? Or maybe I should patch that for everything... :P
[23:11:14] adh1003: In fact I've had worse ideas than temporarily hacking that alternative into AREL just to see what happens.
[23:11:18] adh1003: ACTION fetches his axe.
[23:12:17] adh1003: 'cept of course it's never that simple, "o.right" is already precomposed as "foo AND bar".
[23:12:28] omarqureshi: SQLite, the database that big players use in production
[23:12:29] Radar: Got a couple mins extra time.
[23:12:34] omarqureshi: along with Access and Excel.
[23:12:42] Radar: Re: my last point: "Teach a man to fish"
[23:13:01] scyllinice: adh1003: So maybe you have to patch lib/arel/visitors/sqlite.rb then
[23:13:03] scyllinice: I don't know
[23:13:06] scyllinice: Just guessing
[23:13:11] adh1003: omarqureshi: :) we can't all be facebook, and I shouldn't ignore my users because I disapprove of a database that's supported by Rails. If it shouldn't be used, don't provide an adapter for it.
[23:13:13] scyllinice: You can override between in there
[23:13:29] adh1003: scyllinice: Yup.
[23:14:15] omarqureshi: I dunno, part of being a responsible person is telling people rightly so when to fuck off
[23:14:19] adh1003: scyllinice: That looks like as-close-as-possible the right place. Override in there.
[23:14:40] omarqureshi: maybe im just a bitter old bastard
[23:15:09] adh1003: omarqureshi: But it really ought to work, aye. It's just a date range comparison. That's pretty basic. Looks interesting inside AREL, might work...
[23:15:23] adh1003: ...if I can figure out just how to get the right answers out of "o".
[23:17:38] aflag: hello. I'm trying to make a integration test, but I'm having difficulty trying to figure out how to fill up stuff on a form
[23:17:52] pipework: Capybara bruv.
[23:17:58] aflag: maybe I should use a gem for that? Does rails already have support for that type of thing?
[23:23:27] nettoweb: someone know some good gem to generate pdf with rails4? Im trying to use pdfkit but I'm facing a lot of problems with rails4
[23:25:00] aflag: I'm sort of lost. I installed capybara and I required 'capybara/rails' on my integration test, but it's still giving me "undefined method `fill_in'"
[23:38:30] AntelopeSalad: can someone confirm i'm not crazy and tell me what you see when you drop this into a view: <%= link_to "Share this", "http://www.sharethis.com" %>
[23:38:48] Lewix: you are crazy
[23:39:28] Lewix: (just kidding)
[23:39:41] bricker: AntelopeSalad: It does what the documentation says it will do
[23:39:57] AntelopeSalad: bricker: i know
[23:40:18] AntelopeSalad: something is on drugs though, when the url is exactly that it outputs nothing
[23:40:35] AntelopeSalad: if i remove a single letter from the url then it renders as you would expect
[23:42:25] adh1003: AntelopeSalad: Works fine for me. Check your browser doesn't have any weird extensions that might try to do clever things with URLs, especially sharing-related ones.
[23:43:31] AntelopeSalad: adh1003: it's on drugs, if i disable javascript then it works
[23:43:49] adh1003: AntelopeSalad: So that confirms it. You have a script or extension which is mangling your page.
[23:43:52] AntelopeSalad: apparently the sharethis.com service makes your hand written sharethis.com links hidden by default
[23:44:11] AntelopeSalad: if i remove the js that includes the sharethis.com functionality then it works (or disabling js)
[23:44:24] AntelopeSalad: what type of ridiculousness is that haha
[23:44:45] adh1003: AntelopeSalad: You didn't ask anyone to disable JS. You just said "paste this into your view". I pasted, it worked. If their service includes buggered up JavaScript which you included then that's their problem :P
[23:45:09] adh1003: Sorry, I didn't mean disable JS, I meant include a JS script.
[23:45:21] AntelopeSalad: yeah i know adh1003, after you reported that it worked i figured it had to be something related to sharethis on my end
[23:45:41] AntelopeSalad: it's just extremely strange behavior, never saw anything like that in my life
[23:46:25] adh1003: There's not much wrong with JS IMHO, but there's a lot wrong with a lot of the people that mash their fingers on the keyboard and save the result with a ".js" extension, then publish it for others to use :P
[23:46:46] AntelopeSalad: sharethis is a really popular service
[23:47:42] adh1003: Popular != good or well written.
[23:48:49] adh1003: AntelopeSalad: Best you can do is submit a bug report to the service, I should think. Or try to debug the script yourself (yuk).
[23:49:28] devdvd: hey, i can see in the rails server console output that the transaction im submitting to the db is being rolled back but I don't know why. Is there any way to find out?
[23:50:17] AntelopeSalad: adh1003: yeah, i'll likely submit a bug later
[23:59:11] devdvd: figured it out