[Rails] Re: path problem

2009-05-07 Thread Stephen Fagan
I got it sorted out. It turned out to be new_mobile_topic_path. So obvious its frightening :@o Thanks Steve Tom Z Meinlschmidt wrote: run rake routes command to show all possible routes and path/url names tom Stephen Fagan wrote: :controller = 'mobile/topics

[Rails] will_paginate problem

2009-05-05 Thread Stephen Fagan
Hi all, I'm having a bit of a problem with displaying a blog list using the will_paginate helper. My code is: entries_controller: def index @entries = Entry.find(:all) @blog_entries = @entries.paginate( :page = params[:page], :per_page = 4, :include =

[Rails] Re: will_paginate not showing

2009-05-05 Thread Stephen Fagan
Franz Strebel wrote: On Mon, Sep 22, 2008 at 1:41 PM, MR Damien rails-mailing-l...@andreas-s.net wrote: I though this argument was facultative. If you don't specify anything, it will display 30 :per_page Franz Thanks Franz, you know I originally had that but it did not work

[Rails] rake rails:update question

2009-05-05 Thread Stephen Fagan
Does running the rake rails:update command just update the current rails app you are in? Sorry if this is a stupid question, I am trying to run 2 different versions of rails and need to upgrade one of my apps. thanks Steve. -- Posted via http://www.ruby-forum.com/.

[Rails] Re: undefined method `relative_url_root'

2009-05-04 Thread Stephen Fagan
�am, Stephen Fagan rails-mailing-l...@andreas-s.net Hi, I'm using 2.0.2. Im not 100% what you meant in your post. Do you mean replace the whole line with the line a javascript_include_tag 'ym4r-gm' unless options[:without_js}? (This gives an 'unexpected tSTRING_BEG' error). Apologies

[Rails] Re: undefined method `relative_url_root'

2009-05-04 Thread Stephen Fagan
Frederick Cheung wrote: On May 4, 8:05�am, Stephen Fagan rails-mailing-l...@andreas-s.net wrote: Hi, I'm using 2.0.2. THat;s before relative_url_root was defined on ActionController::Base (used to live on AbstractRequest or something like that). If you're new to rails and don't have

[Rails] undefined method `relative_url_root'

2009-05-03 Thread Stephen Fagan
Hi all, I've installed the ym4rgm plugin so that I can integrate a google map to pinpoint locations of photos. I cant find where the error refers to. I got the API key from google for http://localhost and put it into config/gmaps_api_key (development and test). The error is: undefined method

[Rails] Re: undefined method `relative_url_root'

2009-05-03 Thread Stephen Fagan
Sorry, I should have added the trace: vendor/plugins/ym4r_gm/lib/gm_plugin/map.rb:36:in `header' app/views/user_photos/show.rhtml:2:in `_run_erb_47app47views47user_photos47show46rhtml' app/views/user_photos/show.rhtml:1:in `_run_erb_47app47views47user_photos47show46rhtml'

[Rails] path problem

2009-05-03 Thread Stephen Fagan
Hi all, I am trying to create a mobile version of my application and for example for the mobile forums in routes.rb is: map.resources :forums, :controller = 'mobile/forums', :path_prefix = '/mobile', :name_prefix = 'mobile_' do |forums|

[Rails] Re: problem with nil.user

2009-05-01 Thread Stephen Fagan
E. Litwin wrote: Just to clarify - are you setting session[:user_id] in the user.login! (session) call? The other suggestions on handling a nil session[:user_id] (i.e. using find_by_id) are the appropriate ways to handle the error. Eric On Apr 30, 12:09�pm, Stephen Fagan rails-mailing-l

[Rails] SQL joins question

2009-05-01 Thread Stephen Fagan
I want to link up 3 tables to list all members of a particular group. My code (which is wrong) looks like this: @group_members = Membership.find( :all, :joins = ['FROM memberships INNER JOIN groups ON memberships.group_id= group.id' + 'INNER JOIN users ON

[Rails] problem with nil.user

2009-04-29 Thread Stephen Fagan
Hi all, I've put new code into my app so that an administrator will have extra privileges (administer users, edit pages). The error is: 'Couldn't find User without an ID' So the app is looking for a logged in user when the homepage is accessed. Heres my code: site/index view: % if

[Rails] Re: problem with nil.user

2009-04-29 Thread Stephen Fagan
Rick Lloyd wrote: Try def is_logged_in? @logged_in_user = User.find(session[:user]) if session[:user] end On Apr 29, 10:15�am, Stephen Fagan rails-mailing-l...@andreas-s.net Thanks Rick. It worked a treat and also opened up a couple of gaping holes aswell (which I've managed

[Rails] strange path errors

2009-04-28 Thread Stephen Fagan
Hi all, I am suddenly getting path errors in my application where there were none before. I have a user login that directs the user to their profile page. I can login ok for some users, but others I am getting path errors such that I cant log in e.g. user_photo_url failed to generate from

[Rails] login system - user password being updated

2009-04-26 Thread Stephen Fagan
I am developing a small site. The login system works fine and I am using the sha1 hashing alg to hash passwords. I have an admin side that can enable or disable users. The problem seems to lie in the disable (destroy) method. When I disable a user, it updates the password to a new password so

[Rails] Re: login system - user password being updated

2009-04-26 Thread Stephen Fagan
I ended up kinda working it out. I now just reset the password and email the link to the user. Not 100% ideal but it works! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Listing elements from a table

2009-04-22 Thread Stephen Fagan
I am writing an application where users can become members of different groups. On each group page I want to list all the members of the group by user name and also the groups to which they belong. My group table consistes of id, name, description. My membership table consists of id, user_id,

[Rails] Re: Listing elements from a table

2009-04-22 Thread Stephen Fagan
Those are some of the things I can think of that should help you build your group show pages. Hope this gives you some ideas on how to proceed. Thanks a million. Thats helps me a great deal. Sometimes you cant see the wood for the trees! -- Posted via http://www.ruby-forum.com/.

[Rails] R6034 error - RMagick

2009-04-13 Thread Stephen Fagan
Hi all, I am using RMagick in an application to upload photos. I have installed ImageMagick and RMagick gem ok. But when I try to upload a photo, I get the following error (pop-up): Runtime Error! Program: c:\ruby\bin\ruby.exe R6034 An application has made an attempt to load the C runtime

[Rails] Re: Error reverting back to a previous version of rails

2009-04-13 Thread Stephen Fagan
Hassan Schroeder wrote: On Sun, Apr 5, 2009 at 3:13 AM, Stephen Fagan rails-mailing-l...@andreas-s.net wrote: I want to revert back to a previous version of rails (1.2.3) but the project I want to work on was created in 2.0.2. c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb

[Rails] Error reverting back to a previous version of rails

2009-04-05 Thread Stephen Fagan
I want to revert back to a previous version of rails (1.2.3) but the project I want to work on was created in 2.0.2. I have uninstalled 2.0.2 and gem installed 1.2.3 but when I run script\server I get the following error. (I'm guessing its to do with my environment file but I'm pretty new to

[Rails] Re: Error reverting back to a previous version of rails

2009-04-05 Thread Stephen Fagan
Stephen Fagan wrote: I want to revert back to a previous version of rails (1.2.3) but the project I want to work on was created in 2.0.2. I have uninstalled 2.0.2 and gem installed 1.2.3 but when I run script\server I get the following error. (I'm guessing its to do with my environment file