Merged mobile_controller into the todos_controller. The lightweight mobile HTML is

arguably just another representation of the same resources, so it seems to fit
the RESTful Rails paradigm to use an extension (.m) to switch on in the
respond_to stanza.

I needed some hackery to make this work. See my note in todos_controller for
a full explanation.
 
I also added a route to get to the mobile view by using 'domain.com/m'

Created some selenium tests for the mobile view, too. 

In optimizing the data access for the mobile view, I ran into "a bug in rails
pagination":http://dev.rubyonrails.org/ticket/7885" and integrated a nice
pagination plugin from the Err the Blog guys
("will_paginate":http://errtheblog.com/post/929) to work around the issue.

NOTE that this changeset includes a new line in environment.rb.tmpl (at
the bottom). Be sure to copy this into your environment.rb file. 

These changes fix #489 (cannot edit action using mobile interface).
Thanks for the bug report, lrbalt!

In the name of consistency, I made the argument to the block for all
respond_to calls 'format' (instead of the formerly cool 'wants').

Lastly, I added a link to the project's new contribute page to the footer of
the main web UI. Help us join the Mac on Intel world. :-)



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@517 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-04-02 04:18:19 +00:00
parent f3f881e47e
commit ba0b52ff1a
32 changed files with 445 additions and 258 deletions

View file

@ -41,9 +41,9 @@ class ContextsController < ApplicationController
end
@saved = @context.save
@context_not_done_counts = { @context.id => 0 }
respond_to do |wants|
wants.js
wants.xml do
respond_to do |format|
format.js
format.xml do
if @context.new_record? && params_are_invalid
render_failure "Expected post format is valid xml like so: <request><context><name>context name</name></context></request>."
elsif @context.new_record?