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 ... 20

Mar 25, 2008
Avatar EldonAlameda 216 post(s)

Topic: Church Community Discussion / getting most recent blog posts

At a meeting with a client right now, but I wouldn’t expect it to be an issue with MySQL vs Sqlite either, my big curiosity though is if there had been a change to SQL that ActiveRecord would generate for this command.

 
Mar 25, 2008
Avatar Lei 14 post(s)

Topic: Church Community Discussion / getting most recent blog posts

Eldon,

I’m using 2.0.2. I only had around 6 users and less than 15 posts. Maybe I should try it out with Sqlite3, though it’s unlikely to be a database specific problem.

 
Mar 25, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Active record statement invalid

Groovy.

Glad I was able to solve it for you : that other plugin really through for a loop until I noticed that it was installed. Then it suddenly made sense why Rails was looking a join table that didn’t exist. :-)

 
Mar 25, 2008
Avatar SashaSki 4 post(s)

Topic: MonkeyTasks Discussion / Active record statement invalid

Thank you very much I see where I went wrong now, everything is working great now!

 
Mar 25, 2008
Avatar EldonAlameda 216 post(s)

Topic: Church Community Discussion / getting most recent blog posts

Lei,

I haven’t been able to replicate the problem yet. But I’m going to give it another whack soon after dumping a few hundred records into the database to see if I can recreate what you’re seeing.

Which version of Rails are you using? 1.2.6 like in the book or something newer?

 
Mar 25, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Active record statement invalid

Okay – found a couple problems in the code.

1. You added some plugin named acts_as_habtm_list in addition to the acts_as_list plugin. (acts_as_list used to be part of Rails core but was moved to a plugin in Rails 2.0). Then in your todo model you were using this acts_as_habtm_list instead:

acts_as_habtm_list :scope => :schedule 

I changed it to
acts_as_list :scope => :schedule 
as it is in the book to get past this error.

However in my testing of moving tasks to and from the current todo list – I noticed that adding more than one task caused the list to have duplicate entries. Looking at your template I noticed this

    <ul id="todo-list">
      <% for todo in @todos %>
        <%= render :partial => 'todo', :collection => @todos %>
      <% end %>
    </ul>

If you notice – you’re iterating over the collection of todo’s and then calling the partial on the full collection each time (so in essense you’re iterating over them twice)

I changed it to this and everything seemed to be working fine afterwards

    <ul id="todo-list">
        <%= render :partial => 'todo', :collection => @todos %>
    </ul>

 
Mar 25, 2008
Avatar SashaSki 4 post(s)

Topic: MonkeyTasks Discussion / Active record statement invalid

Thanks for taking the time, ive uploaded it here: http://goodphoto-greatphoto.co.uk/sasha/monkeytasks.zip

 
Mar 25, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Active record statement invalid

Hi,

That is an error I haven’t seen before. Could you shoot me a zipped up copy of your application code as it is now and I’ll do a little local testing to see if i can locate the problem.

Thanks

 
Mar 24, 2008
Avatar SashaSki 4 post(s)

Topic: MonkeyTasks Discussion / Active record statement invalid

Whenever I click on an arrow to place a task into my “Today’s Tasks” I receive the following error:

ActiveRecord::StatementInvalid in TodoController#create

PGError: ERROR: syntax error at end of input at character 77
: UPDATE schedules_todos SET position = 1 WHERE schedule_id = 1 AND todo_id =

The App Trace says the error is in app/controllers/todo_controller.rb:6
That line is: current_user.schedule.todos.create(:task_id => task.id)

I’ve gone through the source code and can’t see what the problem is, any help would be great!

 
Mar 24, 2008
Avatar EldonAlameda 216 post(s)

Topic: Church Community Discussion / getting most recent blog posts

Hi Lei,

I was out of town for the holiday weekend but will take a look at the queries over the next day or so to see if I can determine if something was changed within ActiveRecord that might have caused this issue for you or if there’s a difference between MySQL and sqlite that might be causing it.

As an FYI – typically what I’ll do is to evaluate the pure SQL that’s generated by ActiveRecord in both databases to see if there might be a problem.

 
Mar 22, 2008
Avatar Lei 14 post(s)

Topic: Church Community Discussion / getting most recent blog posts

Hi Eldon,

I’ve just rebuilt the community site. I found a problem with the Post.recent class method, which is used to grab the most recent blog posts grouped by unique users. But for some reason the method actually returns the most recently created users with their first post. The Photo.recent method seems to have the same problem. Not sure if this is a database specific problem, I’m using Mysql, haven’t tested it with sqlite.

 
Mar 18, 2008
Avatar EldonAlameda 216 post(s)

Topic: Church Community Discussion / routings

Hi Lei,

I wouldn’t consider that routing to be purely RESTful as it doesn’t follow the conventions that you would expect – that’s not to say that it couldn’t be consumed by a RESTful interface if it was desired, but that wasn’t really the goal of doing the routing like that. I was really trying to make the routing more like what you would see in a traditional social network.

I subscribe very heavily to the idea that REST is a great thing, but it’s not the right fit for every application. So it doesn’t make sense to dogmatically try to force every application into that pattern.

CRUD based design however almost always seems to be the right way to go :-)

 
Mar 17, 2008
Avatar Lei 14 post(s)

Topic: Church Community Discussion / routings

Hi Eldon,
I’m going to redo the church community project by redesigning it to a kind of site that every one can register. In this project, you used the username (or login) as the key for routings, and added many named routes like map.showprofile ”:user/profile”, I can see clearly the reason you doing this, but can these routes still be considered as restful, without explicitly declaring map.resources profiles?

 
Mar 16, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / making link_to_remote restful

mark_complete.js.rjs is the proper name for an RJS template.

So when you click the link – is it kicking off an AJAX request or a full page request? i.e. where are you seeing this “template is missing” error message?

If you want to zip up the application and send it to my email, i’ll take a look at it what’s going on and let you know where the problem is.

 
Mar 15, 2008
Avatar Lei 14 post(s)

Topic: MonkeyTasks Discussion / making link_to_remote restful

hi Eldon,
Thanks for the prompt reply.
I have changed the link, now when I click on the tick it’s giving me:

Template is missing

Missing template tasks/mark_complete.html.erb in view path /Users/lei/work/tasks/task2.1/app/views

But the link is actually working, if I go back and refresh the page, I can see the todo item actually got crossed out. It just doesn’t seem to be able to find the template. I’ve change the mark_complete.html.erb to mark_complete.js.rjs, also mark_complete.js.erb, but none of them worked. I’m wondering if I need to add anything to the mark_complete method in tasks controller to make it render the right template?

 
Mar 15, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / On a Mac...

Thanks. I want to stick to Textmate and the console only too… IDE’s scare me :) I tried Aptana but didn’t care for it…The Apple article is the one I saw before writing the original post. The iPhone angle seems interesting otherwise, I think I am going to stick Textmate.

 
Mar 15, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / On a Mac...

I’m pretty much a Textmate fanboy. I use it for just about everything—I personally can’t imagine using anything else anymore.

I haven’t had a chance to try out Xcode for Rails development but I saw that article that you mentioned (http://developer.apple.com/tools/developonrailsleopard.html ) and thought that it might be fun to give it a try sometime.

If you’re looking for an IDE – giving Xcode a try would be good, but I’ve also heard several people in my local ruby users group who really like netbeans ( http://www.netbeans.org/features/ruby/index.html )

And RadRails just came out with it’s first update in a long, long time this last week. http://www.aptana.com/rails

 
Mar 15, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / On a Mac...

Eldon, I finally got my MBP today and I am on it now. Trying to keep the minimalist approach… I have downloaded TextMate… Apple’s docs on developing Rails on Leopard incorporate Xcode which is an IDE. Do you use Xcode?

 
Mar 15, 2008
Avatar EldonAlameda 216 post(s)

Topic: Announcements / RailsConf

Well – I finally bit the bullet and registered myself for this years RailsConf. This will be my first time going (sold out before I could get things arranged the first year, was too busy with the book last year).

So I’m pretty excited. The sessions sound pretty fun and interesting.

Anyone else going?

 
Mar 15, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / making link_to_remote restful

Hi Lei,
That’s awesome that you’re experimenting with converting the application.

Assuming that your named route is correct, looking at your code you might try changing your link_to_remote call to something like this

<%= link_to_remote image_tag(“check.gif”, :title => “Mark Complete”), :url =>{ mark_complete_task_path(todo.task) } %>

So in there I added the curly braces around the url parameters and removed the :id => from the parameters to the named route.

Let me know if that works, if it doesn’t it might be easier to zip me up a copy of the application and I’ll give it a test through locally and let you know exactly what the issue is. Troubleshooting AJAX calls are lot easier when i can monitor them in firebug.

 
Mar 14, 2008
Avatar Lei 14 post(s)

Topic: MonkeyTasks Discussion / making link_to_remote restful

hi, Eldon
I have converted monkeyTasks to restful routing. But I’m having problem changing the link_to_remote link on page 80 to restful routing as well. I’ve changed it to

<%= link_to_remote image_tag(“check.gif”, :title => “Mark Complete”), :url => mark_complete_task_path(:id => todo.task.id) %>

But, it doesn’t work. So, I’m wondering if you could give me some suggestion to make it work restfully.

Thanks

 
Mar 12, 2008
Avatar EldonAlameda 216 post(s)

Topic: Announcements / Starting New Book

Well it’s official – I signed the contract earlier this week, and started work on a new Rails book that will be out this fall.

This one will be a Beginning Rails 2.0 book, so I thought I’d toss out a quick thread here on the forums to gather any feedback from you guys that you’re willing to share.

1. Are there areas in Rails development that you wish were better explained to you in the beginning of learning Rails. Or areas that you feel aren’t covered well by other books?

2. How did you feel about the code-centric learning process that I tried to use for the Rails projects book?

3. Were there things about the previous book that you felt just didn’t work and should be avoided for the next one?

4. Anything else you would like to see in a Beginning Rails 2.0 book?

Thanks

 
Mar 10, 2008
Avatar EldonAlameda 216 post(s)

Topic: Cool Stuff / Good Article On Rails

I enjoyed this article about Why Rails Will Succeed

http://pivots.pivotallabs.com/users/chris/blog/articles/417-why-rails-will-reign-supreme

 
Mar 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Newbie on Rails (Leopard)

Thanks for the kind words.

I think that a revised edition of the book is a real possibility at some point in the future. I think it would be be fun to update the code and then expand some of the content to add some of the things that I wasn’t able to include in this first edition.

But it will be awhile before that happens. I’ve just started a new book ( a beginning Rails book) that will be out this fall, so I’ll have to finish that book first.

Besides I think waiting for a Rails 2.1 or 2.2 would make for a more interesting revision as we’ll most likely see some pretty major performance improvements and even more changes to Rails best practices between now and then.

 
Mar 7, 2008
Avatar jspeer 1 post

Topic: MonkeyTasks Discussion / Newbie on Rails (Leopard)

Eldon, thanks for a well done book. I think most of the issues i’m encountering are due to version mismatch (i ‘m using Rails 2.0.2).

If you decide to dive in to the changes 2.0.2 for a 2nd version of your book… or whatever, i’d line up to buy.

Thanks

Next Page

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