|
enki42 posted:Better still is: Bastard :P yeah, that works
|
# ? Jul 18, 2011 18:11 |
|
|
# ? May 14, 2024 08:08 |
|
8ender posted:drat, now I really wish I could come, especially since I have a developer here thats learning the ropes on Ruby and Rails after years of PHP and this would be some good experience. Unfortunately that developer is the owner of the farm we're all paintballing at. Well, we do run a hack night every second Thursday, and there's Rails Pub Night every third Monday of every month, and a Ruby talks meetup every month if this weekend doesn't work for you
|
# ? Jul 18, 2011 18:26 |
|
8ender posted:Any idea if 3.1 is going to be dramatically different than 3.0? I'm in the same boat and just to see how bad things were I upgraded one of our 2.3.11 apps yesterday and it was oddly painless. I think I changed one or two lines of code but everything just worked. I was kind of expecting apocalyptic app failure across the board but it doesn't look like all that much changed in the core MVC parts of rails. Everything except the new asset pipeline looks pretty consistent, though, which is nice after the giant ActiveRecord changes last time around. So many queries to rewrite.. so many..
|
# ? Jul 18, 2011 19:58 |
|
enki42 posted:Better still is: Don't do this if there is any potential on using 1.8 (around 31:00)
|
# ? Jul 18, 2011 22:58 |
|
BonzoESC posted:http://hashrocket.com/contact-us Well Hashrocket's Twitter has dead but an employee tweeted an RSVP form, so yay for that! in 7 years I've never ventured much into Rails core. I'm scared
|
# ? Jul 18, 2011 23:03 |
|
So I tried creating my own validation. I know it's ugly but please forgive me!code:
code:
Thanks again for your help!
|
# ? Jul 19, 2011 01:01 |
|
code:
|
# ? Jul 19, 2011 06:38 |
|
Stup posted:So I tried creating my own validation. I know it's ugly but please forgive me! My fault. See http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validate - you want validate, not validates, which is used for something completely different.
|
# ? Jul 19, 2011 10:31 |
|
I made a thing during this flight: Mess with it: https://github.com/bkerley/greatjobify NotShadowStar posted:Well Hashrocket's Twitter has dead but an employee tweeted an RSVP form, so yay for that! Hashrocket is gigantic (three offices, dozens of employees), but everyone I've met from the Chicago office is pretty cool. If you want to think about what Rails is doing under the hood, I presented about implementing the Rack to ActionController/ActionView part from scratch a little over a year ago.
|
# ? Jul 19, 2011 14:38 |
|
BonzoESC posted:I made a thing during this flight: Not seeing any code there
|
# ? Jul 19, 2011 14:42 |
|
8ender posted:Not seeing any code there https://github.com/bkerley/greatjobify/blob/master/config.ru Edit: yeah it's Sinatra and not Rails, deal with it
|
# ? Jul 19, 2011 14:44 |
|
BonzoESC posted:https://github.com/bkerley/greatjobify/blob/master/config.ru Whoops, skimmed right over that file
|
# ? Jul 19, 2011 14:48 |
|
And now it's on Heroku Celadon Cedar: (photo starring Zap! and Ulf) SOME CEDAR/SINATRA PROTIPS:
|
# ? Jul 19, 2011 16:14 |
|
Obsurveyor posted:
Here is some more efficient code (calls COUNT() in SQL rather than selecting and iterating through each member). code:
|
# ? Jul 19, 2011 16:50 |
|
BonzoESC posted:Mess with it: https://github.com/bkerley/greatjobify this is a lot of fun!
|
# ? Jul 19, 2011 16:51 |
|
BonzoESC posted:
I usually use web: bundle exec thin start -p $PORT, then it grabs the config.ru
|
# ? Jul 19, 2011 17:44 |
|
Pardot posted:I usually use web: bundle exec thin start -p $PORT, then it grabs the config.ru Pow wanted run Sinatra::Application and the web process I have in my barfed on that. I'll try that once I get ruby again (MacBook battery flat, on iPad & in-flight wifi until we cross over to Canada.)
|
# ? Jul 19, 2011 19:22 |
|
While I'm thinking about it, anybody else get RubyConf tickets?
|
# ? Jul 19, 2011 19:22 |
|
I'm using highcharts and would like to render the charts via a partial called from my view and it's not working at all. I have a partial called '_chart.js.erb' that contains the javascript to create and render the chart, but if I do:code:
code:
code:
code:
code:
|
# ? Jul 20, 2011 00:11 |
|
kalleth posted:My fault. See http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validate - you want validate, not validates, which is used for something completely different. So I tried using validate and the error went away, but no errors ever pop up. Here's my memberscontroller: code:
|
# ? Jul 20, 2011 00:24 |
|
I'm looking to further my skills and develop some database intensive sites. I'm new to Ruby, PHP, and SQL but have significant experience with HTML and CSS. How should I proceed? Will learning Ruby teach me what I need to know about PHP and SQL, or should I learn the basics of PHP and SQL and then transition smoothly to Ruby? Sorry for the amateurish question but I'm just looking for some expert opinions.
|
# ? Jul 20, 2011 01:38 |
|
Abel Wingnut posted:I'm looking to further my skills and develop some database intensive sites. I'm new to Ruby, PHP, and SQL but have significant experience with HTML and CSS. How should I proceed? Will learning Ruby teach me what I need to know about PHP and SQL, or should I learn the basics of PHP and SQL and then transition smoothly to Ruby? PHP has really nothing to do with Ruby other than the fact that they are both programming languages. PHP is similar to C, if you've ever used that. Ruby on Rails is a framework for Ruby for making web applications. SQL is another ball of wax. You should probably learn the basics of it, but it's possible to do an application in Ruby without any SQL at all. Play around with Ruby here, it's fun! http://tryruby.org/ If you like that, I'd get started with Rails here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
|
# ? Jul 20, 2011 01:46 |
|
Stup posted:So I tried using validate and the error went away, but no errors ever pop up. Can I see the validate code from the model as well? Are you sure the create action still goes through; I.e. is something being persisted to the database? Perhaps call save! rather than save which will create an exception if the save fails? A good way of debugging stuff is using the $ rails console command line to give you effectively an irb within your app environment. This will let you do something like > team = Team.find(:first) #<Team:Object> > team.add_player(Player.find(:first)) #<Team:Object player=#<Player:Object>> > team.save! > either backtrace or false or true You can then use the console to inspect any errors.
|
# ? Jul 20, 2011 10:35 |
|
In case anyone's run into the same javascript partial rendering problem I posted about earlier, I managed to fix it. I put the javascript in a haml file and did a "render :partial => 'chart.js'" and now everything is fine. Something doesn't feel right about having to supply the ".js" but whatever it's good enough for now.
|
# ? Jul 20, 2011 17:40 |
|
Guys this problem is stressing me out. I installed Ruby, Rubygems and Rails the way "Agile Web Development with Rails" tells me to, but whenever I write something like "rails new demo", it creates a folder named new with, what I suppose are, the usual Rails files. The thing is, it happens every time I write "rails". I wrote "rails server" and it only created a folder named server with the exact same files as before. Any solution? (Using it on Ubuntu).
|
# ? Jul 20, 2011 19:06 |
Has anyone here used http://refinerycms.com/ ? I'm in charge of picking a CMS for our custom development projects. The main requirement is that it can be configured to pull xml feeds from our main servers to populate things like Upcoming Event widgets. We're an events-based calendar software company at heart, and some of our customers want websites to go along with the main product. So far we've been one-offing everything in .NET2.0, reusing controls that feed on our xml streams. But it's time-intensive and the developer (me) has to put everything together, which distracts from the main product. If we had a cms then the support/marketing/design side could take some of the burden off the developers. My boss suggested modx, which looks decent, but PHP makes me queasy and I'm looking for alternatives. Simbyotic posted:sounds like you're using rails 2. "rails new" is a rails 3 command. "rails /path/to/myapp/" is the rails 2 command. type "rails -v" to see what's up.
|
|
# ? Jul 20, 2011 19:34 |
|
A MIRACLE posted:
Yes, apparently I'm using rails 2.3.5. Let's see if I can update this thingy.
|
# ? Jul 20, 2011 19:52 |
|
Simbyotic posted:Guys this problem is stressing me out. Make sure you're using the 4th edition of Agile Web Development with Rails if you're working in Rails 3.x, and the 3rd edition if you're working with 2.2 or 2.3 Stup fucked around with this message at 03:18 on Jul 21, 2011 |
# ? Jul 21, 2011 02:45 |
|
Stup posted:Make sure you're using the 4th edition of Agile Web Development with Rails if you're working in Rails 3.x, and the 3rd edition if you're working with 2.2 or 2.3 You should see how many notes I have written in our copy of the 2nd edition. Any tips on reducing the amount of memory our Ruby and httpd processes take? code:
|
# ? Jul 21, 2011 19:40 |
|
1.8 or 1.9? If you're using 1.8 you want to use REE
|
# ? Jul 21, 2011 22:07 |
|
NotShadowStar posted:1.8 or 1.9? Ruby Enterprise Edition version 1.8.7-2010.01 The server isn't busy right now and it's down to just under 8GB memory used
|
# ? Jul 22, 2011 01:39 |
|
Here's some stuff for ya http://www.engineyard.com/blog/2009/thats-not-a-memory-leak-its-bloat/ https://github.com/binarylogic/memorylogic Also New Relic is an awesome service for tracking all sorts of related app issues.
|
# ? Jul 22, 2011 02:31 |
|
How would I use something like Adapt.js with a rails 3.1 app? The configuration calls for an absolute path to my resources, and there is a probably a better way to do this. Never mind wrote my own. Oh My Science fucked around with this message at 07:18 on Jul 22, 2011 |
# ? Jul 22, 2011 05:55 |
|
kalleth posted:Can I see the validate code from the model as well? Are you sure the create action still goes through; I.e. is something being persisted to the database? Perhaps call save! rather than save which will create an exception if the save fails? This is my validate code right now... code:
code:
Stup fucked around with this message at 20:50 on Jul 24, 2011 |
# ? Jul 24, 2011 20:47 |
|
Your conditionals there are just checking that the number 2 is greater than the number 1 or not. I have it on good authority that 2 is always greater than 1, and 1 is never greater than 2. Having this class need to know what "Forward" means is awkward, put this in whatever class members are. code:
code:
|
# ? Jul 24, 2011 23:40 |
|
Yeah the 2 > 1 thing was just to try to force it to bring up errors, which it wasn't. I'm not at my coding computer right now, but I'll give this a shot later. That tip for forward? looks to be reeeeally helpful. Thanks!
|
# ? Jul 25, 2011 00:37 |
|
My application serves profile images and I don't want any schlub who knows the URL for the image to be able to load it. That part is easy, I control access in Photos#show and use send_data (photos are stored in the DB btw). However it looks like browsers aren't caching the photos, which makes page load times unnecessarily long. This feels like a stupidly basic question, but what should I do here to speed up loads? Is there any way I can provide an etag before the controller method is invoked and I have to deal with the database hit?
|
# ? Jul 27, 2011 06:50 |
|
Plastic Jesus posted:My application serves profile images and I don't want any schlub who knows the URL for the image to be able to load it. That part is easy, I control access in Photos#show and use send_data (photos are stored in the DB btw). However it looks like browsers aren't caching the photos, which makes page load times unnecessarily long. This feels like a stupidly basic question, but what should I do here to speed up loads? Is there any way I can provide an etag before the controller method is invoked and I have to deal with the database hit? A couple of things to try, more or less in order: * Make sure the Cache-Control header is something like Public, max-age: bignumber. I'd have to look up the exact syntax. * make sure last-modified header is set. Those two might be all you need. They are set for actual static files, but since you're sending the data yourself, they probably aren't set any more. Once you have those you'll get browser caching again * try http://rtomayko.github.com/rack-cache/ and also this technique https://gist.github.com/9395 However if you're not careful with this you'll lose the user checking. Alternatively, you could store all the photos in S3, and just generate short-lived urls on demand if they have permissions. That's what I would probably do, since anything I write that has uploads just puts them in s3 to begin with. Since local disk is ephemeral
|
# ? Jul 27, 2011 18:16 |
|
Ok guys seriously where in the hell is the Rails reference? There is practically zero documentation for this programming language that I've been able to find. You can't even search the api reference!! And even if you could half the functions are missing even the most basic information. Why am I having to trawl blogs to figure out this language? Oh, and the 'official' Rails book is a loving joke. What is the real reference with real information? I don't need to know how to build a shopping cart I need to know what the functions are and how to use them. I need an actual, searchable reference with information in it.
|
# ? Jul 28, 2011 22:17 |
|
|
# ? May 14, 2024 08:08 |
|
-Rails isn't a language -You want guides.rubyonrails.org -Agile Web Development with Rails is the best book there is. If you can't get anything out of it you are handicapped. http://apidock.com/ should tide you over until you take your medication, but reading the API and method list isn't going to do poo poo for you until you sit down, take a deep breath and understand how Rails works. Actually you need to step away from Rails for a good while and learn about Ruby. What you're doing is trying to learn Django, Struts or ASP.NET MVC without knowing any Python, Java or C# at all.
|
# ? Jul 28, 2011 22:33 |