Recent Posts
Pages: 1 2 3 4 5 6 7 8 9 10 11 ... 20
|
May 2, 2010
|
Topic: Exercisr Discussion / An error adding activities. Hello. I am actually having this exact same problem. I’ve been looking at this error for 3 hours, and really, even though I’ve made some progress, I’m frankly at a loss. I know this topic is about a year old… but can I still get some input? The error is: Couldn’t find Workout without an ID and my routes looks like this: bq.(ActionController::Routing::Routes.draw do |map| map.resources :activities
|
|
Apr 18, 2010
|
Topic: Announcements / aaa I can do it |
|
Apr 18, 2010
|
Topic: Announcements / Starting New Book I can do it |
|
Mar 29, 2010
|
Topic: Introductions / Chapter 2 - Questions Easiest way to find that CSS file would be to download the source files from the Apress book site and copy them out of there. |
|
Mar 29, 2010
|
Topic: Introductions / Chapter 2 - Questions 1. You can just use rake rails:freeze to freeze whichever version of Rails is specified in environment.rb (as long as it’s installed) As for the figure – just a mistake as I was doing development for a company that used SQL Server at the time. |
|
Mar 29, 2010
|
Topic: Introductions / Good Books! 1.b You’re correct – With leopard Apple included an installation of SQLite so you don’t need to worry about installing it (just the ruby sqlite gem) 2. You don’t need to use mongrel_rails start. You can just use ruby script/server and it will start up Mongrel if it’s installed or Webrick if it’s not. 3. It’s been a couple of years but if memory serves me correctly there weren’t a lot of big differences between 1.2.3 and 1.2.6 (mainly just security fixes) When Rails went to 2.0 though, was when things began to change dramatically. |
|
Mar 29, 2010
|
Topic: MonkeyTasks Discussion / ruby script/generate controller today index It sounds like a mismatch of Rails version to codebase. Are you running a newer version of Rails on the downloaded code? |
|
Mar 28, 2010
|
Topic: MonkeyTasks Discussion / Unable to send mail through SMTP Thx for your reply Eldon. I did try setting the delivery_method to :sendmail but that didn’t work either. |
|
Mar 27, 2010
|
Topic: Announcements / Starting New Book I know it’s a bit late for this. Your “new” book, Foundation Rails 2, is out. (Is there a web site for it?) But just in case you’re willing to write yet another one ;). 1. Working with multiple versions of ruby/rails. 2. Running multiple rails apps. 3. Accessing more than one database from a single app. 4. Working with non-rails-convention databases. 5. Non-trivial examples. 6. Database structuring. This might be a good one for you with your background and ties in with #4. How do we employ good database design. Or how do we design our models such that good database design follows naturally from them? This probably requires one or more non-trivial applications since. 6. Test First Development Very few, if any, books on rails I’ve seen seem to want to touch this. If rails is opinionated, and this is one of the things it’s opinionated about, it should be start from the outset. How do we write tests, and which tests do we write. Isn’t there a way to make writing tests fun? I would LOVE to see a rails book that shows how to write the tests as an application is constructed. 7. Documentation Sort of goes hand-in-hand with #6 I think. Books on rails, even beginning ones, should come right out teaching how to document the code from the start, not as sort of an afterthought, if at all. That’s my opinion ;) |
|
Mar 27, 2010
|
Topic: Introductions / Chapter 2 - Questions Chapter 2 The book isn’t too clear on how to obtain the reset-fonts-grids.css file. I downloaded the entire YUI 2.8.0r4 Library and found the file in the yui/build/reset-fonts-grids/ folder. |
|
Mar 27, 2010
|
Topic: Introductions / Good Books! 1.a. SQLite3 on Windows |
|
Mar 27, 2010
|
Topic: Introductions / Chapter 2 - Questions Chapter 2 rake:rails:freeze:edge TAG=rel_1-2-3 Could you explain this a bit please? 1. If I have only version 1.2.3 of rails installed, would I use this exact same command? 2. What’s with the ”:edge” part? 3. What’s with the “TAG=” part? 4. Is it possible to freeze to a version of the rails gem that is not present locally on your machine? Thanks! p.s. If we’re using SQLite, why does Figure 2-1 on page 30 show sqlserver!? ;) |
|
Mar 27, 2010
|
Topic: Introductions / Good Books! Yes, books. I am a good way through your Foundation Rails 2 book and really like it, so I ordered this one even though it’s a bit dated, and it came in today. I can already tell you that I am enjoying this one as well. I like the way you write, and the material that you provide in your books. In this book I love how you start right out saying you’re going to use SQLite. So many of the older Rails books make you use MySQL and don’t even hint at any other option, lol. Just a few questions to get me started: 1. SQLite3 1.a. SQLite3 on Windows Is there a special gem for SQLite3 for Windows? Or do I do gem install sqlite3-ruby on Windows as well? 1.b. SQLite3 on Mac Recently purchased a Mac with the latest OS X. In the book on page 8 it talks about using MacPorts. “Before you can install the Ruby gem, you will need to install an application named SWIG. Otherwise the SQLite gem will not use the correct SQLite library…” Do I need to worry about this on the newer Mac? I’m pretty sure the gem is already installed, but is it the correct (best) one? 2. Mongrel Do I still need to use mongrel_rails to start and stop? I know the newer version or rails will use Mongrel automatically if it’s installed. 3. Rails Version I installed version 1.2.3 since that’s the version mentioned in the book (see Figure 2-1 on page 29). It just so happens that version 1.2.3 also works for the RailsSpace book. Should 1.2.3 work out for this book, or should I install 1.2.6? Thanks for the great books! |
|
Mar 8, 2010
|
Topic: MonkeyTasks Discussion / ruby script/generate controller today index Hey so on page 36 I run said command in monkey and I get the error: /Users/ianhenrysmith/monkey/config/boot.rb:45:in `require’: no such file to load—/Users/ianhenrysmith/monkey/config/../vendor/rails/railties/lib/initializer (LoadError) from /Users/ianhenrysmith/monkey/config/boot.rb:45:in `load_initializer’ from /Users/ianhenrysmith/monkey/config/boot.rb:38:in `run’ from /Users/ianhenrysmith/monkey/config/boot.rb:11:in `boot!’ from /Users/ianhenrysmith/monkey/config/boot.rb:110 from script/generate:2:in `require’ from script/generate:2 Haven’t run into any problems so far setting up rails or the db or anything. Thanks! |
|
Feb 22, 2010
|
|
|
Feb 22, 2010
|
Topic: MonkeyTasks Discussion / 2.3.5 Compatible Monkey Tasks I’ve had a number of people contact me over the last couple of months (which unfortunately have been far more hectic for me than usual) with questions about upgrading some of the books projects to the current version of Rails 2.3.5. Since the projects in the book were all written in 1.2.6, and Rails has a bad habit of having non-backward compatible changes – this has caused some issues for people. Unfortunately – I don’t have time to update all the books projects but thought I would at least put together a Rails 2.3.5 compatible version of Monkey Tasks for people to use as a reference. You can download it from here. One key thing to remember is that this version is Rails 2.3.5 COMPATIBLE, which is quite different from being up to date with Rails 2.3.5 standards. A lot has changed in Rails and in how Rails developers build applications since the book was published and there were quite a few times during my updates that I was wanting to throw huge chunks of code away to update them to the newer standards, however I thought that might cause even more confusion so I kept my changes more in line with how the book was written. |
|
Feb 22, 2010
|
Topic: MonkeyTasks Discussion / NoMethodError in TaskController#mark_complete Adding link to an Rails 2.3.5 version of the Monkey Tasks project – you might want to check it’s source out and compare it against yours. |
|
Feb 22, 2010
|
Topic: MonkeyTasks Discussion / Unable to send mail through SMTP Have you tried setting action_mailer to user sendmail instead? i.e. in environment.rb config.action_mailer.delivery_method = :sendmail |
|
Feb 18, 2010
|
Topic: MonkeyTasks Discussion / NoMethodError in TaskController#mark_complete fixed. never mind. except i notice that when I mark a task as complete, I need to click the browser refresh button to strike it and move it to the bottom. I also notice in the console that the complete variable is always null. |
|
Feb 18, 2010
|
Topic: MonkeyTasks Discussion / NoMethodError in TaskController#mark_complete Just added the mark_complete method to the task controller and get this error message every time. Here is the snippet: def mark_complete
if @task.complete.nil?
@task.complete = Time.now < It must be something syntactical. Any ideas? |
|
Jan 25, 2010
|
Topic: MonkeyTasks Discussion / Unable to send mail through SMTP Hi all.. Net::SMTPUnknownError in AccountController#signup C:/Ruby/lib/ruby/1.8/net/smtp.rb:679:in `check_response’ I’ve checked the code over many times and it seems to be fine :( |
|
Jan 13, 2010
|
Topic: MonkeyTasks Discussion / Project with later versions Hi, I have installed Rails 2.3.5 and ruby 1.9.1 into a ubuntu virtual box. I was OK upto page 74, but @todos = @today.todos casued a problem. That turned out to be because I did not have the acts_as_list plugin. I got further errors that seemed to stem from the tasks I created, so I cleared out the tables in sqlite3 to start again. Now I get: TypeError (nil is not a symbol): app/models/todo.rb:6:in `<class:todo>‘ app/models/todo.rb:1:in `<top>‘ app/controllers/today_controller.rb:6:in `index’ <internal:prelude>:8:in `synchronize’ /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service’ /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run’ /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread’ I tried the complete source from the website in a different directory, but it was not happy with my version. Anyone got this project to work in the ruby and rails versions indicated? ...Andy |
|
Aug 19, 2009
|
Topic: Church Community Discussion / small_avatar problems I found another solution that did not involve the config/environments/development.rb change for config.cache_classes = true… Take the comment.rb file from vendor/plugins/acts_as_commentable/lib directory and move it to app/models/comment.rb |
|
Aug 4, 2009
|
Topic: GamingTrend Discussion / Refactoring suggestions I have just been looking into the source of GamingTrends, since I want to use Rails with ExtJS and find it a somewhat good inspiration. To get up and running I first had to setup the MySql database with the schema. I had problems using the migrations. I got some errors on the E304 and descrip index og Games. (BLOG/TEXT requires a length key, tried adding a :limit => 1000, but didn’t work!?) To import the schema into a mysql database, I recommend removing Games indexes “E304” and “descrip” from the first migration. They are deleted on the cleanup migrations anyways! Finally I got the app up and running, but I was unable to create Posts! in the source code /app/views/post/new.rhtml — Looking into the code: I feel the ExtJS infrastructure can be vastly improved by scrapping the ext helper function in application_helper.rb and refactoring them. I came up with the following refactoring solution: application_helper.rb
games/index.rhtml <= ext_layout(‘Games’) %> shared/_ext_grid.rhtml
PageGrid.filterResource = function() {
filtervalue = Ext.get(‘text_filter’).dom.value;
ds.proxy = new Ext.data.HttpProxy({
method: ‘GET’,
url: ‘<%= models %>.json?search=’ + filtervalue}
);
ds.reload(); PageGrid.deleteResource = function() {
var id = grid.getSelectionModel().getSelected();
if(id){
Ext.MessageBox.confirm(‘Confirm’, ‘Are you sure you want to delete this <%= model %>?’, postDelete);
} else {
Ext.MessageBox.alert(‘DOH!’, ‘Maybe you want to try again after ACTUALLY selecting something?’)
} PageGrid.submitResource = function(){
document.create_resource.submit(); PageGrid.postDelete = function(btn){
if(btn == ‘yes’) {
var id = grid.getSelectionModel().getSelected();
var deleteme = id.get(‘<%= primary_key %>‘);
window.location.href = ’/<%= models %>/destroy/’ + deleteme;
} PageGrid.editResource = function (grid, rowIndex) {
var id = grid.getSelectionModel().getSelected();
if(id) {
window.location.href = ’/<= models %>/’ + id.get(‘<= primary_key %>‘);
} Ext.onReady(pageGrid.init, pageGrid, true); shared/_news_fun.rhtml PageGrid.renderNews = function(value, p, record) {
return String.format(‘{0} PageGrid.renderNewsPlain = function(value) {
return String.format(‘{0}’, value); PageGrid.toggleNews = function(btn, pressed) {
cm.getColumnById(‘Headline’).renderer = pressed ? renderNews : renderNewsPlain;
grid.getView().refresh(); var formatBoolean = function (value) { return (value == 1) ? ‘Yes’ : ‘IMO. I will see where I get from here… |
|
Jul 24, 2009
|
Topic: Exercisr Discussion / An error adding activities. Crap – I got so swamped at work that I completely forgot about this problem. So my apologies to Mongo for not looking into this. If GruffDavies is correct and it’s simply a matter of the named route helpers that are generated are incorrect that would make sense. This book was written using Rails 1.2.6, and there were some minor changes to those routes in the early 2.x days. One of which was the automatic pre-fixing of nested routes with the parent routes name. And Gruff – yes you should be able to use the shorthand version of :has_many in route generation now as well (also added to Rails after the book was published). You can use the shortcut has_one to link to a singular nested resource and a has_many to link to a collection nested resource. (However – I will note that I rarely see this idiom used). As for why it wasn’t working for you – I think you’re missing a comma between :workouts and :has_many. Hope that helps – once again sorry for forgetting about this. |