Recent Posts

Subscribe to Recent Posts 485 post(s) found

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 20

Mar 5, 2008
Avatar EldonAlameda 216 post(s)

Topic: Cool Stuff / Event registration app

Hi beta,

I’m not aware of any open-source rails apps that would fill this need. It seems that there might have been one started way back in the day but if there was, it seems to have vanished now. Building a simple event registration system for an event wouldn’t be too hard but I would imagine that creating one flexible enough to handle the large variety of possible event registration needs would be a more difficult (i.e. some events are one time events, some are multi-day, some have public and paid sections, then of course you also have to handle multi-day and multi-site events (such as a training class that meets every saturday but occasionally might need to relocate, etc, etc). So I would guess that most developers just build a quick version for their specific needs.

 
Mar 4, 2008
Avatar beta 7 post(s)

Topic: Cool Stuff / Event registration app

hi. I posted this on rails-talk but it hasn’t really got any attention there… I was looking to make a small event registration app but I thought i
would check to see if there were any already floating around to check
out, I did a quick google search but didn’t really find anything… It would allow the organiser to have their own page and lets others sign up. Anyone here know of any?

 
Mar 4, 2008
Avatar EldonAlameda 216 post(s)

Topic: Introductions / I really like this book

Hi Lei,

Glad to hear that you’re liking the book and I certainly appreciate that you tried to write a review on Amazon for it. From what i hear those reviews do make a significant difference. I did invest a lot of myself into it so it’s always good to hear that people are enjoying and learning from it.

 
Mar 2, 2008
Avatar Lei 14 post(s)

Topic: Introductions / I really like this book

hi, Eldon, I can see you poured lots of passion and love into the book. I wanted to say that I really like the book, especially all the tricks and ideas you provide, it’s probably the best Rails book I’ve read so far . I have gone through part 6 already, but I’m going to go back and review some of the previous chapters a few more times.

I feel sorry about the poor reviews the book has got on Amazon.com. I really feel for you. Unfortunately, I do not live in the US, I was trying to review this book, and got this message:

To write a customer review: you must have used this account to complete a purchase* of an item from Amazon.com. Please wait 24 hours after your first purchase before writing a review.

But I highly encourage other readers of the book to post your reviews on Amazon if you also like the book.

 
Mar 2, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / xml show bugs

Right – it can be considered a little wasteful to generate the @results and @activities data in those methods when they won’t be used in the xml response. In that case we could have written it like this:

  def show 
    @goal = current_user.goals.find(params[:id]) 
    respond_to do |format| 
      format.html { 
        @results = @goal.results.find(:all, :order => 'date desc') 
      }
      format.xml  { render :xml => @goal.to_xml } 
    end 
  end 

Unfortunately though – i think that looks uglier and thus I usually opt to keep it the way it is in the book.

 
Mar 2, 2008
Avatar Rob 4 post(s)

Topic: Exercisr Discussion / xml show bugs

No way ;-) Why did you have the unused variables then (@results, @activities). Oh, wait, never mind. They are used in show.html. You can tell I still don’t quite get Rails yet without thinking about it…

I think I get what you’re saying here. But the truth will be know if I do it myself intelligently.

 
Mar 2, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / xml show bugs

Hi Rob,

Actually I put those in there like that on purpose :-)

Here was my thought on the reasoning behind it. In my opinion the needs of the different formats don’t always require serving the exact same data. So taking the workout controller for example—for a user using the HTML version, simply displaying the fact that they had a workout with this ID doesn’t really add much value to the user – so instead we added in a extra call to display the results of their goals on this page as well (rather than forcing them to go through another click to go to the results_controller show method.

This is a slight break from convention but it makes for a better experience for the user.

However the xml version isn’t meant to be read by humans directly so there is no reason to provide them the extra data and is better to keep things in standard with the conventions (i.e .to see results – it would need to go to the results controller and the show method of a goal controller should simply display the details of that goal).

Admittedly though, both approaches could be argued for. But in cases like these I tend to do keep the API as pure as possible (no surprises) and the HTML version as user-friendly as possible.

Hopefully that makes sense.

 
Mar 1, 2008
Avatar Rob 4 post(s)

Topic: Exercisr Discussion / xml show bugs

I found a couple of bugs in the xml formatting:

Index: /trunc/app/controllers/goals_controller.rb
===================================================================
--- /trunc/app/controllers/goals_controller.rb (revision 4)
+++ /trunc/app/controllers/goals_controller.rb (revision 24)
@@ -20,5 +20,5 @@
     respond_to do |format| 
       format.html # show.rhtml 
-      format.xml  { render :xml => @goal.to_xml } 
+      format.xml  { render :xml => @results.to_xml } 
     end 
   end

and:

Index: /trunc/app/controllers/workouts_controller.rb
===================================================================
--- /trunc/app/controllers/workouts_controller.rb (revision 4)
+++ /trunc/app/controllers/workouts_controller.rb (revision 25)
@@ -21,5 +21,5 @@
     respond_to do |format|
       format.html # show.rhtml
-      format.xml  { render :xml => @workout.to_xml }
+      format.xml  { render :xml => @activities.to_xml }
     end
   end

Cheers,
Rob

 
Feb 27, 2008
Avatar beta 7 post(s)

Topic: MonkeyTasks Discussion / Huh! I didn't realize it would be this hard...

So much bitterness, you guys sound like you are talking about an old girlfriend :)

I dont know… they have improved the wiki a lot now, but I have a couple of apps in heroku and as long as its not going to be rediculously expensive i will definatly go with that when i need to renew my hosting in the summer.

 
Feb 27, 2008
Avatar Neil 9 post(s)

Topic: MonkeyTasks Discussion / Huh! I didn't realize it would be this hard...

Dreamhost + Rails. What a combination!

Last summer I tried some basic Rails tutorials and hoped to the deploy the apps to my Dreamhost account – but it turned out to be an absolute nightmare. The Dreamhost wiki section on Rails was mind-bloggling. I gave up in the end after a gozillion customer service emails.

I might give it another try, though. I’ve actually got to grips with Rails now (before I was just copy/pasting), so that should make a BIG difference. Plus Dreamhost seemed to have perked up supporting Rails. I’ll definitely be using one of my Peepcode credits on the Capistrano 2 tutorial…

 
Feb 27, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Huh! I didn't realize it would be this hard...

Beta,

No you should be fine using Dreamhosts subversion repository. back in the day (i.e. a couple of years ago), a company i was working for had a few of their PHP applications hosted at Dreamhost and I used Dreamhosts repository until my employer had enough money free to buy an internal subversion server.

Other than not liking their web-based wizard for setting it up – I don’t recall having any problems.

I just wouldn’t host any Rails apps with Dreamhost though.

 
Feb 26, 2008
Avatar beta 7 post(s)

Topic: MonkeyTasks Discussion / Huh! I didn't realize it would be this hard...

I came across this subversion screencast recently and thought it was good for a beginner. The thing that confuses me is having a subversion host, is that nescessary? I am with dreamhost and thought about creating a repository there but is it better to take an actual subversion based host?

 
Feb 24, 2008
Avatar Neil 9 post(s)

Topic: Cool Stuff / Applying what I've learned...

Rails Envy podcasts are also worth checking out. I have smile on my face the whole time I’m listening to them, which is usually while I’m stumbling round for a bowl-cereal-milk combination.

 
Feb 24, 2008
Avatar Neil 9 post(s)

Topic: Exercisr Discussion / Installing RMagick....

I’ve tested out RMagick with a few attachment_fu tutorials, and it seems to have worked. Luckily I can go through the whole process again when I get round to Leopard. Happy Days!

 
Feb 23, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / restful authentication

Yeah I’ve never been a big fan of the decision to allow singular resources in Rails.

 
Feb 23, 2008
Avatar EldonAlameda 216 post(s)

Topic: Cool Stuff / Applying what I've learned...

I hate to admit it but i stay up until 2am every sunday night just so I can check out the newest RailsCast.

But I’m also a night-owl and more than a bit obsessive. Some of my first pure ruby scripts (i.e non-rails) were scripts that would load a page on the some book publishers websites and immediately notify me if a book I was waiting for was available for purchase now (that site didn’t have an RSS feed back then).

For other screencast goodness – there’s also Peepcode.com which I’m sure you’ve seen reference to from the RailsCasts.

Rubyplus.org is a new site that recently started Ruby and Rails screencasts, I’ve only downloaded two of those so far but the audio had issues to where it was a real pain to make out what he was saying so I haven’t been back. Maybe they’re fixed now.

 
Feb 23, 2008
Avatar Neil 9 post(s)

Topic: Cool Stuff / Applying what I've learned...

Yeh, Railscasts rock. Ryan Bates does an awesome job of explaining everything. You feel like just you’ve just spent a day at relaxation-health-spa after each screencast!

 
Feb 23, 2008
Avatar beta 7 post(s)

Topic: Exercisr Discussion / restful authentication

I am running rails 1.2.3 and took the entire Restful authentication plugin from the source file, however when i tried to run my app for the first time as show on page 111 i got errors:


ActionView::TemplateError (session_url failed to generate from {:controller=>"sessions", :action=>"show"} - you may have ambiguous routes, or you may need to supply additional parameters for this route.  content_url has the following required parameters: ["session", :id] - are they all satisifed?) on line #1 of app/views/sessions/new.rhtml:

Allthough my code was the same as in the source file and in the book i tried something that was written in the plugin readme and changed my roots.rb file from this:


ActionController::Routing::Routes.draw do |map| 
map.resources :exercises 
map.home '', :controller => 'sessions', :action => 'new' 
map.resources :users, :sessions 
map.signup '/signup', :controller => 'users', :action => 'new' 
map.login  '/login', :controller => 'sessions', :action => 'new' 
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
end 

as was in the book… to this:


ActionController::Routing::Routes.draw do |map|
map.resources :exercises
map.home '', :controller => 'sessions', :action => 'new'
map.resources :users
map.resource :session, :controller => 'sessions'
map.signup '/signup', :controller => 'users', :action => 'new' 
map.login  '/login', :controller => 'sessions', :action => 'new' 
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
end

And now it works without problem! Has anyone else had this experience, is it just a result of things getting mixed up a bit because of using previous versions?

UPDATE: I have seen on page 113 that the sessions_controller.rb is refferred to as session_controller.rb, if i generate the restful auth code with ‘session’ instead of then ‘sessions’ as the second parameter then I can leave the routes.rb code as is in the book and it works fine.

 
Feb 23, 2008
Avatar Roupen 84 post(s)

Topic: Cool Stuff / Applying what I've learned...

I’ve been going through these screencasts and they are incredibly useful (the relaxed style of the authors is very calming). I’m wondering if Eldon or others have come across other railcasts that you’d like to share.

PS: I’m getting back to the project in this thread (got hit by the flu for a couple of days).

 
Feb 23, 2008
Avatar Neil 9 post(s)

Topic: Exercisr Discussion / Installing RMagick....

I just tried the RMagick installation guide over on Hivelogic;
http://hivelogic.com/articles/rmagick_os_x/#comments

At first, I was a little concerned about following a tutorial from June 2006 which included release versions in the installation paths, but everyone still seems to reference this tutorial as the way to get RMagick set-up if you don’t have MacPorts (I intend to start fresh with MacPorts when I make a move over to Leopard).

I followed the tutorial just fine until the last step, ‘sudo gem install RMagick’, at which point ruby said ‘ERROR: could not find RMagick locally or in a repository’. I changed the gem name to lowercase ‘rmagick’, and that seemed to work.

I already had a version of Imagemagick installed after doing RailsSpace (but obviously no RMagick), so I don’t know if re-installing it will have affected anything, or if RMagick even works yet – so I’ll report back with my findings and maybe it’ll help out other non-MacPort/Locomotive Mac OS X Rails users….

 
Feb 23, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / problem in _todo partial

Actually just went back and tested your report and you’re right there is a bug there. In my haste I didn’t notice that by scoping the delete it wasn’t really deleting the todo but merely nullifying the schedule_id from that todo.

In all actuality there is no need to scope that search (i.e. making sure it’s associated with the current users schedule ) for the todo object twice.

Changing the delete method in the todo controller to this – should fix this bug

  def destroy 
     todo = current_user.schedule.todos.find(params[:id]) 
     Todo.delete(todo) 
     redirect_to(:controller => "today", :action => "index")
  end 

I’ve updated the errata here on the site. Thanks for catching this!!

 
Feb 23, 2008
Avatar EldonAlameda 216 post(s)

Topic: Cool Stuff / Fun Ruby Puzzles

This site has a few fun little Ruby puzzles to help you learn Ruby

http://curiouscoding.wordpress.com/2008/02/11/learning-ruby-with-ninety-nine-problems-1-10/

As always I’d encourage you to solve the puzzles yourself w/o looking at the answers. IRB can be a great friend for that.

Plus some of the solutions submitted don’t agree with my aesthetic sense, so I’d advise not to learn from them ;-)

You should be able to solve most of these initial puzzles with a single line. Only the last few required a little more.

Enjoy!

 
Feb 23, 2008
Avatar EldonAlameda 216 post(s)

Topic: Introductions / why this book is freakin awesome

Thanks for the kind words!

 
Feb 23, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / problem in _todo partial

both work in the 1.2 version of rails (don’t think they do in 2.0) – however the :dependent => :destroy became the preferred approach. I think it’s because it also allows you a little more flexibilty. i.e. you can also set it to :dependent => :nullify to remove the foreign_id yet keep the record.

 
Feb 23, 2008
Avatar beta 7 post(s)

Topic: MonkeyTasks Discussion / problem in _todo partial

my Task model has the line:

has_one :todo, :dependent => :destroy

Which i saw in the errata.
However in the source code I downloaded this line is written as:

has_one :todo, :dependent => true

Next Page

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 20