« Back to channel list

#RubyOnRails - 07 February 2015

« Back 1 day Forward 1 day »
[00:05:02] mmun: hello. is there a common pattern for accepting a model or its primary id?
[00:07:32] mmun: model_or_id.is_a?(ActiveRecord::Base) ? model_or_id : MyModel.find(model_or_id)
[00:09:10] Axsuul: @Radar Do you have any team recommendations for finishing the development of a Spree store?
[00:09:12] waseem_: mmun: What are you trying to do exactly? Can you show me real code?
[00:09:46] mmun: waseem_ I'm just writing a lib function that can accept either a model or its ID
[00:09:49] mmun: nothing fancy.
[00:10:11] mmun: not unlike link_to
[00:10:35] mmun: the code ^^^ is sufficient for my purposes :)
[00:11:42] waseem_: mmun: That seems fine then.
[00:11:57] mmun: waseem_: thank you
[00:24:14] JakePee: I'm having trouble getting an object to build on a JSON post
[00:26:11] JakePee: I have my object set up with text type variables for attributes I intend to serialize
[00:26:27] mostlybadfly: hey all, I'm working on a one to many relationship with Recipe and Ingredient. I get the form to accept the nested attributes but they are being saved as nil in the database. If you have any ideas I would appreciate it https://gist.github.com/mostlybadfly/c710d5985c95342c8218
[00:26:34] JakePee: The problem is, I get `Unpermitted parameters: all_resources, node, updated_resources`
[00:29:52] weaksauce: JakePee can you gist your code?
[00:29:58] weaksauce: and the full stack trace
[00:30:13] JakePee: weaksauce: Sure can
[00:32:15] johntrails: does anyone know where i can find some tutorials. I am looking for to learn some specific things. I want to be able to incorporate calendars in my app to perform range selections. I want to pull data from my models from within a specific range of dates. ideally i would have 2 calendars to select begining and end date
[00:35:28] JakePee: weaksauce: https://gist.github.com/Ghjnut/2459d1cf25cd28ff58be
[00:39:55] EminenceHC: Has anyone here built an application with rails that is HIPAA compliant?
[00:42:50] weaksauce: JakePee do you have spring installed?
[00:43:20] JakePee: weaksauce: I do
[00:43:32] weaksauce: can you restart spring?
[00:45:31] JakePee: weaksauce: Done. Same thing
[00:55:47] johntrails: does anyone know how i can go about formating numbers to currency
[00:56:23] weaksauce: number_to_currency johntrails
[00:56:41] weaksauce: look it up here http://api.rubyonrails.org/
[00:56:43] johntrails: 305139.43 is the result of data im pulling via a view. I want my view to show $305,139.43
[00:57:32] weaksauce: if you are in the US it should do that automatically
[00:57:57] johntrails: that's perfect
[00:58:17] weaksauce: no problem johntrails
[01:00:19] johntrails: that worked, but how would i go about it on a map ?
[01:00:22] johntrails: eg; <%= @monthlysnapshots.map{|item| item.total}.reduce(0, :+) %>
[01:00:37] johntrails: how can i implment number_to_currency under this scenario ?
[01:01:16] johntrails: ive tried multiple methods that doesnt seem to work
[01:43:28] renegadeandy: evening everyone!
[01:44:21] renegadeandy: is there a way I can change : <%= stylesheet_link_tag "application", :media => "all" %> so it can load a specific class for certain css media queries?
[01:47:57] renegadeandy: i can oviously see the :media on there...but i want most of the classes to load, from the application concatenation
[01:48:37] renegadeandy: and just one file dependant on the result of the css media query
[02:20:06] cosmicfires: I've changed a file but rails console is using the previous version, unless I restart rails console, is this expected?
[02:21:23] |work: Does it matter? Just try restarting the console. Not a big deal.
[02:22:25] tmoore: cosmicfires: yes, that's expected
[02:22:38] tmoore: you can type reload! to force it to reload
[02:23:02] cosmicfires: cool so I don't have to restart it, thank you
[02:23:29] |work: reload! doesn't work for everything though
[02:24:00] cosmicfires: what doesn't it work for?
[02:24:26] |work: Things that aren't automatically reloaded in rails anyways.
[02:25:13] tmoore: and also if you have existing instances of classes, they won't reflect the changes
[02:29:34] zachrab: Does anyone know of an open source Rails project on GitHub I could contribute to? I'm a junior developer trying to beef up my skillset
[02:34:38] renegadeandy: when using psql , what username and password does ruby use when creating the db?
[02:38:08] chris22: Hi - I'm a beginner RoR developer and was hoping if someone could answer (I believe) a pretty easy question I just can't seem to get to the bottom of
[02:38:41] chris22: I'm trying to replicate https://github.com/jcs/lobsters... it has a script that automatically posts to twitter when a user "submits a story".. I can't seem to find what kicks off the script
[02:38:49] renegadeandy: the answer was - the systems username btw
[02:39:17] chris22: the website is like reddit or any other link aggregrator sites... im reproducing it for a different genre
[02:39:35] chris22: I wasn't able to find anything in the rails controllers, that mentioned anything in this script (https://github.com/jcs/lobsters/blob/master/script/post_to_twitter) or in extras (https://github.com/jcs/lobsters/blob/master/extras/twitter.rb)
[02:48:15] chris22: sorry - I lost connection... any help on my previous question would be appreciated
[02:51:02] chris22: im a beginner RoR developer and trying to figure out what makes this script run https://github.com/jcs/lobsters/blob/master/script/post_to_twitter when a user submits a story
[02:51:57] chris22: I'm trying to replicate the website for my own project and am unable to get the auto posting to twitter working. so am i troubleshooting mode
[03:45:06] rhizome: guessing there would be an error in the log
[03:52:03] renegadeandy: v quiet in here tonight
[04:08:23] jesmith: I am trying run the mongoid:config generator but it says it can't find the generator. Any ideas?
[04:14:53] rhizome: did you run bundle install?
[04:15:00] rhizome: rails g will list available generators
[04:19:32] jesmith: yes. Bundle install shows the mongoid bundle being added, but rails g doesn't list it as a generator
[04:23:26] emocakes: AFTERNOON GUYS
[04:23:59] JokesOnYou77: When we started our web app at work we used Postgres as our backend, but (aside from our standard user data) the data that we're storing has a lot of many-to-many relationships (it's a graph) and we're starting to plan a major refactor and I'm wondering if we should switch backends. Right now we store graph data as JSON in postgres.
[04:25:11] rhizome: hard to say. what would you switch to?
[04:28:34] Radar: +q emocakes!*@*
[04:28:43] Radar: +b *!~textual@unaffiliated/emocakes
[04:28:45] Radar: Radar kicked emocakes: behavior is not conducive to the desired environment.
[04:29:13] Radar: Now I remember why he was banned in the first place.
[04:31:47] JokesOnYou77: Right now, we have limited to no customer data that needs to be preserved and the arnchitecture we chose when we started (everything goes into the view and JS does all of the data manipulation) is causing problems for us so as we re-architect I'm considering a new DB. I was thinking about Mongo or Neo4j
[04:33:04] JokesOnYou77: rhizome, I recently did a side project (not with rails) with Neo4j and as we are storing graph data and and a lot of many to many realtionships I thought it might perform better than a bunch of really big joining tables.
[04:36:38] JokesOnYou77: Our app is a text analytics tool where users have reports and reports have many comments (e.g. tweets). Our analysis API analyzes the comments and returns them in a graph structure where each comment has connections with 0-n other comments and each connection has a strength. Then in the analysis phase a comment gets annotations and tags which are also many-to-many
[04:37:31] jesmith: JokesOnYou77: Have you looked @ OrientDB? it's a bit of a blend between Mongo and Neo4j. Haven't looked at the ruby support, but the tools looks promising
[04:40:50] JokesOnYou77: jesmith, It has come up in recommendations before but I haven't reviewed it yet. Part of the consideration would be how good the rails integration is though and I know Neo has good support.
[04:41:53] jesmith: yeah, I can't speak to the rails support for Orient, but in testing I did in java it had better performance, and the distributed nature of it was a big benefit
[04:42:05] jesmith: Love to hear what you end up doing when you decide.
[04:44:00] JokesOnYou77: My main concern with postgres is that if a report has 10000 comments and I use a joining table for the many-to many relations it will only take 1000 Reports before the joining table is at 10 Mill rows and I'm not sure what's going to happen to the join queries at that point. Does anyone have experience with something like that?
[04:45:11] JokesOnYou77: Now all of the comments are in a big JSON blob in the DB and I've heard that psql can use array fields instead of a mapping table which may make a big difference, but I'm not sure how to do it in Rails yet.
[04:48:16] andhof-mt: I made a favorite model, which "belongs to user"
[04:48:19] andhof-mt: how can I add a user to it
[04:48:36] andhof-mt: like syntax wise.
[04:49:21] andhof-mt: https://gist.github.com/andhof-mt/c63a8c319c798ddad6ec
[04:55:26] andhof-mt: anyone home?
[04:56:55] jesmith: So I have 2 different gems that I have installed that are supposed to ahve generators but neither does
[04:57:05] jesmith: Any ideas on what can be causing that?
[05:40:55] basichash: How can I reduce the time it takes to load my rails app on my dev machine?
[05:41:31] basichash: Don't know why, but it's taking a couple of seconds to load on each refresh (i think due to the styling i'm using)
[05:43:32] iliketurtles: basichash: if you're not working on the frontend, you can always precompile your assets
[05:43:58] basichash: iliketurtles: how do i do that?
[05:44:55] iliketurtles: basichash: rake assets:precompile
[05:44:58] iliketurtles: that's weird though, it should be caching your styling unless you're changing it on each refresh
[05:45:12] basichash: iliketurtles: yeah i'm customizing some stylings
[05:45:35] iliketurtles: oh then don't follow my suggestion, because that will generate static assets in /public/assets and you wont see your changes
[05:46:55] iliketurtles: the slowness you're experiencing is possibly due to sprockets compiling all of your css/js assets after each change and refresh.
[05:47:25] iliketurtles: do you have a large number of css files?
[05:47:57] basichash: iliketurtles: i thought it would be something like that. yeah currently importing both bootstrap and semantic-ui
[05:49:25] iliketurtles: basichash: yeah, that's probably your issue. i haven't worked with bootstrap in a while, but i seem to recall you can selectively import only the css/js assets you are using
[05:49:52] iliketurtles: not sure how that will pan out if you're using one of the bootstrap gems
[05:50:32] iliketurtles: basichash: something i've set up in the past if i'm forced to use large amounts of css: http://blog.55minutes.com/2013/01/lightning-fast-sass-reloading-in-rails-32/
[05:51:19] basichash: iliketurtles: looks promising, thanks
[06:08:22] basichash: iliketurtles: if i want to wrap my views in a parent view (e.g. i want all views for my users controller to be wrapped in a <div class='users-wrapper'><%= yield %></div>), would i do that with partials?
[06:09:25] iliketurtles: basichash: probably a layout makes more sense that you set on a per-controller or per-controller-method basis
[06:10:35] iliketurtles: basichash: http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts
[06:11:13] basichash: iliketurtles: perfect, thanks
[06:15:53] basichash: iliketurtles: is it possible to have my controller layout render within my application layout?
[06:17:03] iliketurtles: basichash: you could do that as you suggested with partials, or follow the technique in the link posted above using content_for
[06:24:13] basichash: iliketurtles: hmm not sure i understand it works...
[06:53:49] basichash: can someone help me get nested templates working?
[06:56:25] Abhijit: basichash, details.
[06:57:19] basichash: Abhijit: right so i want to wrap each controller in it's own template and then each action will have a template nested in the controller template, which itself will be nested in the applicatoin template (so header/footer will always be present)
[06:58:20] basichash: Abhijit: from what i understand i need to have a <% content_for?(:controller)?yield(:controller):yield %> in layouts/application for each controller template
[06:58:53] rhizome: there are some howtos/opinions out there about nested layouts. i used them once years ago
[06:58:57] basichash: but i still don't really understand the control flow in this instance
[07:00:38] basichash: rhizome: any idea how it all works?
[07:01:14] rhizome: it works through the magic of ruby. TIMTOWTDI
[07:01:45] basichash: i'm suprised this isn't really simple to do, considering in django it's quite easy
[07:01:52] rhizome: you can probably automate this one by just putting the last example in regular layout with a controller_name as the layout in the block http://railsguides.net/rails-nested-layouts/
[07:02:38] rhizome: it was rails 2 the last time i looked. i'm thinking render didn't take a block like that then
[07:04:56] pyemkey: Hello RoR community :) Can anyone give me a hint how can I refactor my code https://gist.github.com/pyemkey/6a052387f73950ae55f8 User has many resumes, but only one is public/visible. When user click on locker and a resume before clicking is public, nothing happens. When User clicked on resume which is hidden, then this one have status visible, rest is hidden.
[07:06:40] basichash: yeah no idea how this works
[07:10:31] basichash: if anyone has experience with nested layouts, let me know
[07:19:44] jesmith: noob question here, but how do you access the attributes of a ruby object.
[07:26:53] jesmith: I have a form in rails that captures dates as a combination of drop downs. How do I combine those into a single thing before trying to write it to mongoid?
[07:35:12] basichash: How do I change the url for a model from /models/:id to /models/:anotherfield?
[07:44:54] iliketurtles: basichash: :anotherfield better be unique, you could define a custom route (see rails routing docs), and in your controller look up the model by the params[:anotherfield] instead of params[:id]
[07:45:24] iliketurtles: this might accomplish what you want, depending on your use case: https://github.com/norman/friendly_id
[07:47:23] hd1: ACTION has a pretty trivial question about partials rendering (or not rendering as reality would have it)
[07:48:24] iliketurtles: no one will help if you dont ask the question :P
[07:48:50] hd1: iliketurtles: working on it
[07:49:58] basichash: iliketurtles: right, which is what i've tried to do. I've changed to_param on my profile model (which foreign keys to User), so now the :id == User.find(user_id).username
[07:50:43] basichash: iliketurtles: then in my profiles controller, def show\n Profile.find(User.where("username = '#{profile_params[:id]}'"))
[07:50:54] basichash: but i'm getting: param is missing or the value is empty: profile
[07:51:00] hd1: how do i flush the rails asset cache?
[07:51:26] iliketurtles: hd1: rake assets:clobber
[07:52:12] hd1: still doesn't work
[07:52:24] iliketurtles: basichash: umm
[07:52:36] iliketurtles: that User.where will return an ActiveRecord::Relation
[07:52:59] iliketurtles: You can't do a Profile.find() on an ActiveRecord::Relation
[07:53:17] hd1: if I have "<%= render partial: "form" %>" in my view, the partial "_form.html" will be rendered, right?
[07:53:20] basichash: iliketurtles: oh
[07:53:24] iliketurtles: find expects id
[07:54:03] iliketurtles: Profile.find(User.where(username: profile_params[:id]).username) maybe? not sure what youre trying to do there exactly
[07:54:20] basichash: iliketurtles: does seem to work in console
[07:55:16] basichash: the original
[07:56:19] basichash: hmm still getting that same error though, what param is missing exactly?
[07:56:24] iliketurtles: do you get this warning?
[07:56:25] iliketurtles: DEPRECATION WARNING: You are passing an instance of ActiveRecord::Base to `find`. Please pass the id of the object by calling `.id`.
[07:56:59] basichash: I thought the id was resolved automatically by AR
[07:57:14] basichash: i don't think that's what's causing the error anyway
[07:57:24] iliketurtles: i just tried a lookup similar to that -- never tried passing an AR::Base object, but it does in fact work. interesting
[07:57:46] iliketurtles: for instance, Blog::Post.find(User.first) will return all Blog::Post records with user_id: User.first.id
[07:58:26] iliketurtles: what do your associations look like on Profile and User
[08:00:27] basichash: iliketurtles: ah weird, there was no relation in my profile.rb model (thought i'd put that in)
[08:00:45] basichash: iliketurtles: so that should be a belongs_to :users then?
[08:00:54] iliketurtles: basichash: try adding that, probably the issue
[08:01:28] iliketurtles: basichash: assuming that's how you want your associations set up, yes. i'm guessing a user has_one :profile, and profile belongs_to :user
[08:01:57] iliketurtles: you dont necessarily need inverse associations like that, but i think with the lookup youre trying to do youll need the belongs_to :user
[08:02:22] hd1: it seems this is a caching problem
[08:02:58] basichash: iliketurtles: hmm still says the param value (profile) is missing
[08:03:24] iliketurtles: basichash: hard to help without seeing the code, maybe you can gist it or something
[08:05:37] basichash: iliketurtles: right here's the profile_controller: http://paste.ubuntu.com/10105462/
[08:06:05] basichash: and the profile model http://paste.ubuntu.com/10105464/
[08:07:32] basichash: don't really understand, all the params values should still be there. the only difference is that params[:id] is now User.username instaed of Profile.id
[08:08:54] iliketurtles: basichash: for one thing, your Profile#username and Profile#to_param methods can reference the belongs_to association instead of using the User.find class method. ie. self.user.username
[08:09:24] iliketurtles: if you inspect the params[:id] when you access your controller, what is the value
[08:09:43] iliketurtles: sorry profile_params[:id]
[08:10:17] basichash: iliketurtles: how can i do that in console?
[08:10:36] basichash: or you mean the web error page
[08:10:54] iliketurtles: for simplicity on the line above the @profile assignment, just put a `p profile_params[:id]`
[08:11:42] iliketurtles: so i'm confused. profile_params[:id] is a user's username?
[08:12:25] iliketurtles: why wouldnt you use a nested route, like /users/:id/profile
[08:12:38] basichash: iliketurtles: yeah so originally it's the profile's id, like it should be
[08:13:01] pyemkey: Hello RoR community :) Can anyone give me a hint how can I refactor my code https://gist.github.com/pyemkey/6a052387f73950ae55f8 User has many resumes, but only one is public/visible. When user click on locker and a resume before clicking is public, nothing happens. When User clicked on resume which is hidden, then this one have status visible, rest is hidden.
[08:13:14] basichash: iliketurtles: i'd prefer to only display the username in the url
[08:13:43] iliketurtles: ok so you want to lookup the user's profile by the user's username?
[08:14:33] basichash: exactly. so in my app profiles are how users can view each other, and the User model is for auth, underlying stuff
[08:14:54] iliketurtles: i'd define a route: get '/users/:username' => 'profile#show'
[08:15:03] basichash: so if a user wants to browse all users in cali for e.g., this information would be stored in the Profile model
[08:15:24] iliketurtles: in your ProfilesController#show method, @profile = Profile.where(username: params[:username])
[08:16:24] iliketurtles: i dont think the strong parameters (profile_params) make sense for a GET request like that
[08:16:33] basichash: iliketurtles: ah ok
[08:18:00] basichash: iliketurtles: hmm so now: undefined method `user_id' for #<Profile::ActiveRecord_Relation:0x007fc02ca8f608>
[08:18:30] iliketurtles: where are you invoking a #user_id method?
[08:19:15] basichash: iliketurtles: i don't know, i shouldn't be. it is in my permit function, dunno it that matters or not
[08:19:37] iliketurtles: well that exception states that you are calling the #user_id method on an ActiveRecord::Relation
[08:19:51] iliketurtles: so you must be doing that somewhere. check the stack trace for a line number
[08:20:19] basichash: iliketurtles: ah it's in the show template
[08:20:25] basichash: for profile
[08:20:42] freezevee: can someone please help me with that https://stackoverflow.com/questions/28370980/how-to-show-nested-form-attributes-in-ruby-on-rails-4-2 ?
[08:20:43] basichash: don't understand why that's not working though
[08:20:54] iliketurtles: @profile = Profile.where(username: params[:username]).first perhaps
[08:21:24] iliketurtles: the active record query methods like .where, .order, .limit return a ducktyped array, called an ActiveRecord::Association
[08:21:46] iliketurtles: so you've essentially got an array with size == 1, the only element being a Profile. and you're trying to invoke #user_id on the array, instead of the Profile
[08:23:55] Spami: hum , in rails 4, a controller with a namespace doesn't load the default layout anymore?
[08:25:35] Spami: uh, my bad
[08:25:56] ivanskie: anyone know if there'll be videos from the rubyconf?
[08:27:34] basichash: ivanskie: hmm strange, so params[:username] isn't return the /:username param properly
[08:27:40] basichash: iliketurtles: ^
[08:28:17] basichash: changing to where(username, 'username').first does return a User instance
[08:28:24] iliketurtles: what does `p params` look like
[08:28:54] iliketurtles: and what does `rake routes` in terminal give you
[08:29:12] basichash: iliketurtles: ah ok there's no :username param, only an :id param
[08:30:22] basichash: ah ok i didn't put the route in before resources :profiles
[08:31:27] basichash: although putting it before the resources profile, now I get uninitialized constant Profile
[08:31:39] basichash: in route_set.rb
[08:37:00] iliketurtles: gist your routes plz
[08:37:24] iliketurtles: and remove any routes you are not using
[08:55:51] freezevee: can someone please help with this https://stackoverflow.com/questions/28370980/how-to-show-nested-form-attributes-in-ruby-on-rails-4-2 ?
[08:59:00] mozzarella: xibalba: I have never seen that person.
[08:59:08] mozzarella: xibalba: I have never seen that person.
[09:00:25] Varun_krishna: Hi guys I am getting an error in this https://gist.github.com/Varun-Krishna-P/ae9724e4e3fc664fa407
[09:03:12] errakeshpd: for many rails projects not specifying gems in the gemfile , its splited and kept in some other folders
[09:04:09] errakeshpd: what was the reason and when we are creating rails new project then all gems are specifying in the Gemfile only, which one is the standard way?
[09:07:39] agent_white: errakeshpd: The standard way to include gems in your project is through the Gemfile.
[09:08:08] agent_white: Most likely, if a project has the gem source, they have made some custom modifications to it.
[09:08:29] freezevee: can someone please help with this https://stackoverflow.com/questions/28370980/how-to-show-nested-form-attributes-in-ruby-on-rails-4-2 ?
[09:09:08] errakeshpd: <agent_white> https://github.com/instructure/canvas-lms
[09:10:02] errakeshpd: <agent_white> https://github.com/instructure/canvas-lms/blob/stable/Gemfile
[09:13:31] errakeshpd: is there any issue when i specify gem 'adminlte-rails'
[09:13:31] errakeshpd: gem 'bootstrap-sass' these two gems in gemfile ? any class conflicts ?
[09:13:48] Varun_krishna: Hi guys, can you please help me with this https://gist.github.com/Varun-Krishna-P/ae9724e4e3fc664fa407 ?
[09:14:52] dopie: nothing much just have a man to man combat with capistrano
[09:15:01] dopie: have = having
[09:15:45] Varun_krishna: dopie: Oh, why is everyone facing the same problem.
[09:16:32] dopie: well i can somewhat solve it but its a bit weird
[09:17:29] dopie: https://gist.github.com/staycreativedesign/05efcad5264ad7c2a53c
[09:17:36] Varun_krishna: dopie: Oh, good luck then. So for how log nyou have been programming in RoR ?
[09:17:51] dopie: not that long
[09:19:49] Varun_krishna: dopie: Can you help me with my gist ?
[09:20:01] dopie: I sure can try
[09:20:02] dopie: but i suck
[09:20:21] sevenseacat: references isnt a column type
[09:20:35] sevenseacat: user_id will be an integer'
[09:21:19] Varun_krishna: sevenseacat: Ok but this is given in $ bin/rails generate migration AddUserRefToProducts user:references the docs .
[09:21:33] dopie: found the error
[09:21:47] dopie: sevenseacat, how goes there grumpy cat
[09:22:25] Varun_krishna: sevenseacat: Ok I will change it to integer. Yeah here is the link http://guides.rubyonrails.org/active_record_migrations.html
[09:22:45] sevenseacat: yes, thats different to what you did.
[09:23:03] sevenseacat: note the name of the migration, and the contents of it.
[09:23:59] sevenseacat: i also dont know what version of rails you're using, so dont know if that shortcut is even valid.
[09:24:39] Varun_krishna: sevenseacat: Ok so is this 'add_user_id_to_vehicles ' is what causing trouble ? I use 3.2.19
[09:24:45] sevenseacat: and the guides are for rails 4
[09:24:57] errakeshpd: <Varun_Krishna> add_column :vehicles, :user_id, :integer , :references => "user"
[09:25:12] sevenseacat: use http://guides.rubyonrails.org/v3.2.21/migrations.html
[09:27:18] Varun_krishna: sevenseacat: Yeah sorry. I think I had used that references when creating a model.
[09:27:24] sevenseacat: quite possibly
[09:27:25] Varun_krishna: sevenseacat: Thank you :)
[09:28:32] Varun_krishna: Yeah now I remember I did something like this rails generate model ModelName column1:string column2:string referenceColumn:references, while generating the model it added belongs_to in the model.rb
[09:29:23] Varun_krishna: errakeshpd: Thanks
[09:35:13] alecs: I am using a rails 3 app, and i would like setup my app to use multiple Gemfiles. Any ideeas how to do that ?
[09:36:07] ferr: If I need to fill in details on external website, submit form and then redirect to that site, how do you suggest to do this?
[09:41:56] dopie: alecs, why would you need multiple gemfiles?
[09:42:53] alecs: dopie: I have a big GEmfile, and i would like to split it in Test and Production
[09:43:17] xibalba: how big can it be?
[09:43:38] alecs: 208 lines
[09:44:29] alecs: But also, i am trying to clean it up., as i have a lot of gems that are commented,
[09:45:29] sevenseacat: delete the commented lines
[09:45:38] sevenseacat: dont split it out into multiple Gemfiles, that achieves nothing
[09:50:12] alecs: sevenseacat: dopie xibalba Thnaks
[09:53:28] xibalba: what is your app alecs
[09:53:49] alecs: Not opensource
[09:56:25] freezevee: can someone please help with this https://stackoverflow.com/questions/28370980/how-to-show-nested-form-attributes-in-ruby-on-rails-4-2 ?
[09:59:44] xibalba: did you put accepted nested attributes in your model?
[09:59:52] sevenseacat: freezevee: you dont have a nested form
[10:00:00] sevenseacat: use fields_for with the nested model
[10:08:19] freezevee: sevenseacat: do I need to use fields for for every attribute ?
[10:08:31] sevenseacat: no, for the nested model, the user_info model.
[10:08:54] sevenseacat: i dont know why you would have it as a separate table, but whatever.
[10:09:12] freezevee: sevenseacat: If I want to display the html inputs of the nested model (user_info) in different locations of the page
[10:09:23] freezevee: mixed with user model ones
[10:09:27] sevenseacat: you want multiple forms on the page? huh?
[10:09:41] freezevee: not multiple forms
[10:10:19] freezevee: it's the user and the user_info model. I want to be able to use user.user_info.firstname in a div and user.username in another div
[10:10:32] sevenseacat: whats stopping you from doing that
[10:10:52] sevenseacat: thats got nothnig to do with a form either
[10:10:55] freezevee: If I use a fields_for for the nested model I must use all my user_info attributes inside that "loop"
[10:11:20] sevenseacat: correct, but you can have more than one
[10:11:32] freezevee: I don't want them all in the same place
[10:11:49] freezevee: I don't want them all gathered inside a fields_for ...end tag
[10:12:53] freezevee: because I want to show the field for user.email, user.user_info.username and then user.id
[10:13:07] freezevee: and then again user.user_info.firstname
[10:13:11] sevenseacat: whats that got to do with not wanting to have the username field inside a fields info block
[10:13:15] sevenseacat: *inside a fields_for
[10:13:17] freezevee: so I must write two field_fors
[10:13:24] sevenseacat: as i said, you can have more than one
[10:13:50] freezevee: so you're saying that every time I want to use a nested model's attributes I must do a fields_for....end for that model
[10:13:58] freezevee: do I understand right ?
[10:14:09] sevenseacat: if you want nested model attributes in a form, that is how you do it, yes.
[10:14:36] freezevee: basically it should be pretty simple but I thought there would be a DRY way to do this
[10:14:59] freezevee: not repeating fields_for every time, but it's not a big deal
[10:15:02] sevenseacat: whats not DRY about having each form you want on the page, iterated on the page?
[10:15:03] freezevee: it won't hurt :P
[10:15:44] freezevee: If you want to write a <%= f.username :username %> is different than including it every time in a fields_for tag
[10:15:59] sevenseacat: DRY is about not repeating ideas, not about not repeating code
[10:16:11] freezevee: thanks for that
[10:16:19] freezevee: I haven't thought about it that way
[10:16:24] sevenseacat: your somewhat illogical idea of putting user data in two tables means that your code is now more complicated
[10:16:42] freezevee: you know there is no reason to "touch" the devise table
[10:16:53] sevenseacat: there is no such thing as a 'devise' table
[10:17:12] freezevee: the one that devise creates as a default for it to function
[10:17:19] sevenseacat: devise does not create a table
[10:17:22] sevenseacat: you add devise to a model
[10:17:33] sevenseacat: and to that model's table
[10:18:20] freezevee: but there's a lot of code to override controllers of devise and stuff
[10:18:27] sevenseacat: thats got nothing to do with fields on a table
[10:18:40] freezevee: When there's a separate table for all the information I feel it like it's more clean and organized
[10:18:51] sevenseacat: and now your code is not
[10:18:54] freezevee: well it's the whole concept
[10:19:10] sevenseacat: i'm not sure what concept youre referring to
[10:19:16] freezevee: this is not an one way thing, it has pros and cons in each implementation
[10:19:43] freezevee: I don't feel comfortable overriding devise stuff
[10:19:50] sevenseacat: what exactly ar you overriding?
[10:19:56] freezevee: it's more like "someone more experienced did it"
[10:19:59] sevenseacat: other than the form for the edit view
[10:20:04] sevenseacat: which you're doing anyway
[10:20:08] freezevee: and I am going to put my dirty hand in it
[10:20:45] rushed: freezevee: what are you building?
[10:20:48] freezevee: sevenseacat: I read a lot of customizations needed to add custom fields to the "Devise table"
[10:21:43] freezevee: rushed: I have followed HArt's guide on building a custom authentication implementation
[10:21:54] freezevee: and now I decided to use devise for the first time
[10:22:12] rushed: freezevee: for what, what does the site do that you're auth'ing into?
[10:22:12] freezevee: I had all the user information in one table when did it custom
[10:22:39] freezevee: you signup, get confirmed, login and view your profile
[10:22:51] freezevee: basic stuff but with a lot of user information
[10:23:18] freezevee: I have almost 30 fields in the user_info table so I decided to split them in two for easier coding
[10:23:48] freezevee: I didn't know that it was somehow more complicated than usual to use the for as sevenseacat: said
[10:23:58] freezevee: the form* (sorry)
[10:24:48] freezevee: and devise custom fields have all these things about sanitizers and stuff which scare me a little tbh
[10:28:26] freezevee: sevenseacat: do I have to use accepts_nested_attributes_for in the nested model
[10:28:46] sevenseacat: you're going to need to modify the sanitizers anyway, because you're adding fields to the user form
[10:28:57] sevenseacat: not in the nested model, in the parent user model.
[10:30:04] freezevee: you mean when I am going to persist them to the db ?
[10:30:21] sevenseacat: yes, if you want to actually save the fields you're adding to the form
[10:33:23] Varun_krishna: Hi guys I have a problem here. When I try to create a vehicle, it is saving the values to the data base, but when returing the index page it shows an error https://gist.github.com/Varun-Krishna-P/1baf1f5cea1f978132ec
[10:34:41] sevenseacat: Varun_Krishna: what route are you trying to use?
[10:35:33] Varun_krishna: sevenseacat: redirect_to user_vehicles_url
[10:35:44] sevenseacat: thats not what route you're using
[10:35:53] sevenseacat: whats on app/views/vehicles/index.html.erb:30
[10:36:42] Varun_krishna: sevenseacat: Ok I will post that index file.
[10:36:53] sevenseacat: or just say whats on that line
[10:37:38] Varun_krishna: <%= link_to "View", user_vehicle_path(vehicle.id) %>
[10:38:06] sevenseacat: ok, now check what parameters that route (user_vehicle_path) requires
[10:38:16] sevenseacat: it requires more than you're giving it
[10:39:27] Varun_krishna: sevenseacat: user id right ?
[10:39:32] freezevee: sevenseacat: thanks, it worked. I bet it's a lot harder to persist them successfully but I guess I'll make it
[10:39:43] sevenseacat: freezevee: good luck.
[10:39:47] sevenseacat: Varun_Krishna: you tell me
[10:40:30] Varun_krishna: sevenseacat: Is this the clue GET /users/:user_id/vehicles/:id(.:format) ?
[10:40:38] sevenseacat: yep, look what params it needs
[10:41:31] Varun_krishna: sevenseacat: Ok I am saving the user_id in vehicles table. so can I be able to access it like this vehicle.user_id, vehicle.id ?
[10:41:46] sevenseacat: Varun_Krishna: you tell me
[10:42:03] sevenseacat: its easier to try things out, than ask me if they'll work
[10:42:09] Varun_krishna: sevenseacat: Ok I'll better change the code and tell .
[10:45:06] Varun_krishna: sevenseacat: Lol, it woked thank you. So I wnated to learn more about nested routes.
[10:46:24] Varun_krishna: sevenseacat: Sorry for the trouble :)
[11:02:19] Varun_krishna: sevenseacat: <%= link_to "My Account", user_path(User.find_by_uid(session[:user_id])) %> is this not the best way to do it right ?
[11:30:54] sevenseacat: hello pontiki
[11:31:29] pontiki: how's things?
[11:35:10] sevenseacat: cant complain... is weekend
[11:36:04] aZtec_: slightly unorthodox question, mainly for DB geeks: I have a multitable inheritance setup
[11:36:34] aZtec_: (no that's not the problem yet ;) )...but i have a few AR-models pointing to that MTI-setup...
[11:37:09] aZtec_: obviously every referencing table needs a foreign key for every table that inherits from the MTI-superclass
[11:38:00] aZtec_: does it make sense from a codequality/performance POV to have a wrapper model, so that I can only need one referencing column (eg. mti_wrapper_id:integer)
[11:38:23] aZtec_: instead of mti_tableone_id:integer, mti_tabletwo_id:integer, mti_tablethree_id:integer etc...?
[11:44:33] P-NuT: Hi all, can someone explain to me what a partial is and when I would use it?
[11:47:06] errakeshpd: <P-NuT>use when you want use a block of code in different views 'DRY' http://guides.rubyonrails.org/layouts_and_rendering.html
[11:47:33] aZtec_: P-NuT a partial is a view-file that only displays a tiny bit of a complete page
[11:51:15] P-NuT: Can I use partials to update only part of a page every 5 seconds or so?
[11:51:51] P-NuT: For example if I had it display the time using seconds it could refresh every 1 second.
[11:52:17] rushed: P-NuT: your example should be done via js on the client
[11:53:40] rushed: P-NuT: either way, a partial is only used to create a fragment of html, any polling or updating would need to be explictly performed
[11:57:48] P-NuT: Ok, so the example I want to use would be best performed with a partial to write the date, but some js to reload that partial every 1 second.
[11:58:36] pontiki: that would be a horrible waste of bandwidth and server time
[12:06:29] aZtec_: P-Nut, assuming you use jQuery: setTimeout(function() { $('.time-element').text(somehow_fetch_current_time) }, 500)
[12:07:18] aZtec_: somehow_fetch_current_time = function() { cur = new Date(); return cur.getHours() + ":" + cur.getMinutes() }
[12:07:35] aZtec_: and don't use underscores, that's ruby syntax :D use camelcase instead
[12:07:45] aZtec_: but don't call your function like that anyway ;)
[12:55:57] tabish: Has anyone used the following for data modeling? : http://staruml.io/
[13:04:14] poikon: Hi all. So i???ve never really done i18n with routes in rails (always used query params or cookies) but now I???m trying set the locale via the `scope ???(:locale)??? ???` approach in routes.rb, but I???m hitting all sorts of issues
[13:05:58] poikon: i???m hitting a redirect loop when i try to login (devise), seems to try to redirect from /locale/users/sign_in to /users/sign_in
[13:06:17] poikon: and i???m guessing g that tries to redirect back to the locale
[13:18:57] alfie_max15: Anyone here???
[13:19:03] alfie_max15: in a bit of trouble..
[13:28:27] tabish: what kind of trouble alfie_max15
[13:28:34] tabish: jail time?
[13:43:30] mostlybadfly: Could someone help me with nested attributes in here: https://gist.github.com/mostlybadfly/c710d5985c95342c8218 . I can get the form to submit the Recipe and Ingredient attributes, and the ingredient is being tied to the correct recipe ID but :name and :quantity return as nil
[13:54:14] tabish: mostlybadfly: you need to have the .build in your new method not create
[13:57:52] tabish: mostlybadfly: https://gist.github.com/tabishiqbal/174c0362422e99fd013a
[14:02:27] tabish: mostlybadfly: did it work?
[14:02:58] mostlybadfly: thanks tabish looking now, I did the change to putting it under new
[14:03:06] mostlybadfly: but it seems like it doesn't save any ingredients at all
[14:04:29] tabish: whats your schema like?
[14:04:42] tabish: and are you adding a recipe via the console?
[14:05:27] mostlybadfly: tabish: https://gist.github.com/mostlybadfly/1b1f8ae9dbddd578ddc3
[14:05:35] mostlybadfly: it works via the console
[14:05:42] mostlybadfly: it seems like the form doesn't work or something
[14:08:33] tabish: your form you have recipe_form.fields for :ingredients
[14:09:07] tabish: sorry lol
[14:09:41] mostlybadfly: i was like omg it would be that haha
[14:10:17] mostlybadfly: not sure if this helps but from console https://gist.github.com/mostlybadfly/0bfc14cbdbc7f386f21e
[14:23:33] pontiki: morning, take 2
[14:28:22] tabish: mostlybadfly: sorry just caught up in something
[14:32:49] mostlybadfly: tabish: that's cool
[14:38:11] tabish: mostlybadfly: everything seems ok, you don't have a lot of data /models do you? maybe do a db:reset
[14:38:56] mostlybadfly: yeah, i've tried all that, it's so confusing
[14:39:57] mostlybadfly: no, it's just the two models
[14:56:46] tabish: mostlybadfly: wanna push your changes to your git
[14:57:39] mostlybadfly: tabish: I just did, it is under the add-user-form branch
[15:03:12] rikkipitt: Hey guys, are dynamically named scopes possible in AR/Rails? https://gist.github.com/anonymous/900014b510f4d7db804a
[15:04:22] rushed: rikkipitt: you generally don't want to hardcode dependencies on db ids
[15:05:01] rikkipitt: rushed: i know, that was just a test for a gem i'm trying out
[15:05:28] rikkipitt: but is there a way of adding a scope per parent relation dynamically?
[15:06:47] nickjj: how would you setup a helper method to concat a block that's been passed to it? , example: https://gist.github.com/nickjj/d464868223d8e2f2451a
[15:09:51] Sylario: I am testing locomotiveCMS, and it really feel like a nice tool. Also it gives me the opportunity to test liquid or DragonFly
[15:12:23] BAMbanda: what happened to ryan bates?
[15:15:34] arup_r: anybody would help me in refactoring one class ?
[15:18:51] arup_r: universa1: you there?
[15:43:41] alecs: BAMbanda: I dunno ... I wonder the same thing
[15:43:50] alecs: arup_r: what do you need ?
[15:44:51] arup_r: I want some pointers to break this class,, I mean refacoring,, I am confused... https://gist.github.com/aruprakshit/a20ec961bc1c311e080d
[15:47:16] alecs: arup_r: sorry :( ...
[15:51:15] BAMbanda: <tag attribute="<%= ruby_code %>">
[15:51:20] BAMbanda: are the double quotes necessary?
[15:51:56] alecs: BAMbanda: depends what is the output of ruby_code
[15:51:57] infoget: I would like to extend Redcarpet class, where is best way save extended file?
[15:54:31] BAMbanda: alecs, its a property of a model
[16:14:00] arup_r: In rails suppose I have :xml_template ... How can I make it a class like XmlTemplate runtime ?
[16:14:26] fretwizz: New to Ror. Is there a way to put a rails install one level above web root?
[16:15:20] fretwizz: if you can, please
[16:18:51] fretwizz: Anyone in here able to answer a question about RoR?
[16:18:59] naftilos76: Hi i have a rails (4.2) website in /home/john/rails/rails_website . What defines the user that will execute system commands from this website? I can of course do `whoami` and get the user but what is it that really defines the user? Is it the home folder 'john' , the owner of the rails website folders tree , the owner of a specific file in that tree? Can anybody advise?
[16:19:59] naftilos76: Ask fretwizz. Don't ask if you can ask! I have done the same question when i first came here and i got the very same answer. :-)
[16:20:15] fretwizz: I understand ;)
[16:21:07] fretwizz: I???m wondering if there is a way, or if it???s even preferable, to place a RoR installation one level up above web root.
[16:23:07] naftilos76: What do you mean when you say web root?
[16:23:19] fretwizz: public_html or www
[16:23:46] fretwizz: where you generally place all files you want visible on the web
[16:24:25] naftilos76: well you usually have to symbolically link www to public_html or your rails app public
[16:25:04] naftilos76: it would be better if you explained what exactly it is that you wish to accomplish
[16:25:51] fretwizz: I???ve only created a RoR installion locally, my ISP just installed in up above web root
[16:26:25] fretwizz: Is that generally where a RoR install gets placed (unlike many other things they auto-install for you)?
[16:26:43] fretwizz: I guess that might depend upon the ISP ;)
[16:27:23] naftilos76: the installation may be located virtually anywhere as long as you create the proper symbolic link www points to
[16:27:33] naftilos76: do you have ssh access?
[16:27:54] jammanbo: It's tangental to the topic, but is anyone successfully using Ember Data to access shallow nested resources in Rails? I can't find a simple solution for adding the parent resource to the URL.
[16:27:56] rushed: fretwizz: rails deployments generally require an application server, meaning deployment isn't usually just copying files into an existing structure
[16:28:30] fretwizz: rushed: I was wondering how that worked because I need to do that locally.
[16:28:41] fretwizz: But I???ve never done in on an ISP before
[16:29:01] naftilos76: fretwizz: He is right man, do you have a server installed andd configured?
[16:29:13] fretwizz: So, it seems, you???re saying it???s really no different
[16:29:46] naftilos76: there is no difference as long www points to your rails public folder
[16:29:59] naftilos76: as long as www...
[16:30:03] fretwizz: I see, thanks!
[16:30:41] arup_r: In rails suppose I have :xml_template ... How can I make it a constant like XmlTemplate runtime ?
[16:32:00] arup_r: "xml_template".classify.constantize is the answer founf it
[16:33:27] naftilos76: I have a rails (4.2) website in /home/john/rails/rails_website . What defines the user that will execute system commands from this website? I can of course do `whoami` and get the user but what is it that really defines the user? Is it the home folder 'john' , the owner of the rails website folders tree , the owner of a specific file in that tree? Can anybody advise?
[16:34:50] bratsche: It's who the program is run by. If you're logged in as john and run it, then it's john.
[16:38:05] naftilos76: bratsche: you do not have to login by ssh or start by a terminal. Imagine that this is a server that reboots and when apache or nginx or any other server start they point to a rails website locate in a custom path /home/mary/rails/rails_website. What is the verdict for that case?
[16:40:28] rushed: naftilos76: apache and nginx aren't rails application servers
[16:41:01] naftilos76: I did not say they were but they also can serve as one, right?
[16:41:08] rushed: naftilos76: no
[16:41:32] naftilos76: Sorry, i missed the passenger step :-)
[16:41:42] bratsche: naftilos76: Either wya, it depends on what system you're on. On Debian you'd probably use start-stop-daemon and it can set the user.
[16:41:45] naftilos76: or whatever that is...
[16:42:36] lapide_viridi: I've got a few raspberries hooked up as server, but sometimes, one seems to crash. Is it possible to use ruby from another pi, which pings the other servers and then sends a mail if one or several don't respond?
[16:43:17] lapide_viridi: I can't find anything about pinging in the docs. Also, I'm unsure of how to send the mail.
[16:44:57] naftilos76: bratsche: Can you suggest how specifically it would be done in a case where a ubuntu system uses apache+passenger to run a rails app?
[16:46:24] bratsche: naftilos76: I'm pretty sure that is documented pretty thoroughly on Passenger's website somewhere, try looking around there.
[16:46:46] naftilos76: i am looking. Thanks man
[16:46:58] bratsche: Sure, good luck
[16:47:12] capin: lapide_viridi: you can send email using rails mailers, there's a guide on that topic
[16:47:54] pontiki: lapide_viridi: what you ask ins't anything to do with rails, specifically. what you're probably looking for is typically called "health checks". it can be implemented in most any language. frequently a rails application will implement a health check *response* so the monitor can tell if the rails app is running
[16:48:36] lapide_viridi: Well, primarily with ruby, at least.
[16:48:58] pontiki: the pony gem is a good one for sending mail
[16:51:49] pontiki: monit is a fairly common system health monitor
[16:52:00] pontiki: nagios as well
[16:52:33] pontiki: god is similar written in ruby
[16:52:52] lapide_viridi: The goal is to DIy, and not use a health monitor. But thanks for the pointers.
[16:57:38] helpa: good morning IRCers, I hope that this day finds you hale and hearty
[17:01:01] BAMbanda: boombadaroomba, good morning
[17:01:06] BAMbanda: helpa, good morning
[17:22:47] cmeks: I'm having trouble understanding how to make a select box
[17:22:57] cmeks: i'm trying to get a select box of all the users currently in the database
[17:23:10] cmeks: and the values will be their id's
[17:23:24] tmatthews0020: the checkbox would be their id?
[17:23:40] cmeks: well not checkbox, select box
[17:24:22] pontiki: what have you written so far, cmeks ?
[17:24:32] tmatthews0020: you could just add the user id as the value then?
[17:24:33] cmeks: <%= collection_select(:user, :id, User.all, :id, :name) %>
[17:24:49] cmeks: but i don't know how to access the value of hte users id within the controller based off the selection
[17:26:37] cmeks: I just don't understand why i'm passing in so many parameters
[17:26:49] cmeks: and what to do with each parameter
[17:27:11] pontiki: hmm, it should be coming in 'user[id]'
[17:27:32] cmeks: so would i access the id as params['user[id]']
[17:27:41] pontiki: in params, it would be 'params['user']['id']
[17:27:47] cmeks: ohhhhhhhhh
[17:27:52] cmeks: ok let me try that
[17:27:52] pontiki: oh, yeah :)
[17:28:34] pontiki: in your strong params, you'd do something like: params.require(:user).permit(:id)
[17:30:05] cmeks: hooray it worked! thank you! :)
[17:40:59] tmatthews0020: i have a design question
[17:41:18] tmatthews0020: i want to implement a language choice for users.
[17:41:38] tmatthews0020: so they would be able to choose from a list of languages ruby,c++, scala....etc.
[17:42:12] tmatthews0020: whats the best way of implementing something like that in a database and how should i associate it to a user.
[17:44:36] pontiki: Language has_many :users; User belongs_to :language
[17:44:55] pontiki: use your own nouns
[17:54:11] nerium: Anyone knows a good notification system for rails? I need to how notifications to my users in some way
[17:57:57] tmatthews0020: pontiki: ohhh that makes sense. i had been thinking of it the other way around and it was kind of tripping me up.
[17:59:11] rushed: nerium: vagueness, you haz it~
[17:59:36] nerium: rushed: I'm not following :p
[18:00:54] rushed: nerium: your question is very vague
[18:01:07] nerium: Aha, sorry about that
[18:01:55] nerium: I'm looking for a way to show a particular message to all of my users once (it would be nice if this was definable somewhere)
[18:02:18] nerium: It's enough if it's just visible in the HTML, then I can style it or process it using js
[18:05:33] nerium: Any idea?
[18:06:03] cmeks: Nerium, why not, like on the front page (or wherever the majority of your users hang out on the site) reserve a small space for posting announcements
[18:06:18] cmeks: as an admin you can put in a button somewhere that only you can see that will allow you to edit that announcement
[18:06:31] cmeks: you can even store announcements over time and display them on an announcements page
[18:06:44] cmeks: if you want to send an email whenever you write a new announcement you can do that too
[18:07:15] cmeks: just spitballing here
[18:07:23] nerium: cmeks: I was more looking for a automated way of posting message. A message should for example only show once for every user. It should contain a link, a message. Some custom data for the view and so on
[18:08:05] cmeks: ok how do i private chat on IRC's
[18:08:41] nerium: cmeks: Take it publicly :)
[18:09:57] cmeks: nerium: i'm not getting what your trying to do, honestly havn't tried to do a flash announcment that disappears after being displayed. Try looking up announcements and cookies on google or something
[18:10:13] cmeks: i say look up on google couse i don't know how to do it haha
[18:10:34] nerium: I think I'm not to clear about what I'm looking for
[18:10:39] nerium: I'll post an example
[18:13:45] nerium: cmeks: https://gist.github.com/oleander/8e5b19cb7a6972ad1c68
[18:17:42] nerium: cmeks: Is is clearer :) =
[18:21:20] cmeks: woops sorry
[18:21:23] cmeks: i was doin the dishes
[18:25:55] pontiki: no apologies needed for doing chores! only apologize for NOT doing chores! :D
[18:27:37] nerium: Anyone else has an idea?
[18:27:47] nerium: looks like I've to build my own
[18:28:59] rhizome: looks like you mostly have already
[18:29:46] nerium: no, that's just a dsl
[18:31:25] fretwizz: Does anyone use AMPPS (and its installation of mysql) to power a RoR app?
[18:32:59] rushed: fretwizz: that doesn't look like something that is going to serve a rails app out of the box, that said, rails doesn't care where the db comes from as long as you configure your database connection settings correctly :)
[18:34:46] fretwizz: thanks, rushed.
[18:48:58] apricity: I want to add comments to a rails blog. Anyone have any suggestions for any good gems?
[18:49:20] apricity: I was looking at disqus and the_comments
[18:50:32] rushed: apricity: https://www.ruby-toolbox.com/categories/rails_comments ... however rails is kind of overkill for a blog, you might checkout one of the dedicated blogging platforms
[18:51:55] apricity: thanks rushed... I'll check that out. I've already built it though partly as a way to get my feet wet in rails.
[18:52:18] fretwizz: I ran this: https://raw.github.com/RailsApps/rails-composer/master/composer.rb, and I chose sqlite. I???ve never used sqlite before, did it get installed?
[18:52:22] rushed: apricity: great, chalk it up as a learning experiance and then go use something nice :P
[18:53:05] pontiki: fretwizz: have you tried running: rake db:create?
[18:53:18] fretwizz: Ah??? forget that ;)
[18:54:09] fretwizz: I think the generator ran it, says it exists
[18:54:30] fretwizz: in the db folder there is development.sqlite3
[19:15:42] rhizome: now rake db:migrate
[19:20:16] dopie: hey all im in rubular.com and im using the quick reference
[19:20:33] dopie: i did a /\d/ for any digit
[19:21:06] dopie: puts "2" =~ /\d/
[19:21:16] dopie: is wrong?!
[19:21:42] weaksauce: dopie well it will just tell you the position of the match
[19:22:25] weaksauce: try "abc123" =~ /\d/ and it should be 3
[19:22:45] weaksauce: and then try "abc" =~ /\d/ and it should be nil
[19:23:21] rushed: dopie: 0 is truthy
[19:23:22] tabish: using devise, I'll have employees (who will have access to the application), contractors (who will not have access to app but people would have to know they are contractors), and admin. Should I make two separate devise models only? User & Admin. In user just have 'type' which would be a dropdown if they are employee or contractor. Sound right?
[19:23:46] dopie: basically what i was trying to do is enter
[19:23:56] dopie: make sure the user enters a number ..
[19:24:26] weaksauce: just a number?
[19:24:54] rushed: dopie: http://guides.rubyonrails.org/active_record_validations.html#numericality
[19:25:25] weaksauce: "123" =~ /^\s*(\d)+\s*$/
[19:29:06] nickjj: is anyone else still getting this bug in devise 3.4? https://github.com/plataformatec/devise/issues/2934#issuecomment-38470704
[19:30:09] weaksauce: tabish devise handles authentication. look up something like pundit for the authorization
[19:30:11] tabish: nickjj: i was but used that code and after that it worked...the code thats suggested
[19:31:16] nickjj: tabish, which? the comment that links to SO which says to override the sessions controller?
[19:32:15] tabish: nickjj: link_to 'Sign out', destroy_user_session_path(:authenticity_token => form_authenticity_token()), method: 'delete'
[19:32:41] tabish: that's the only way it works for me. otherwise it wouldn't at all
[19:33:31] nickjj: and you only get the bug when you have remember me checked right?
[19:34:15] tabish: umm yea i believe so. this was a while back
[19:34:27] nickjj: ok, your proposed solution works for me too btw
[19:34:28] rhizome: dopie: unless thing.downcase.scan(/^\d*$/).empty?
[19:34:40] tabish: ok good. it's weird they haven't fixed it yet =\
[19:34:48] rhizome: actually don't need the downcase
[19:34:49] nickjj: tabish, thanks. maybe one of us should open a ticket?
[19:34:57] nickjj: seems like a pretty severe bug
[19:35:06] tabish: np. yea we should lol
[19:37:55] RomanSu: Hi there, any ideas how i could get something like num.to_s.to_i(10).to_s(32) that also uses big chars?
[19:38:08] RomanSu: Basically i want to display a ID in the shortest way possible and url friendly
[19:40:08] weaksauce: what are you trying to accomplish RomanSu?
[19:40:49] nickjj: tabish, i reported it and credited you
[19:40:58] tabish: weaksauce: thanks. is pundit better or cancancan ?
[19:41:07] weaksauce: tabish I like it better
[19:41:37] tabish: which one? lol pundit?
[19:42:00] tabish: from what i have read people say pundit is easy to handle where cancancan is a beast and can get pretty big
[19:42:25] nickjj: tabish, i'm currently using pundit too
[19:42:29] weaksauce: I like pundit better
[19:42:37] tabish: ok cool. thanks!
[19:42:39] weaksauce: separates things out nicely and is easy to reason about
[19:43:23] BAMbanda: does anyone know why my "<" sign is not displaying?
[19:43:24] BAMbanda: https://gist.github.com/anonymous/5ee3de329f518cbd8ac6
[19:44:18] tabish: BAMbanda: you need to use this in your html: &#60;
[19:45:10] rushed: RomanSu: https://github.com/dougal/base58
[19:46:19] BAMbanda: tabish, ok cool, what's the reason for that?
[19:46:26] BAMbanda: is that just an html5 thing?
[19:46:36] tabish: http://www.ascii.cl/htmlcodes.htm
[19:46:54] BAMbanda: it appears to be doing the same thign
[19:47:00] tabish: gist your code
[19:47:06] nickjj: BAMbanda, you may want to consider using css to output your breadcrumb separators too
[19:47:44] pontiki: &gt; should give >
[19:48:10] pontiki: can you look at the html source generated and see what's there?
[19:48:30] RomanSu: awesome rushed! thanks!
[19:48:48] BAMbanda: https://gist.github.com/anonymous/fc042ca084c2edd2eb72
[19:49:33] pontiki: well, okay, you already changed it. does that display what you're expecting?
[19:49:52] alecs: Does anyone knows how to use devise for authentication in rspec request specs: i get : " undefined method `env' for nil:NilClass" in "gems/devise-3.4.1/lib/devise/test_helpers.rb:24:in `setup_controller_for_warden"
[19:50:05] BAMbanda: i see under view-source that it does indeed have the ascii code after the link, but it does not render as a "<"
[19:50:35] pontiki: how odd...
[19:51:08] pontiki: no, if that's the rendered source, how come it has erb tags in it still?
[19:51:29] BAMbanda: what you saw on github is raw code, its not compiled
[19:51:42] pontiki: i asked for the *rendered* html source
[19:52:02] BAMbanda: https://gist.github.com/anonymous/dedacfaf7570d8d14049
[19:53:48] rushed: BAMbanda: if the &lt; or &gt; are making it to the browser, what's the problem?
[19:54:09] tabish: BAMbanda: wheres the hanafi schools? lol
[19:54:11] pontiki: i wonder what the css is for #breadcrumbs
[19:54:16] BAMbanda: its just not showing
[19:54:23] BAMbanda: tabish, im still workign on it lol i have a huge ontology
[19:54:41] rushed: BAMbanda: right-click, inspect element in chrome, figure out what's going on
[19:55:29] rushed: BAMbanda: if it's in the source you'll be able to find it, possible your CSS or layout is trolling you (white on white, clipped overflow, etc, etc)
[19:55:44] BAMbanda: rushed, i see, makes sense, thanks
[19:56:45] BAMbanda: tabish, are you perhaps from muslimadnetwork in california?
[19:58:11] tabish: BAMbanda: nope, I'm from Toronto. currently sitting in Dubai
[19:59:05] BAMbanda: ah ok i see, cool to know, do you have a twitteR?
[19:59:36] tabish: yea. tabishiqbal_
[20:00:09] BAMbanda: nice, i just followed you, I'm @coetry
[20:05:56] Cache_Money: is there a Rails helper to turn a `date_of_birth` attr into an age?
[20:06:16] Gambaroni: Any idea why I get the following error when submitting my form from the mobile? (iPhone..) "can't verify csrf token authenticity"
[20:09:29] rhizome: Cache_Money: distance_of_time_in_words
[20:10:34] dopie: ok im in rubular.com
[20:10:59] dopie: /\d/ selects all numbers
[20:11:30] Cache_Money: rhizome: that gives "about 30 years ago". I'm looking for "30"
[20:11:50] dopie: how would i select the first 3 numbers?
[20:12:23] jrizz: anyone ever used best_in_place ?
[20:12:28] weaksauce: dopie do you see the quick reference at the bottom? that is actually listed as one of the examples
[20:12:56] dopie: but why is it spacing
[20:13:13] weaksauce: why is it spacing?
[20:13:21] Cache_Money: rhizome: I ended up adding this method to my class http://stackoverflow.com/a/5613814/899904
[20:13:44] dopie: 305 123 444
[20:13:53] dopie: instead of 305
[20:14:22] weaksauce: because it is not anchored anywhere in the string.
[20:14:50] weaksauce: if you want the start of the string you need to anchor it there
[20:14:56] cmeks: i'm looking for a small little colorful circle glyphyicon
[20:15:08] weaksauce: otherwise regex will just match 3 consecutive digits
[20:15:10] cmeks: I want to used colorful circles to represent something being hidden, open, or closed
[20:15:23] cmeks: does anyone have any ideas where i can find a place with those
[20:15:28] cmeks: bootstrap doesn't have any
[20:18:51] rushed: cmeks: &bull;
[20:19:32] cmeks: rushed: &bull; ??
[20:19:58] rushed: cmeks: escape code for a bullet... ie a circle
[20:22:46] cmeks: how do i insert escape codes in a ruby statement
[20:22:57] cmeks: i have this right now.. <th> <%= link_to "&bull;" + trip.name, trip %> </th>
[20:24:15] rushed: cmeks: generally you wouldn't, you'd tag the link with a css class and deal with it in the stylesheet
[20:25:51] dopie: weaksauce, ok..
[20:26:01] dopie: @number.gsub(/\A+/,'(')
[20:26:15] dopie: gives me (3051234444
[20:26:44] dopie: gsub(/\A+\d{3}/,')')
[20:26:54] dopie: how would i put that in there
[20:27:48] weaksauce: why not just kill all the alpha characters and then just put in code_number = "(#{variable})"
[20:28:11] weaksauce: what are you actually trying to accomplish dopie ?
[20:28:24] dopie: def test_display_number
[20:28:24] dopie: p_number = PhoneNumber.new('1234567890')
[20:28:24] dopie: assert_equal('(123) 456-7890', p_number.to_s)
[20:28:37] dopie: thats what im tyrng to pas
[20:29:17] weaksauce: dopie look up number_to_phone here: http://api.rubyonrails.org/
[20:30:23] rushed: that was the long way around...
[20:30:46] dopie: is that available for ruby?
[20:30:53] weaksauce: yep. that's why we normally try to ask what people are actually doing.
[20:31:10] weaksauce: you could require activesupport if you want it.
[20:31:50] tabish: if you want to have a model that has some preset options that users can select from the drop down but also add their own later can I just have those preset options in the seed file?
[20:32:34] tabish: inventory type can be: serialzed, bulk, consumable (these are presets) but users can then add their own
[20:32:38] weaksauce: dopie you could use this since it's opensource: https://github.com/rails/rails/blob/44260581bec06e4ce05f3dd838c8b4736fc7eb1d/activesupport/lib/active_support/number_helper/number_to_phone_converter.rb
[20:33:11] weaksauce: or study it to see how someone would do it well.
[20:33:52] weaksauce: this is where that code gets called: https://github.com/rails/rails/blob/44260581bec06e4ce05f3dd838c8b4736fc7eb1d/activesupport/lib/active_support/number_helper.rb#L43
[20:34:54] rushed: dopie: if you're not in rails, why are you asking us? :P
[20:35:02] Gambaroni: Any idea why I get the following error when submitting my form from the mobile? (iPhone..) "can't verify csrf token authenticity"
[20:35:07] weaksauce: but in general dopie, asking questions in a rails room will get you rails answers
[20:35:50] rushed: Gambaroni: the was the token included in the post?
[20:36:42] rushed: Gambaroni: ie: no token + error = form/posting issue, token + error = session issue (or old token)
[20:38:02] dopie: weaksauce, corerct
[20:38:10] dopie: i like it here :)
[20:38:32] tc-coug: how is everyone today?
[20:40:26] tabish: its so much better here than the javascript channel lol most of the guys there are wack
[20:40:41] cmeks: for some reason a button specifying to delete a trip is overriding my update
[20:40:46] cmeks: i have <%= button_to "Delete this Trip", @trip, :method => :delete, class: "btn btn-primary" %> as the delete
[20:41:02] cmeks: <%= f.submit "Update my Trip", class: "btn btn-primary" %>
[20:41:04] cmeks: as the update
[20:41:17] rushed: cmeks: you can't nest forms in html
[20:41:58] rushed: cmeks: get it outside your form, then use css to put things where you want
[20:42:39] cmeks: yeah, that is what i'm doing
[20:43:06] rushed: cmeks: (or change it to a non form related html element and do it all in js)
[20:44:36] tc-coug: what does your delete route look like?
[20:45:11] tc-coug: typically you would have DELETE /controller/:id
[20:45:29] tc-coug: are you sure you want to pass the @trip to the delete method?
[20:46:06] cmeks: coug, i may just do js but here it is.. DELETE /trips/:id(.:format) trips#destroy, it's nested within trips_path. I put resources: trips on my routes file
[20:50:26] Gambaroni: rushed: the token is included. Then there is a session problem in the iphone I guess..
[20:50:27] tc-coug: when you look at the header on submit are you showing the DELETE, POST or PATCH?
[20:56:10] stef1a: can someone point me to a resource that explains how to include javascript in a rails application?.. i want to add sortable to my app: https://github.com/RubaXa/Sortable
[20:58:22] cmeks: stef1a: it's the same as html. just do <javascript> ... </javascript>
[20:58:50] tc-coug: *<script></script>
[21:00:16] workmad3: stef1a: also, you can put javascript files in app/assets/javascripts, and the default file app/assets/javascripts/application.js will pull all those files together into a single file, and your layout can include them all with a single '<%= javascript_include_tag 'application' %>' (which is in your default app/views/layout/application.html.erb)
[21:00:26] workmad3: stef1a: !assets for more info
[21:00:26] helpa: stef1a: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[21:01:07] stef1a: workmad3: thanks!
[21:02:46] tc-coug: I???ve got a more complex question I am hoping someone can help out with
[21:03:39] workmad3: tc-coug: !justask ;)
[21:03:39] tc-coug: I???ve got an Oauth Provider App (doorkeepr), a Client App using Devise and Omniauth-oauth2
[21:04:09] tc-coug: I want to have the client App call an API located on a different server
[21:04:36] tc-coug: how do I use the token to authorize on teh API?
[21:06:44] rikkipitt: hey guys has anyone seen a good awesome_nested_set recursive menu helper anywhere?
[21:09:02] anoob: i would like to permit full text searching active jobs (jobs.active = true) where the related company is also active (companies.active = true): http://pastie.org/9896266 ... The closest thing i've found was: http://stackoverflow.com/a/20912569/1906809
[21:09:21] anoob: But it's weird and ".result_ids" doesn't exist ...
[21:14:24] tejas-manohar: on os x 10.10 yosemite facing strange issue
[21:14:30] tejas-manohar: nvm this is for #ruby
[21:15:51] workmad3: tc-coug: first question - how do you authenticate against the other API?
[21:16:22] workmad3: tc-coug: as in, how do you get the token?
[21:16:23] tc-coug: I want to pass the token I get back from doorkeeper
[21:16:37] workmad3: tc-coug: ok, so you get the token...
[21:16:47] tc-coug: yeah my client has the token
[21:16:54] workmad3: tc-coug: so you can surely just make HTTP requests to the API endpoint(s)?
[21:17:57] tc-coug: but how do I validate the token on the API endpoint?
[21:17:59] apeiros_: tejas-manohar is a cross poster
[21:18:20] workmad3: tc-coug: is the other API connected to the same database?
[21:18:44] tc-coug: currently no
[21:18:53] tejas-manohar: apeiros_: i just said "nvm this is for #ruby"
[21:19:03] tejas-manohar: apeiros_: look at the message at 15:14
[21:19:17] apeiros_: ok, my apologies then
[21:19:33] workmad3: tc-coug: ok... then I'd personally probably implement an 'internal' route on your doorkeeper app that can be used to verify and get user details from a token
[21:19:48] workmad3: tc-coug: and then your API can make a request to that route and get back verification
[21:20:05] workmad3: tc-coug: basically, have a back-channel between your API and your doorkeeper app
[21:21:10] workmad3: tc-coug: you can also use that to push in information like "These details can be cached for X seconds before needing refreshing" so that your API doesn't need to make that request every time, and yet can still expire tokens... you can also implement an 'inverse' endpoint on the API side that doorkeeper can call that can be used to clear the cache for a token
[21:21:52] tc-coug: interesting, trying to think about the back-channel and how to implement that
[21:22:08] workmad3: tc-coug: it's just more HTTP requests :)
[21:22:34] workmad3: tc-coug: it's also very similar to how CAS works
[21:22:49] tc-coug: wondering if it is easier to put my API on the same server as doorkeeper
[21:23:09] workmad3: tc-coug: it's easier, yes
[21:23:46] workmad3: tc-coug: and by 'same server', I assume you mean 'same rails app'
[21:24:56] tc-coug: I guess for now the KISS principle still wins, until I realize I need to break it out
[21:26:56] tc-coug: thanks for the advise workmad3
[21:27:39] workmad3: looking at how SSO setups like CAS and OpenID sort out this sort of issue is good for when you need to do it yourself btw
[21:28:29] tc-coug: yeah, those are great resources
[21:29:18] workmad3: it's usually along the lines of "You authenticate with the identity server. That passes back a token of some form that you pass to the application. The application can then verify that token against the identity server, get back identity details, authorizations, etc. and construct the user's session with the application"
[21:32:46] Deithrian_: is that the helicopter guy?
[21:32:56] Deithrian_: omg wrong wrong channel haha
[21:34:32] tc-coug: I think that???s eventually where I want to go
[21:35:13] tc-coug: but for now I can probably go about it another way, revisit once I feel my app is being used and I want to separate the concerns further
[21:36:28] rubyonrails625: hey guys, I'm a beginner RoR developer and am using some opensource to get my app up and running but having issues configuring the twitter API
[21:37:19] rubyonrails625: The app is a link aggregration website, just like reddit or hacker news - and I'm trying to have my twitter account tweet the details whenever a link is submitted
[21:38:19] rubyonrails625: the open source I'm following is lobste.rs - another software specific link aggregration site... The only resources on the github are the post_to_twitter script https://github.com/jcs/lobsters/blob/master/script/post_to_twitter and the oauth configuration in https://github.com/jcs/lobsters/blob/master/extras/twitter.rb
[21:40:28] rubyonrails625: Am hoping someone could take a look at that source code and point me in the right direction... im trying to find the code in the rails appp that tells this script to run
[21:53:12] frankson: is it really bad to do a post onkeyup for a live preview of a formatted post
[21:53:33] frankson: am i raping my webserver or what
[21:53:43] frankson: it feels like a bad idea but it works really well
[21:56:25] gheegh: hey all, I think a simple rails question. What's hte best practice to do multi-select across pagination? (meaning selecting things on multiple pages?)
[21:56:49] gheegh: i wnat to use checkboxes and let people select items across pages, or select all, and then perform an action.
[21:57:42] jglover: gheegh: probably easier to do that with javascript
[21:58:59] gheegh: so, storing as cookies? or something else? because the page will reload.. between pages.
[21:59:43] jglover: gheegh: ah I see. why are you reloading the entire page?
[21:59:52] safetypin: Question about the CanCan gem: does it allow the control of permissions on individual model instances?
[22:00:07] gheegh: yes.. there's hundreds of thousands of items potentially.. so i can't load them all down and do JS pagination..
[22:00:37] frankson: gheegh: maybe use the session hash?
[22:01:05] gheegh: yeah, I could do that.. i'm just trying ot figure out if this is something that has a "best practice"
[22:01:35] jglover: gheegh: you don't have to load them all, why not just load x items at a time, and then load the rest when needed or after page load?
[22:02:04] jglover: gheegh: im still learning. maybe you could explain to me exactly why Javascript pagination won't work.
[22:02:20] workmad3: gheegh: or use JS pagination where you pull down a page of results and throw away the previous page, rather than caching them or doing infinite scrolling
[22:02:51] gheegh: well, mainly because the tables aren't built that way, and have a lot of custom logic that would need to be rewritten or at least modified.. at least as I understand it.
[22:03:06] workmad3: gheegh: and store the selected items in a separate in-memory list in JS... which you can also use to re-create the selected status when a page is reloaded
[22:03:22] gheegh: i was trying to avoid rewriting how tables work.. :-) but it sounds like I don't get that option.. :-)
[22:03:57] workmad3: gheegh: cookies have a size restriction, and you'd need to remember to clear it out upon 'success'
[22:04:00] frankson: gheegh: you don't need to rewrite your serverside to do js pagination though, you can just return whatever results you're returning for each page now as the js response
[22:04:33] gheegh: the other "use case" is that someone may filter down to a list of a few hundred items.. select all, and then "add to X" ... this is a similar scenario
[22:06:14] gheegh: tahnks for the feedback.. i'll look into JS pagination
[22:06:16] frankson: so when someone clicks the 'next page' or adds a filter, it does an ajax request to your server instead of asking for a new page
[22:06:47] workmad3: ^^ that would be the easiest way to start... you could look at using something like pjax for that too
[22:07:04] workmad3: (or turbolinks, if you wanted something from rails)
[22:07:54] frankson: whoa turbolinks works that way?
[22:08:30] frankson: like it wouldn't reset the state of his js goodies?
[22:10:18] safetypin: Question about the CanCan gem: does it allow the control of permissions on individual model instances?
[22:10:50] workmad3: frankson: pretty much
[22:11:06] workmad3: frankson: it's one of the things to be careful about when using turbolinks or similar
[22:11:52] jglover: I have a question about code organization. Basically we have gift_card_purchases package_purchases and purchases, controllers. All three inherit from ApplicationController. For now, making a base class is not an option. My job is to rip out our old payment system and to integrate stripe. I find that this is not very DRY, and i am often copy pasting code from one controller to another. What is the exact right way to handle this?
[22:12:28] jglover: My first thought is creating a StripePurchase module, and then using that in the controllers
[22:12:35] jglover: but i thought i'd see if there are any other suggestions
[22:13:23] workmad3: jglover: I'd probably start by considering a PaymentsController that inherits from ApplicationController and contains the common filters, behaviour, etc. and then inherit the other controllers from PaymentsController instead
[22:14:02] workmad3: jglover: module is another possibility
[22:14:06] jglover: workmad3: unfortunately not an option right now. Very legacy code is making it tricky for me to do that. Though that's really what i'd lke to do
[22:14:25] jglover: workmad3: though maybe its time to refactor that stuff ..
[22:14:48] workmad3: jglover: or you could make use of service objects that encapsulate the behaviour in ways that you can more easily re-use through more normal ruby classes
[22:15:37] jglover: workmad3: https://blog.engineyard.com/2014/keeping-your-rails-controllers-dry-with-services ill look into this
[23:05:04] rikkipitt: hey guys I'm trying to transition from limechat to irssi, but i'm getting [#rubyonrails] Register with nickserv in order to talk: /msg nickserv help
[23:08:52] strsep: rikkipitt, well then - that shouldn't be so difficult now should it.
[23:09:11] rikkipitt: strsep: but but but
[23:09:29] rikkipitt: i've already registered though right?
[23:13:05] rikkipitt: hmm, maybe it is working via irssi
[23:13:20] rikkipitt: can people read me?
[23:13:25] n0zz: yes we can
[23:13:34] rikkipitt: cheers n0zz!
[23:14:14] n0zz: guys, I have a question, where should I start with ruby? I'm lost ;/
[23:14:31] n0zz: hai rikkipitt
[23:16:03] n0zz: to be specific, should I start with ruby or ror? where can I find some useful guides(english/polish)?
[23:16:38] rikkipitt: hey! i just need to setup irssi now... gulp
[23:21:41] Cache_Money: I have an Athlete model and a PhysicalAttribute model that contains the height/weight of an athlete. I have the separate table so that I can keep track of how the Athlete grows over time. However, I'm having trouble selecting the most recent height/weight for the given Athlete
[23:21:43] Cache_Money: https://gist.github.com/anonymous/925d80f9aa7a47702778
[23:46:01] kaymation: Hey, I figured out Ajax posts, but i can't get the table on the page to refresh properly, can someone tell me what i'm doing wrong?
[23:46:02] kaymation: https://gist.github.com/kaymation/4890acb256462c34742c
[23:46:58] kaymation: no errros in my console, and if i hard refresh the page the DB is being updates, but i can't get the div to load without page refresh
[23:56:54] marahin: Hey guys. I'm using JRuby, however when I've got a problem with the MYSQL config. I have the "encoding: utf-8" line in my config/database.yml, and so the application crashes with following error: "ActiveRecord::JDBCError (com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf')"
[23:57:03] marahin: any ideas how to fix that?