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 18 19 20

Feb 7, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Ch 5 Edit Task

Hi Eldon, need a bit of hand-holding on this one…

What I’m thinking on Edit Task is this…

  1. click on the text and it turns to an editable area in place – same as post title edits here. Alternatively, there is the Google docs way of poping an edit box (if you try to edit a document name for example).
  2. text is editable whether a task is in the schedule area or the sidebar. The first approach may not be a good option since space is limited – popping an edit box may be better. Alternatively, could make tasks editable only in the schedule area but that would be a bit odd.

Any sample code you can point to – in general, whats a good place to forage for sample code for stuff like this since a million other projects probably have already done this.

Has anyone else done this?

 
Feb 7, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Ch 5 Add Validations

validates_presense_of should be “presence” :-)

 
Feb 7, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

I will… In the CSS I see two li related blocks… #topnav ul li and #topnav ul li a:link, #topnav ul li a:visited I added the above to these, one at a time, but didn’t see a difference. Where in the CSS should I add?

 
Feb 7, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / problem with workout show method

after making the change I got a routing error.

workout_activity_url failed to generate from {:workout_id=>#<Activity:0x31edb1c @errors=#<ActiveRecord::Errors:0x31ead04 @errors={}, @base=#<Activity:0x31edb1c ...>>, @new_record=false, @attributes={"id"=>4, "repetitions"=>"6", "resistance"=>"8", "workout_id"=>2, "excercise_id"=>"1"}>, :controller=>"activities", :action=>"show"}, expected: {:controller=>"activities", :action=>"show"}, diff: {:workout_id=>#<Activity:0x31edb1c @errors=#<ActiveRecord::Errors:0x31ead04 @errors={}, @base=#<Activity:0x31edb1c ...>>, @new_record=false, @attributes={"id"=>4, "repetitions"=>"6", "resistance"=>"8", "workout_id"=>2, "excercise_id"=>"1"}>}

But when I come back to the workout page http://localhost:3000/workouts/3
I have the entry in the page I tried to insert…

 
Feb 7, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / problem with workout show method

speechless… thank you….
Also how to add an error message for invalid login on the sessions new.rhtml
I put <%= error_messages_for :session_path %> But I dont see any

 
Feb 7, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Yes Sir, thanks.

 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

nahabed,

Did you try adding a CSS style to the li elements?—something like

cursor: move;

 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / problem with workout show method

that was an interesting one to troubleshoot!!!

But I believe I found the issue.

Since it was dying in the form_for method, I knew it had to be something about the parameters that were being passed to it. The first thing i did was verify that you had built the activity model and nothing looked wrong there. So my attention turned to the URL generation. It looked fine but I noticed that if I removed it from the form_for

<% form_for(:activity) do |f| %> 
That the page would render without error.

So I opened up your routes file and started looking for typos. It took me a minute but then i saw the problem—in your route for activities you had it like this:

  map.resources :workouts do |workout|
    map.resources :activities
  end

When really it should be

  map.resources :workouts do |workout|
    workout.resources :activities
  end
since this is a nested route.

Once I corrected that – the page displayed without error.

 
Feb 7, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / problem with workout show method

Hi Eldon, I have completed the exercisr app till pg 136. I put the activities partials (activity and form) in the workout show page. When I try to add activity for a exercise through the form partial I am getting a error

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.to_sym

here is a copy of the project code.
http://priyav.com/exercisr.zip

 
Feb 6, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Cool – congrats!

I know you had some questions about the vendor everything approach – did I answer those well enough for you?

 
Feb 6, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

I gave up on the topfunky appraoch and went with the “vendor-everything”. The code is live on production…

 
Feb 6, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

Everyone, here’s an update on this – I figured I’d put this back here so others may benefit.

With awesome Eldon’s help… The ajax issue turned out to be a typo. The ID element my todo list is todo-list however in the sortable_element method call you were telling it to target the element with the id of todo_list (i.e. an underscore instead of a hyphen).

So that’s fixed. Now I’m trying to nail down the behavior of the todo items under “Today’s Tasks”.

I’m on FF 2.x and here’s what my cursor is doing: a) over the check box and right arrow images, my cursor is the “hand” b) over blank space, between the text and the right-arrow, my cursor is the “arrow” and I CAN grab and drag fine c) over the text itself, the cursor is a vertical line and I am cant grab the item. From my emailing with Eldon, sounds like I should be able to grab the text and move the stuff around.

 
Feb 6, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

Well if you still can’t find the problem – could you please zip up the app and email it to me so I can take a look at it later tonight?

 
Feb 6, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

Thanks—ya Firebug does report a single error when I login and the today page loads – I have 3 tasks in the schedule section.

element has no properties
_findRootElement(null) dragdrop.js (line 575)
options(null)dragdrop.js (line 582)
destroy(null)dragdrop.js (line 588)
create(null)dragdrop.js (line 624)
[Break on this error] while (element.tagName != "BODY") {
dragdrop.js (line 575)

I compared my changed to the reference code and its identical…

No error in the development.log

 
Feb 5, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

have you looked at the development log in /log? Typically if there was an error it will show up there.

Another good trick is to use the firebug extension in FireFox and view the AJAX post / response to see what’s happening.

 
Feb 5, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

2. no you still need to do a gem install chronic to install the gem, gem unpack simply copies the installed gem into a private directory. See http://rubygems.org/read/chapter/10#page39

3. It’s referring to if you only want some gems to be active while running in development or test, but not active if running in production. Or vice versa.

4. It means that simply unpacking the gem into your application doesn’t make it load with Rails. You still need to have that require ‘chronic’ line at the bottom of your environment.rb

 
Feb 5, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

I just implemented the changes on page 79-80 under “Ajaxcifiation” section up to but not including the RJS section. The last paragraph says “Refresh out home page page – we’ve added true dray-and-drop sorting of our daily schedule…” I don’t have it. Everything behaves just as before :( No error or warnings either. I even restarted mongrel.

I modified /today/index.rhtml and task_controller – what am I missing?

UPDATE: I just finished through the rest of the section. Toggling the Add Task form is working fine. Task complete is also working but popping an RJS error that I’m looking into. The schedule page is still un-ajaxed.

 
Feb 5, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Top of p76 (minor)

Figure 3-9 is called out—should be Figure 4.4

 
Feb 5, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Update: Just tried running the topfunky rake

D:\users\nahabed\RoR\InstantRails\InstantRails-1.7\rails_apps\monkeytasks>rake topfunky:freeze:others GEMS=chronic
(in D:/users/nahabed/RoR/InstantRails/InstantRails-1.7/rails_apps/monkeytasks)
Freezing chronic...
Freezing chronic for 0.2.3...
The system cannot find the path specified.
rake aborted!
ERROR: Maybe you forgot to install the 'chronic' gem locally?

(See full trace by running task with --trace)

D:\users\nahabed\RoR\InstantRails\InstantRails-1.7\rails_apps\monkeytasks>

Do I need to pre-create a folder under /vendor or something?

“gems list” shows chronic as having been installed :(

A quick note about your comment a couple of entries above “Installing the TopFunky Power Tools plugin (which provides an updated version of this Rake task according to the web page)” NOTE I did start with this re: http://topfunky.net/svn/plugins/topfunky_power_tools/tasks/freeze.rake and copied it to lib/tasks so hopefully, its the latest and greatest.

 
Feb 5, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Thanks. I’m going to give the above a try… I did look over (and under and over again) the vendor everything http://errtheblog.com/posts/50-vendor-everything but a few things didn’t compute in my head… I will probably use this method on the next exerciser project.

Using Chronic as the example:

  1. The article says “We obviously added a few directories, namely gems, data, and bin.” Ok so I hand create gems, data and bin under /vendor
  2. Next step th article says is ”$ gem unpack chronic” inside /gems.” So does this replace “gem install chronic” approach which we used until now?
  3. I then modify config/environment.rb as shown. Ok, I understand that. I didn’t quite follow the part about “Want to only include some libraries in a specific environment?” What’s that about?
  4. I’m done – is that it? :) Whats the part at the bottom about “auto requiring gems” :-? Do I need to do that?

See? I am easily confused….

 
Feb 5, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

and IIRC = If I Recall Correctly

:-)

 
Feb 5, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Installing the TopFunky Power Tools plugin (which provides an updated version of this Rake task according to the web page) – I noticed that when I viewed the available tasks, I got a little more information

rake --tasks
 .........
rake topfunky:freeze:others            
# Freeze third-party gems to 'vendor'. Requires GEMS environment variable to be 
set or passed on command-line (space-delimited).

So it seems that a new requirement is to pass it a GEMS variable, but i couldn’t find any documentation on what it was search for, after some trial and error though.. I got this to work
rake topfunky:freeze:others GEMS=chronic
Freezing chronic...
Freezing chronic for 0.2.3...
Unpacked gem: 'chronic-0.2.3'

I haven’t tested this any further, but hopefully this will help get you going.

Personally at this point – i think I’d start using the err the blog vendor everything method instead.

 
Feb 5, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

I’ve googled around to avoid asking an “obvious” question – whats IIRC? :-}

My /vendor has /plugins and /rails 

/rails has /actionmailer /actionpack /actionwebservice /activerecord /activesupport /railities under it

/plugins has /acts_as_authenticated under it

I am expecting to see “Chronic” as a subdirectory and /vendor/lib somewhere in there. Am I chasing my taile?

You know, I been thinking… is gems.rake even meant to run on a windows box? hm…

 
Feb 5, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Since you’re using Instant Rails – you are using the button to open a command line from within the Instant Rails interface correct? And not just a standard windows command line.

Instant Rails provides a custom command line window that sets a number of paths and environment variables that you need IIRC

 
Feb 5, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Freeze_other_gems

Gaaaa….

D:\users\nahabed\RoR\InstantRails\InstantRails-1.7\rails_apps\monkeytasks>rake topfunky:freeze:others
(in D:/users/nahabed/RoR/InstantRails/InstantRails-1.7/rails_apps/monkeytasks)
rake aborted!
Requires a 'GEMS' environment variable (space-delimited).

(See full trace by running task with --trace)

Next Page

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