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 10, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / gruff gem error

Hi eldon I am lost… I followed this url
I think rmagick is working now….Nut I dont know if its working….. But I am getting this error

unable to read font `/usr/local/share/ghostscript/fonts/n019003l.pfb'

when I am pointing my url to http://localhost:3000/goals/2/report
I am pointing the moethod in the goal show

 
Feb 9, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

Sorry that li element was meant to replace the one in your your partial – not go in your css :-)

As for the highlight – it is possible to only highlight a single element using scriptaculous – however I don’t think there’s a way to target a specific item within a sortable list because technically we are changing the entire list. If you move an item from #7 to #2 – that also affects all the other list elements. If you watch the AJAX requests/responses in Firebug, you can see that the action is sending / receiving the entire list each time (even the items that don’t change)

 
Feb 9, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / gruff gem error

Here’s the WayBack Machine version of the page from the book

http://web.archive.org/web/20070808073943rn_1/hivelogic.com/narrative/articles/rmagick_os_x?status=301

here’s another page talking about ways to fix it http://poocs.net/2005/7/6/making-rmagick-suck-less-with-tiger

And a wiki page of yet another method http://wiki.rubyonrails.org/rails/pages/HowtoInstallRMagickOnOSXTiger

 
Feb 9, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / gruff gem error

Hi Eldon, I am using macbook intel core 2duo.. with Tiger 10.4.11

 
Feb 9, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / gruff gem error

Yeah Rmagick can be a pain sometimes.

Can you confirm your OS (I’m assuming) mac and version (i.e. tiger, leopard, etc) and i’ll see if I can dig up something for you.

 
Feb 9, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / gruff gem error

I’m having hard time installing rmagick… I dont know what to do? can you suggest me… I tried to follow that link you gave me but Its not working..
Phew tried installing Fink, macports and tried to install graphicmagick compiled it and installed but still the Bus Error

 
Feb 8, 2008
Avatar EldonAlameda 216 post(s)

Topic: Cool Stuff / Heroku - Have you seen this?

I’m in the beta now – but probably won’t have a chance to play with it until some time late next week.

 
Feb 8, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / gruff gem error

That’s a new one for me—haven’t seen it myself on several installs.

however a quick google search reveals that a few other people have been bit my something similar (see comments here )

I’m wondering if it could be a problem with your Rmagick install (see this )

Best I can suggest is try those suggestions and try to remove and reinstall imagemagick, rmagick, and gruff.

 
Feb 8, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / gruff gem error

Hi eldon, I installed the gruff gem and inserted it into routes.rb. I completed till page 167. But when i load the goals show page the mongrel server is quitting with an error.

** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).
** Rails signals registered.  HUP => reload (without restart).  It might not work well.
** Mongrel 1.1.3 available at 0.0.0.0:3000
** Use CTRL-C to stop.
/usr/local/lib/ruby/gems/1.8/gems/gruff-0.2.9/lib/gruff/base.rb:1034: [BUG] Bus Error
ruby 1.8.6 (2007-03-13) [universal-darwin8.0]

[1]+  Done                    mate .
Abort trap
 
Feb 8, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / a dumb question?

got the point…. thanks…. It think it took more than 5minutes to type all that… thank you

 
Feb 8, 2008
Avatar EldonAlameda 216 post(s)

Topic: Cool Stuff / Heroku - Have you seen this?

Read about it and watched it’s screencasts. Seems pretty interesting – think it would be a great solution for hobby stuff now and potentially more serious stuff at some point in the future.

I signed up for the beta to give it a try once i get in.

 
Feb 8, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / a dumb question?

No dumb questions.

I was trying to explain in the previous section that this page really isn’t designed for using error_messages_for—that’s why I recommended using the flash instead. So to display the flash message you’re creating in the controller you would just need to replace the error_messages_for call with a simple

<%= flash[:notice] %>

As for the error_messages_for—Take a look on page 145-146 and you can see how the error_messages_for method is being used in the scaffold created templates for a goal in the edit template. There the edit controller has created a goal object (@goal). It’s errors within this goal object that would cause this method to display anything.

Which might make more sense if I demo it in script/console

ruby script/console 
Loading development environment.
>> e = Excercise.new
=> #<Excercise:0x21f17cc @attributes={"name"=>nil, "user_id"=>nil}, @new_record=true>

So here we’ve started up a script/console session and created a new exercise object (stored in variable e). However the Excercise model has a few validation requirements on it such as “validates_presence of :name”—so if we haven’t set a name and attempt to save the object – we get:
>> e.save
=> false

but now let’s take a look at at our excercise object and see how it’s changed
>> e
=> #<Excercise:0x21f17cc @attributes={"name"=>nil, "user_id"=>nil}, @new_record=true, 
@errors=#<ActiveRecord::Errors:0x24e657c @errors={"name"=>["can't be blank"]}, 
@base=#<Excercise:0x21f17cc ...>>>

See those values stored in @errors – thats what the error_messages_for method is looking for. The login method isn’t creating any instance variables of an activerecord object that would be used on these pages – so the error_messages_for method has nothing to display.

Does that help?

 
Feb 8, 2008
Avatar Roupen 84 post(s)

Topic: Cool Stuff / Google Analytics...

Quick update: I added google’s code into applications.rhtml in the case of Monkey Tasks since it gets included into every page and google recommend including the tracking code on every page. Note that the code has to be above the </body> block. Google is now tracking the site, which is pretty cool.

 
Feb 8, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / a dumb question?

Hi Eldon, I want to ask a dumb question? How to use error_messages_for exactly.
Session_controller.rb – create method

else
      render :action => 'new'
      flash[:notice] = "Invalid username/password combination" 
    end   

new.rhtml
<%= error_messages_for :create %>

<% form_tag session_path do -%> 

I am not able to see the error message. Could you exactly tell me what paramaters should match. that means what should be in error_messages_for :value and from where that value comes from…

 
Feb 8, 2008
Avatar Roupen 84 post(s)

Topic: Cool Stuff / Heroku - Have you seen this?

http://www.techcrunch.com/2008/02/07/heroku-lifts-ruby-on-rails-development-to-the-cloud/

 
Feb 8, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

Nice quote ;-)

Um, so I added the above live to the bottom of the CSS (wasn’t sure where else to add) – no difference.

Another effect that I noticed is—say you have 3 items on the schedule and you mark one of them as complete the whole area around the three lights up with the visual effect (yellow fade) not just the item that you mark as complete. I figure that’s because the visual_effect in sortable_element is being applied to todo-list. Any way to make the visual effect apply to only a single item?

<%= sortable_element 'todo-list', :url => { :action => "sort", 
                                  :id => @today }, :complete => visual_effect(:highlights, 'todo-list') 
 
Feb 8, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / problem with workout show method

Thankfully I simplified the app a bit from my original design.

Originally i had scoped it out to handle various types of exercises (i.e. not just repetition/ resistance based but also time based and distance based) and I had a bunch of superfluous RJS stuff flying all over the place.

Hate to think about how confusing it might have been if I had continued down that path

 
Feb 7, 2008
Avatar Roupen 84 post(s)

Topic: MonkeyTasks Discussion / Ch 5 Add Validations

aha :)

 
Feb 7, 2008
Avatar stranger 46 post(s)

Topic: Exercisr Discussion / problem with workout show method

thanks eldon, I actually changed the edit_activity_path(@workout, activity) a while ago. But the problem was I was redirecting to the /activities page. Anyway thanks.
I am very confused when I am handling 6 controllers and their views… I feel lost when I get an exception…. Frightening..

 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Where's Ajax?

can always cheat :-) (love this quote)

<li id="todo_<%= todo.id %> style="cursor:move;">
 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Ch 5 Add Validations

is this a typo in the book?

if so—sigh…..

 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: MonkeyTasks Discussion / Ch 5 Edit Task

IMHO – the best place to start is to create it as a separate page at first. So you would add a link of some sort to edit the task which takes you to a custom page focused on editing the task.

Once you’ve got the code working that way – it usually makes it easier to “extract” out the pieces that you’re interested in for making a more ajaxy approach.

As for possibilities – you could do in_place_edit, you could do some sort of pop-up window (perhaps using a lightbox style solution like this , you could even do a dialog box on the bottom of the screen like this forum software does. There are tons of approaches – each with their own pros / cons.

 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / problem with workout show method

as for your routing errors – when you create a nested route – you need to make sure that you reference it a little differently in your views. So instead of just saying activity_url(@activity) you would need to also pass it a reference to a parent object like activity_url(@workout, @activity). I saw a few places in your code where it wasn’t like that which will cause some errors.

As for this specfic error – when the activity is being posted it is going to the create method in the activities_controller – which saves the activity and is supposed to redirect back to the workout like this

format.html { redirect_to workout_url(@workout)}
Yours was still set to try to go to the activity (minus the @workout reference)

I also noticed that after I fixed that error – it got a new error when it tried to display the activities for that workout. That’s because in your _activity.rhtml partial you were building the links like this

edit_activity_path(@workout, @activity) %>
However within the partial, we’re iterating over that collection so it should be
edit_activity_path(@workout, activity) %>

 
Feb 7, 2008
Avatar EldonAlameda 216 post(s)

Topic: Exercisr Discussion / problem with workout show method

for error messages question – you’re attempting to pass it a named route instead of an object.

Typically you’ll use the errors_for to display the errors that occur for a specific object. i.e. we’d have a post model that we’d call form_for(:post) and then add in the error_message for that model.

The acts as authenticated login doesn’t quite fit that mold though.

I would recommend using a flash message instead.

 
Feb 7, 2008
Avatar stranger 46 post(s)

Topic: MonkeyTasks Discussion / Ch 5 Edit Task

hi roupen…. the prototype and scriptaculous are used for this purpose. in_place_editor is used… passing right parameters will produce edit box on the fly.
More to come from eldon

Next Page

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