[Rails] Re: Route error to Admin namespace

2009-12-07 Thread Freddy Andersen
This works fine for me in jruby:

map.namespace(:admin) do |admin|
  admin.resources :clients
  admin.resources :options, :has_many = :widgets
end

Does this not work?

Make sure its above the default routes...

--

You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.




[Rails] Re: How do I implement this? run scheduler on one of cluster?

2009-12-01 Thread Freddy Andersen
You should code your own daemon that kicks of every min or so and this
daemon picks-up jobs and finishes these and marks them done. I think
there was a screen cast over with Ryan that shows how to implement a
simple daemon. (This way you can have multiple daemons.. )

Or you could use something like backgrounDrb as a scheduler...

--

You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.




[Rails] Re: Problem getting started with auto_complete

2009-10-28 Thread Freddy Andersen

That syntax was removed from Rails in 1.2.6 and moved to a plugin.

Here is one plugin that can be used http://github.com/rails/auto_complete

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Using Initializers

2009-10-19 Thread Freddy Andersen

I have another example that I have used for a while...

/config/settings.yml
all: all_environment_settings
  constant_for_all: somethinf

development: non_production_settings
: *all_environment_settings
something_different_for_dev: dev stuff

Then you can load this file in a initializer:

/initializers/settings.rb
SETTINGS = YAML.load_file(#{RAILS_ROOT}/config/settings.yml)
[RAILS_ENV].symbolize_keys

Now you can call this through SETTINGS[:constant_for_all]

Both methods will work but if you have requirements for the constants
to change between environments then this would be better...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Authlogic -- gem or plugin?

2009-10-19 Thread Freddy Andersen

I'm using the gem without issues...

If you use the GEM you will get a gem version installed so that you
can stay consistent between environments (dev, test, pre-prod,
prod... )

Iif you want the latest and greatest you need to use the plugin..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Ruby 1.9.1-p129 fails the configure on OSX 10.5.7

2009-06-11 Thread Freddy Andersen

cd ruby-1.9.1-p129
autoconf
./configure --program-suffix=19

checking whether ELF binaries are produced... no
checking whether OS depend dynamic link works... In file included
from /usr/local/include/fuse/fuse.h:26,
 from command line:1:
/usr/local/include/fuse/fuse_common.h:32:2: error: #error Please add -
D_FILE_OFFSET_BITS=64 to your compile flags!
In file included from /usr/local/include/fuse/fuse.h:777,
 from command line:1:
/usr/local/include/fuse/fuse_compat.h:68:24: error: sys/statfs.h: No
such file or directory
yes
checking for if make is GNU make... yes
checking for nroff... /usr/bin/nroff
creating config.h
configure: creating ./config.status
config.status: creating Makefile


Not sure why this is failing... I tried this configure string too but
with no luck

./configure --program-suffix=19 --enable-shared --enable-pthread
CFLAGS=-D_FILE_OFFSET_BITS=64
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Issues with MySql database encoding

2009-06-09 Thread Freddy Andersen

How was the database created? Through MySQL SQL import? Does the sql
have UTF-8?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Set a session variable in a link_to

2009-06-01 Thread Freddy Andersen

link_to(my link, my_task_path, :special_needs = true)

That would give you params[:special_needs]

What are the actions maybe you should have different controllers?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Simple model password protection?

2009-05-30 Thread Freddy Andersen

I'm sure there is a user created with the email that you give them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Routing inspection

2009-05-30 Thread Freddy Andersen

rake routes ?

On May 30, 8:40 pm, Saty Nos rails-mailing-l...@andreas-s.net wrote:
 Is there any way possible to get the child paths given a path?

 I mean given the following routes:

 map.resources :users do |user|
   user.resources :articles
   ...
 end

 If I give path = users/1, is there any way to get the routes
 users/1/edit, users/1/articles, users/1/articles/new ?

 Thanks in advance.
 -Satynos
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: SubDomain Queries

2009-05-29 Thread Freddy Andersen

Apache and mod_rewrite will be your friend. I would also setup a
virtualhost for the blog.company.com

But are you saying that you have mycompany.com which is a rails app
and you want your blog.othercompany.com to use your blog controller?

Or when people go on your blog they should see blog.mycompany.com in
the browser?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: turn off model pre-loading in production environment?

2009-05-28 Thread Freddy Andersen

Preload the controller? Could you please give an example
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Getting values from multiple select

2009-05-28 Thread Freddy Andersen

Is this in a form_for? if not you should use select_tag

http://apidock.com/rails/ActionView/Helpers/FormTagHelper/select_tag

What do you have in @options?

This is the select method
select(object, method, choices, options = {}, html_options = {})

Examples here 
http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/select

To debug these issues you should have a look at the compiled source
with view source in the browser and see what you got.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: city and state from zip code

2009-05-27 Thread Freddy Andersen

http://github.com/andre/geokit-rails/tree/master

On May 27, 5:55 pm, JannaB mistressja...@hotmail.com wrote:
 Anyone aware of a plugin that will return the city and state from a
 zip code in the US? THanks, Janna B
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Combine if and do in a single line?

2009-05-27 Thread Freddy Andersen

items.each { |item| item.stuff? } if current_user.admin?

On May 27, 6:17 pm, Mario Gr rails-mailing-l...@andreas-s.net wrote:
 Is there a  way to combine if and do into a single line?

 items.each do |item| if current_user.admin?
   #do stuff
 end

 Thanks!
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: beginner

2009-05-24 Thread Freddy Andersen

if params[:checkbox]

This checks if that params is true(true/false, 1/0) or not, but how
did you do you checkbox code? If its just a form_for .. do |f|
f.checkbox(:checkbox) you should be ok.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: help from Routing guru ...

2009-05-23 Thread Freddy Andersen

Well you have a namespace for hubs thats why there is no id for the
hubs

map.resources :hubs do |hub|
  hub.resources :settings, :collection = { :general = :get }
end

That will give you this:

/hubs/:hub_id/settings/general
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: SSL testing on localhost - segfaults aplenty !

2009-05-19 Thread Freddy Andersen

Where is the segfault?

Does Apache work like normal if you hit http and https ? You should be
able hit the site with both before you even install the rail ssl
require plugin. Mongrel does not care about if the client is talking
http or https with Apache.

Does the site work like normal if you hit Mongrel direct?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Sharing sessions across rails apps 2.3.2

2009-05-13 Thread Freddy Andersen

I had something very similar on one of my applications with 2.3.2 the
action_controller.session has changed and its now just :domain
and :key :

config.action_controller.session = {
  :domain = '.me.com',
  :key = '_my_session',
  :secret  = 'long string'
}

This shares the me.com cookie with *.me.com so www.me.com or
secure.me.com or me.com...

This goes in your environments/product.rb or development.rb files...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: html sitemap

2009-05-12 Thread Freddy Andersen

Creating a sitemap xml or html is just as easy as any other page...

In the controller pull the resources that are dynamic like

@pages = Pages.all

and then in the view do

% @pages.each do |page| %
%= link_to page.name, page_path(page) %
%end%

and then add the static stuff

% %w( page1 page2 ).each do |page| %
%= link_to page.name, some_path(page) %
%end%

how are your pages stored that you want in the site map?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: div_for and RJS

2009-05-08 Thread Freddy Andersen

The class will not work for a rjs call.. html class elements are not
unique by design so that is not a good idea anywho...

Here is a good description for div_for
http://apidock.com/rails/ActionView/Helpers/RecordTagHelper/div_for

It's just a way to create a div that has something todo with the
record that you have. So if you have a @user object with id of 1 you
would get id=user_1 for the div.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: projects works then breaks intermittently - mysql, linux

2009-05-07 Thread Freddy Andersen

Adam,

There is NO error report above... The output from you log file is
missing in this post. Please repost the error report.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Routing Error

2009-05-06 Thread Freddy Andersen

Why are the stylesheets and javascripts directories symbolic links on
production?

On May 6, 12:46 pm, Sj Tib rails-mailing-l...@andreas-s.net wrote:
 Folks,

 I am a little lost on a Routing error in accessing my javascripts and
 stylesheets files on production and hopefully someone can help me.

 Part of what is confusing me is that the same code that works fine on my
 XP dev box is giving this Routing error when I put it up on the hosting
 site in production environment. The only difference being the
 environment itself (prod vs. dev) and that the javascripts and
 stylesheets directories are symbolic links on production instead of
 actual directories as on my local dev box.

 For files like /javascripts/path/to/my.js and /stylesheets/myapp.css
 I get error message like

 ActionController::RoutingError (No route matches
 /stylesheets/myapp.css with {:method=:get}):
 /vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisa 
 tion.rb:66:in
 `recognize_path'

 I have looked at the routes.rb (included below) long enough but can't
 see what is causing this Routing error.

 I also started up a script_console and after loading up
 ActionController::Routing::Routes in a variable the recognize_path for
 stylesheets/myapp.css fails with the same error but it brings up the
 page fine on that dev box without any errors - which is a little
 confusing as well.

 Here is what I have in my routes.rb

   map.resources :users, :collection = { :resetpwd = :get, :getnewpwd
 = :get, :getpwdresetcode = :post }

   map.resource :session, :controller = 'session', :collection = {
 :welcome_home = :get}

   map.root :controller = 'session', :action = 'new'
   map.activate '/activate/:activation_code', :controller = 'users',
 :action = 'activate', :activation_code = nil
   map.resetpwd '/resetpwd/:resetpwd_code', :controller = 'users',
 :action = 'resetpwd', :resetpwd_code = nil
   map.signup '/signup', :controller = 'users', :action = 'new'
   map.login '/login', :controller = 'session', :action = 'new'
   map.logout '/logout', :controller = 'session', :action = 'destroy'

   map.connect ':controller/:action/:id'
   map.connect ':controller/:action/:id.:format'

 Sounds like I am missing something simple.

 Appreciate any thoughts/pointers.

 Thanks,
 -S
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Unable to deactivate forgery protection

2009-05-05 Thread Freddy Andersen

can you try

protect_from_forgery :except = [ :create, :other_task ]



On May 5, 1:14 pm, Fernando Perez rails-mailing-l...@andreas-s.net
wrote:
 Hi,

 I just created a new Rails app that will be receiving some POSTed data
 from the outside so it must skip the verify_authenticity_token for some
 create actions. Although I have added:
 skip_before_filter :verifiy_authenticity_token

 I still get InvalidAuthenticityToken. In one of my other Rails app
 (created back in Rails 1.2.6 and updated to 2.3.2 over time) this
 skipping works perfectly though, has anything changed since? Do I need
 to do anything more?

 Thanks.
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Base Auth plugin

2009-05-05 Thread Freddy Andersen

The base-auth plugin is a authentication plugin and has nothing todo
with how you access a resource (the users houses). You can use the
helper methods to enforce access rights but it still has nothing to-do
with user.houses

base-auth is a similar plugin to restful-authentication and Authlogic
just different features...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: git push doen't change my live application

2009-04-27 Thread Freddy Andersen

When you say git push? Do you mean an actual git push, or are we
talking cap deploy ?

If its cap deploy you need to make sure that your application has
restarted. What application server is it that you are using? Thin,
Mongrel, Apache?

On Apr 27, 12:40 pm, zelop...@gmail.com zelop...@gmail.com wrote:
 I am using dreamhost. All I i want to do is make changes on my
 application and push them live. Yes I am using capistrano with git.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: git push doen't change my live application

2009-04-27 Thread Freddy Andersen

BTW here is the Capistrano group http://groups.google.com/group/capistrano

On Apr 27, 1:16 pm, Freddy Andersen fre...@cfandersen.com wrote:
 When you say git push? Do you mean an actual git push, or are we
 talking cap deploy ?

 If its cap deploy you need to make sure that your application has
 restarted. What application server is it that you are using? Thin,
 Mongrel, Apache?

 On Apr 27, 12:40 pm, zelop...@gmail.com zelop...@gmail.com wrote:



  I am using dreamhost. All I i want to do is make changes on my
  application and push them live. Yes I am using capistrano with git.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Controller Instance Variables

2009-04-27 Thread Freddy Andersen

Is this something that you can do with a before_filter?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Opening a image located outside the public folder

2009-04-20 Thread Freddy Andersen

Do you have Apache as a frontend? then use alias and a directory
element to point apache away from the public directory.

Or use a symlink

On Apr 20, 4:10 pm, elioncho elion...@gmail.com wrote:
 Hello!

 Can anyone help me on how to open an image on the browser NOT located
 in the public folder. I am using the img tag, but the image doesn't
 opens because it's outside the public folder.

 Thanks,

 Elías
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Have simple sidebar code snippet for application.html.erb?

2009-04-15 Thread Freddy Andersen

or

div id='wrapper'
  div id='side'
%= content_for(:side) %
  /div
  div id='content'
%= yield %
  /div
/div

Then use css to float the side and content to the left with some
with...

Was that what you wanted?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: map.resources problem

2009-04-14 Thread Freddy Andersen

map.resources :accounts, :member = { :select_photo = :get } ???

On Apr 14, 5:47 am, MaD mayer.domi...@gmail.com wrote:
 you should read-up on REST.

 still (without knowing your code) you can just use routes the old
 fashioned style like you used to have them in rails  2.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: AJAX: link_to_remote creates a post request

2009-04-13 Thread Freddy Andersen

You are looking for link_to_remote that will give you the ability to
show/hide a div.

Here is an example to just show a div

link_to_function(show form, nil) { |page|
page.visual_effect :toggle_blind, 'form_div' }

If you want you can have a hide link inside the div that his hidden so
they can close the form again..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Method to remove html escape characters from strings

2009-04-08 Thread Freddy Andersen

If found this little snap that I got in my application_helper

  def remove_html_tags(str)
str.gsub(/\/?[^]*/, )
  end

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: How do I fix this? Power went down.

2009-04-07 Thread Freddy Andersen

Lets have a look at your store controller...

The nil happens here app/controllers/store_controller.rb:9:in
`add_to_cart'

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: STI Problem When Using Same Controller

2009-04-07 Thread Freddy Andersen

The user does not know what creditcards are in your user model. You
have to have an association in the user model if you want to do
User.first.creditcards.new

has_many :creditcards

or get the users account and then check the creditcard.. Since a user
has_many accounts you would have to get an account before you could
create a creditcard.

So something like User.first.accounts.first.creditcard.new would
explain better...

Or you could use has_many through and use the accounts model as the
through...

has_many :accounts
has_many :creditcards, :through = :accounts
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Rails or separate packages, RedHat

2009-04-07 Thread Freddy Andersen

If you install the gems as a non root user it will be installed in
~/.gems

gem install rails

will install it in ~/.gems

On Apr 7, 3:44 pm, RobR rob.webina...@gmail.com wrote:
 Good point.  Ok, a dumb question.

 I found I can run gem install -i install_dir -d bin_dir

 Where do people usually install such things in their user spaces?
 /home/user/var/lib/gems

 What about the -d bin_dir?  What kind of things go in there?  .so
 libraries like mysql.so?  What default location do those usually end
 up in?  Where is a usual place to put them in my home space?

 What environment variables do I need to work with to make my installed
 gems are used instead of older system installed gems?

 Regards,

 Rob

 On Apr 6, 2:07 am, Roderick van Domburg rails-mailing-l...@andreas-



 s.net wrote:
  Rob Redmon wrote:
   So, do I ask the IT department to install Ruby on Rails or continue
   asking for particular packages?  I'd rather just get the whole thing.
   If so, will an install of rails override or interfere with already
   installed rails libraries?  They will only install RedHat 5 managed
   packages without a huge fight.  Other packages, I have to compile and
   install in my own user space (/home).

  RHEL doesn't carry a lot of gems, and certainly not recent versions.
  Installing them yourself is the way to go.

  --
  Roderick van Domburghttp://www.railscluster.nl
  --
  Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Rails 2.3 Upgrade Issue with MemCache

2009-04-07 Thread Freddy Andersen

I'm not sure why this happens, BUT in rails 2.3.2 you have to wrap
your Workling loader a after_init like so:

config.after_initialize do
  Workling::Remote.dispatcher =
Workling::Remote::Runners::StarlingRunner.new
end


On Mar 20, 6:42 am, TomRossi7 t...@themolehill.com wrote:
 One of the plugins I use is Workling.  It throws the following error
 when I try to run it under 2.3:

 /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/
 dependencies.rb:443:in `load_missing_constant': uninitialized 
 constantMemCache(NameError)

 The offending line is:

       @@memcache_client_class ||= ::MemCache

 I don't know a lot aboutmemcache, so I'm not sure what changed with
 2.3 that could cause the error.  Anyone have some ideas?

 Thanks!
 Tom
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Just can't get Ruby on Rails to work in Leopard

2009-04-06 Thread Freddy Andersen

What are the latest gems/rails and ruby that you have installed?

here is some information that would be useful to use:

$ port list | grep mysql
$ mysql5 --version
$ port list | grep lang/ruby
$ gem list
$ ruby -v

On Apr 5, 11:20 pm, Scott Corgan scottcor...@gmail.com wrote:
 I have all the latest gems, rails, and ruby installed. I keep getting
 the same error, even when the re route of the mysql library. I don't
 know what else to do.

 Maybe an uninstall, clean install, and fix might work?

 On Apr 5, 11:51 am, Frederick Cheung frederick.che...@gmail.com
 wrote:



  On Apr 5, 6:16 pm, Jferg johngfergu...@gmail.com wrote:

   When I moved from 2.0 to 2.1.1 I followed  a similar set of steps - I
   googled first for any hazards - the one I found was fixed by me
   installing another gem based on error logs.  Though I did not upgrade
   MySQL yet and I don't use it in my dev environment much - yet.

   The one problem I saw with 2.2 was having to upgrade Ruby to 1.9 - I
   think that is required.

  Rails 2.2 doesn't support ruby 1.9 (rails 2.3.2 is the first version
  with ruby 1.9 support, but that ruby 1.9 is by no means compulsory)

  Fred

   If you are handy with XCode  you can always roll your own - Hive Logic
   probably has build it yourself directions for everything you'd 
   need:http://hivelogic.com/articles/view/ruby-rails-leopard

   Hope this helps.

   - John

   On Apr 5, 3:19 am, Scott Corgan scottcor...@gmail.com wrote:

I've tried a million different tutorials and I just can't figure this
out. I have all things needed to create the development environment
and I just can't get the server to function correctly I suppose.
Here's the error I am getting:

The bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.
/!\ FAILSAFE /!\  Sun Apr 05 00:17:39 -0700 2009
  Status: 500 Internal Server E rror
  dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/
gems/1.8/gems/mysql-2.7/lib/mysql.bundle

And then when I got to localhost:3000 and click on the About your
application's environment, I get a red box that says We're sorry,
but something went wrong.We've been notified about this issue and
we'll take a look at it shortly that drops down.

I can't find a solution anywhere.

Does anyone have any suggestions? Please help! I've spent hours and I
can't find anything.

Thank You!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: routes.rb noob question...

2009-04-06 Thread Freddy Andersen

Yes all you need is the second statement. If you have both try running
the command rake routes from the rails root directory it will show you
what the two would do.(Or the one if you remove the top one.) THe
second line could also be written like

map.resources :customers do |customer|
  customer.resources :accounts
end

You would need that if you wanted to add a member or collections route
to accounts

On Apr 6, 1:10 pm, internetchris ch...@silhouettesolutions.net
wrote:
 Hey Everyone,

 I'm wondering if the statement below are redundant? Once you define
 the resources for a particular controller, that should be it right?
 I'm assuming all I need is the second statement below.

 map.resources :customers
 map.resources :customers, :has_many = :accounts

 Thanks!

 Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: How do I fix this? Power went down.

2009-04-06 Thread Freddy Andersen

Does this line produce a product?

Product Load (1.0ms)   SELECT * FROM products WHERE
(products.id = 1)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: routes.rb noob question...

2009-04-06 Thread Freddy Andersen

Should look more like this:

map.resources :customers,
   :member = { :info_for_account_form = :post },
   :has_Many = :accounts
map.resources :owners,
   :member = { :info_for_account_form = :post },
   :has_many = :accounts
map.resources :usertypes,
   :has_many = :accounts
map.resources :accounts,
   :belongs_to = [ :owner, :customer ],
   :collection =
{ :auto_complete_belongs_to_for_account_customer_name = :post,
:auto_complete_belongs_to_for_account_owner_name
= :post }

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Ordering of messages in error_messages_for

2009-03-26 Thread Freddy Andersen

You can do this:

%= f.text_field :email, :label = Email Address, :required = true
%
em%= error_message_on @user, :email %/em

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: advanced search for a model (including keywords)

2009-03-25 Thread Freddy Andersen

I personally had many issues trying to use Ferret and would recommend
Sphinx with thinking sphinx plugin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Starling problem

2009-03-25 Thread Freddy Andersen


You should try the later Starling-starling gem found here
http://github.com/starling/starling/tree/master

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Version fu problem

2009-03-25 Thread Freddy Andersen

Hi,

I have a class that uses version_fu (Page class) the issue is that if
I run a clean migration it fails on the version_fu declaration in the
Page class, Its looking for the page_versions column that has not been
created yet.

Anyone seen this before?

Looks like if I do

version_fu rescue nil

The error does not show and my migration runs all the way to the
end... isn't that just ugly?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Helper

2009-03-23 Thread Freddy Andersen

Or something like this:

  def flash_messages
messages = []
%w(notice warning error).each do |msg|
  messages  content_tag(:div, html_escape(flash
[msg.to_sym]), :id = flash-#{msg}) unless flash[msg.to_sym].blank?
end
messages
  end

%= flash_messages %


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Bounding width when we give users' TinyMCE or FCKEditor?

2009-03-23 Thread Freddy Andersen

What I have is something like this in my css:

.post-message {
word-break: break-all;
}

That does it for me...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Dynamically generated form + Saving multiple records at once

2009-03-21 Thread Freddy Andersen

I think you will be happy to watch this screencast

http://railscasts.com/episodes/75-complex-forms-part-3

Its a project that has_many tasks but it talks about exactly the
problem you have with build_segments 3.times...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Add parameter to url

2009-03-20 Thread Freddy Andersen

%= link_to Link, blog_path(:locale = de) %

or

%= link_to Link, :controller = blog, :action = show, :locale
= de %


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Problem with restful_authentication

2009-03-18 Thread Freddy Andersen

The best option would be to create a user_profile and have the user
has_one :profile, :class_name = 'user_profile'.

If you have to have it in the user class you have to add them here:

attr_accessible :login, :email, :password, :password_confirmation, 
:security_question, :extra_fields

Thats what I'm guessing but I guess it depends on the error...

Did you add the extra fields using migration?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Problem with restful_authentication

2009-03-18 Thread Freddy Andersen

What is the error that you get? Does it say you are not allowed to
mass assign this (country_id) variable?

Have a look in your user model where you have the attr_accessible you
are going to have to add :country_id there.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Starling Service

2009-03-13 Thread Freddy Andersen

#!/bin/sh
### BEGIN INIT INFO
# Provides:  starling
# Required-Start:$local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop:  S 0 1 6
# Short-Description: starling initscript
# Description:   starling
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions



DAEMON=starling
DAEMON_PATH=/usr/local/bin/
SCRIPT_NAME=/etc/init.d/starling
CONFIG_PATH=/var/www/site/current/config/production-starling.yml

start()
{
echo -n $Starting $DAEMON: 
daemon $DAEMON_PATH$DAEMON start -f $CONFIG_PATH

touch /var/lock/subsys/$DAEMON
echo
}

stop()
{
echo -n $Shutting down $DAEMON: 
killproc $DAEMON

rm -f /var/lock/subsys/$DAEMON
echo
}
# Exit if the package is not installed
[ -x $DAEMON_PATH$DAEMON ] || exit 0

case $1 in
  start)
start
;;
  stop)
stop
;;
  restart)
stop
start
;;
  *)
echo Usage: $SCRIPT_NAME {start|stop|restart} 2
exit 3
;;
esac

:

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: ruby capitalizing singular version of route

2009-03-13 Thread Freddy Andersen

What version of Rails/Ruby are you on?

Loading development environment (Rails 2.2.2)
 addresses.singularize
= address
 routes.singularize
= route

It works for me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Is Mongrel dead?

2009-03-12 Thread Freddy Andersen

Have a look at thin

http://code.macournoyer.com/thin/

It is easier to install and it uses the Mongrel engine as the core. I
think this is where people that used to use Mongrel moved too.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: a beginner, i also encounter an issue about route.

2009-03-11 Thread Freddy Andersen

Is it installed?

gem install sqlite3-ruby


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: InvalidAuthenticityToken from home page

2009-03-11 Thread Freddy Andersen

Is it a form? Is the index.html in rails root or the webservers root?
If its rails you can still use the form helpers or pull in a
partial...

On Mar 11, 6:24 pm, Paul Reitz rails-mailing-l...@andreas-s.net
wrote:
 I'm trying to create a log in in index.html, but I keep getting an error
 about InvalidAuthenticityToken. I understand this is something that RoR
 puts in the forms, and it changes regularly. The problem is that the
 home page in the public folder is html, and therefore static. has anyone
 else put a log in on their home page?
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: High Priority Problem , when uploading image

2009-03-10 Thread Freddy Andersen

Could we get a look at the picture model? looks like it has issues at
line 6
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Multiple image upload

2009-02-23 Thread Freddy Andersen

And if you put both together you get this tutorial:

http://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/

I have used this with just one image per. model and multiple images
for a model (has_many) Works and looks great
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: TinyMCE Editor

2009-02-19 Thread Freddy Andersen

Hi,

Look at the github page, it has all the information you need to get
started...

http://github.com/kete/tiny_mce/tree/master
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Execute cap deploy:migrations fails

2009-02-14 Thread Freddy Andersen

Looking at the print from capistrano:

fatal: 'home/USER_NAME/DOMAIN_NAME/git/APPLICATION_NAME.git':
unable ???

That just does not look right.

From the host where you have capistrano are you able to run git clone
and the git url ?

Here is a git example url

set :repository, g...@github.com:username/projectname.git



On Feb 14, 5:51 pm, olivierntk olivier...@gmail.com wrote:
 Hi there, I am trying to deploy a rails app on dreamhost.

 Here is the error message that I get:

 fatal: 'home/USER_NAME/DOMAIN_NAME/git/APPLICATION_NAME.git': unable
 to chdir or not a git archive
 fatal: The remote end hung up unexpectedly
 /Users/USER/.gem/ruby/1.8/gems/capistrano-2.5.3/lib/capistrano/recipes/
 deploy/scm/git.rb:224:in `query_revision': Unable to resolve revision
 for 'master' on repository

 I am using Capistrano v2.5.3, Rails 2.2 and Git v1.6

 I ran deploy:setup and deploy:check successfully. I get the following
 message when I run deploy:check command You appear to have all
 necessary dependencies installed.

 Here is my deploy script

 default_run_options[:pty] = true

 # be sure to change these
 set :user, 'USER_NAME'
 set :domain, 'DOMAIN_NAME'
 set :application, 'APP_NAME'

 # the rest should be good
 set :repository,  #{us...@#{domain}:home/#{user}/#{domain}/git/#
 {application}.git
 set :deploy_to, /home/#{user}/#{domain}
 set :deploy_via, :remote_cache
 set :scm, 'git'
 set :branch, 'master'
 set :git_shallow_clone, 1
 set :scm_verbose, true
 set :use_sudo, false

 server domain, :app, :web
 role :db, domain, :primary = true

 namespace :deploy do
   task :restart do
     run touch #{current_path}/tmp/restart.txt
   end
 end

 I am guessing my path to my git repository is incorrect but I checked
 many ... many times and this is my path on my host.

 Any help would be greatly appreciated, thank you

 Olivier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: I get “Missing these required gems”, but gems are installed

2009-02-14 Thread Freddy Andersen

Gems might be installed in more than one area.

Look in ~/.gems and make sure that you use sudo when installing gems.

Do you now have multiple ruby directories on your mac? if so you most
likely have multiple gems directories too...

what I found was best when I upgraded from 1.8.6 to 1.8.7 was to
remove all gems directories and start empty. I can't remember what the
issue was but it was a path issue or something like that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Easy RoR - Javascript syntax question

2009-02-12 Thread Freddy Andersen

%= @cities %

On Feb 12, 9:13 am, Tom Ha rails-mailing-l...@andreas-s.net wrote:
 Hi there,

 a simple n00b question:

 I have that Javascript snippet on my page (see below; taken from jquery,
 actually).

 I want to pass it the @cities array from the controller. But what's
 the correct syntax, here?

 See the 3rd line:

 

 script
   $(document).ready(function(){
     var data = @cities;        that's not correct, is it?
     $(#city).autocomplete(data);
   });
 /script

 

 Thanks a lot for helping me!

 Tom
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: setting up remote rails

2009-02-11 Thread Freddy Andersen

- Does the server have firewall?

What does your database.yml look like?

---
production:
  username: mysql_user
  adapter: mysql
  port: 3306
  host: 127.0.0.1
  password: mysql_password
  database: my_database

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Anyone familiar with Bort? How is it supposed to be used?

2009-02-10 Thread Freddy Andersen

You are right Bort is not a noob app, but its very easy to setup.



* Download and unzip Bort
* Edit the database.yml and the settings.yml files
* Changed the default password in the bort migration
* Edit the REST_AUTH_SITE_KEY in each of the environment files
* Rake db:migrate
* Have a brew and celebrate

That's from the Bort site. Is there something in particular that is
breaking? I have used Bort and other apps like it many times as the
base for my applications just to get a jump start on the basic
functions...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Mongrel problem

2009-02-10 Thread Freddy Andersen

First... First I would recommend that you use thin and not mongrel..

Second.. Whats your ruby version? ruby -v

Third... are you able to start one mongrel like so mongrel_rails start
-d ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: development Windows or Linux?

2009-02-09 Thread Freddy Andersen

You need to stay with the os that you are comfortable with and DO NOT
insert another huge learning point when you are trying to learn RoR.
This is for your development platform. RoR is very easy to learn but
you do need to take baby-steps, and using Aptana is a great start.
There are many good rails developers using windows btw.

That said I feel that Windows should not be used as a production
server for the RoR environment.

Personally I use a mac with Text-mate and love it. However I did not
switch to my mac just because someone feels its the better platform to
develop with.

Would you change your car if your professional race-car driver friend
said that a ferrari is the way to go?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Help with routes and params

2009-02-09 Thread Freddy Andersen

I think you have to have a look at Rails basics. A basic forum would
be something like:

forums has_many categories
categories has_many topics
topics has_many replies

then you have has_many routes like /forums/1/categories/1/topic and in
your routes.rb you would do

map.resources :forums do |forum|
  forum.resources :categories do |cat|
cat.resources :topics
  end
end

You could add :has_many = :topics but if you need members and/or
collections later its better this way.


On Feb 9, 1:26 pm, John Yerhot joyer...@gmail.com wrote:
 Hi John,

 I highly suggest you take a peek as the associations that Rails
 provides.  A good place to start is the Rails 
 Guides.http://guides.rubyonrails.org/association_basics.html
 and also the guide on routes (particularly the part on nested
 resources)http://guides.rubyonrails.org/routing_outside_in.html
 These will make life much easier for you if you follow them.

 Sorry for not really answering your question... :)

 Again, I would go this route though.  :)
 On Feb 9, 12:46 pm, John Smith rails-mailing-l...@andreas-s.net
 wrote:

  I need some help with routes and params. I am developming some forums
  for a web. I want to be able to create new replies once a post has been
  created. So I create a post and then I have to put a link named Reply.
  What I want to do is Reply.create, and pass post_id as a param to this
  Reply.create action. How can I make this link? How can I get this param
  in replies controller?
  I  think I can create a whole new action, but I would like to use
  Reply.create.
  --
  Posted viahttp://www.ruby-forum.com/.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: habtm problem

2009-02-02 Thread Freddy Andersen

I think we need to see one your kid/sport model and then the new/
create method in the controller...

You should not have a id column btw in the kids_sports table.. .

This should be your up task:

  def self.up
create_table :kids_sports, :id = false do |t|
  t.integer :kid_id
  t.integer :sport_id
end
add_index :kids_sports, [:kid_id]
add_index :kids_sports, [:sport_id]
  end

On Feb 2, 12:58 pm, Little Known rails-mailing-l...@andreas-s.net
wrote:
 I have Kids and I have Sports.

 I have a checkbox list of Sports for each Kid.

 Let's say I make a Kid, and assign him to all 5 sports.

 It works, great.

 Let's say I make another Kid(Kid2), and assign him to all 5 sports. I
 get this error:

 Mysql::Error: Duplicate entry '2' for key 1: INSERT INTO kids_sports
 (`sport_id`, `kid_id`, `id`) VALUES (2, 10, 2)

 And my kids_sports table looks like this:

                        id    kid_id  sport_id
     Edit     Delete  2    8    2
   Edit   Delete   3   8   3
   Edit   Delete   4   8   4
   Edit   Delete   6   8   6
   Edit   Delete   7   8   7

 Why the heck is it doing that? Why isn't id 1,2,3,4,5 etc like it
 should(?) be?
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Can I force a form to submit empty fields?

2009-01-31 Thread Freddy Andersen

It was funny because I was thinking checkbox is different when I wrote
my reply but left it out anyways...

You have to specify what the default is and that should get you 1 or 0
or yes or no...

check_box(product, published, {}, '1', '0')
or
check_box(puppy, gooddog, {}, yes, no)

Btw the check_box form helper will great a hidden field anyway...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Redirecting root to mongrel prefix

2009-01-28 Thread Freddy Andersen

I think you are missing a piece of the puzzle, Apache and
mod_proxy...

You would never run multiple app roots unless you had multiple apps
and or a php app on / and a rails app on /app1...

If you want multiple apps running on your dev env just start them with
-p 3001 -p 3002 ... ? much easier... but I guess that depends on what
you are trying to do ...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: logged_in?

2009-01-27 Thread Freddy Andersen

% if logged_in? %
h1I'm logged in/h1
% end %

This is in a view...

On Jan 27, 5:50 am, Ralph Herve rails-mailing-l...@andreas-s.net
wrote:
 how to use this method
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: 1 Page website :)

2009-01-09 Thread Freddy Andersen


Redirect? How about just apache?

index.html is a start...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Ruby Javascript

2009-01-09 Thread Freddy Andersen

Google API? You mean Google Maps API right? I'm not sure about ruby
but for rails there is a very good plugin 
http://github.com/andre/geokit-rails/tree/master
that has good documentation on the page... I used this for a store
locator and it's a very good tool...

I guess you could look at the plugin code and transfer that to a plain
ruby script if you wanted too...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Making display options sort

2009-01-08 Thread Freddy Andersen

How about making the th a remote link and have a action that pulls
the @tour_requests sorted from the parameter and then update the
partial div. ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Fwd: change javascript default from jquery back to prototype

2009-01-07 Thread Freddy Andersen

Remove the vendor/plugin/jrails directory and remove the jquery
scripts in public/javascripts/

That should be all you need todo...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Checking for Functional Site

2009-01-05 Thread Freddy Andersen

Sounds like you need a new hosting location!! Your statement about
Rails is a new and that makes it ok to F with your customers? I would
demand my money back if thats how they do business..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Gems between two different machines

2009-01-02 Thread Freddy Andersen

Are you using Rails 2 ? Then you should add the gems into you
application ..

rake gems # List the gems that this
rails application depends on
rake gems:build   # Build any native
extensions for unpacked gems
rake gems:install # Installs all required gems
for this application.
rake gems:refresh_specs   # Regenerate gem
specifications in correct format.
rake gems:unpack  # Unpacks the specified gem
into vendor/gems.
rake gems:unpack:dependencies # Unpacks the specified gems
and its dependencies into vendor/gems
rake rails:freeze:gems# Lock this application to
the current gems (by unpacking them into vendor/rails)
rake rails:unfreeze   # Unlock this application
from freeze of gems or edge and return to a fluid use of system gems


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Displaying ruby content in rhtml

2009-01-02 Thread Freddy Andersen

Just an example of both usages

% if is_admin? do %
  h1%= admin_title %/h1
% end %


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Wrong number of arguments?

2008-12-30 Thread Freddy Andersen

  def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
  current_item.increment_quantity
else
  @items  CartItem.new(product)
end
  end

Try changing this to

  def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
  current_item.increment_quantity
else
  item = CartItem.create(product)
  @items  item
end
  end
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Wrong number of arguments?

2008-12-30 Thread Freddy Andersen

a Sorry I see now I was thinking that the CartItem class was an
activerecord class ... The issue is this:

Here you call a new object of CartItem with a product passed
@items  CartItem.new(product)

But here in the initialize you do not have a argument for
initialize...

class CartItem
  attr_reader :product, :quantity
  def initialize
@product = product
@quantity = 1
  end

Change it to this

class CartItem
  attr_reader :product, :quantity
  def initialize( product )
@product = product
@quantity = 1
  end
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Arguments Error

2008-12-30 Thread Freddy Andersen

Looks like you have two open posts for the same issue... Here is the
answer from the other post...

a Sorry I see now I was thinking that the CartItem class was an
activerecord class ... The issue is this:
Here you call a new object of CartItem with a product passed
@items  CartItem.new(product)
But here in the initialize you do not have a argument for
initialize...
class CartItem
  attr_reader :product, :quantity
  def initialize
@product = product
@quantity = 1
  end
Change it to this
class CartItem
  attr_reader :product, :quantity
  def initialize( product )
@product = product
@quantity = 1
  end

I would NEVER store the cartitem(add product to cart) in a session
object for a ecommerce application. Yes there are things that could/
should be stored in the session but not something like adding a
product to your cart... Unless you have a session replication system
for your back-end which then would store the session in either the
database or memcache anywho...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Arguments Error

2008-12-30 Thread Freddy Andersen

Where does the cart_item come from? is that in the Store controller?
post the store controller... The view has the @cart object but also
needs the cart_item.. Is that from the session?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: ApplicationController: understanding generate scaffold

2008-12-29 Thread Freddy Andersen

The respond_to block is optional, and if the block is missing rails
will execute a render :task so for the edit task it will look for the /
controller/edit.html.erb file

Here is information from the api...
http://apidock.com/rails/ActionController/MimeResponds/InstanceMethods/respond_to



On Dec 29, 9:13 am, Sarah Allen rails-mailing-l...@andreas-s.net
wrote:
 I'm new to Rails and I'm trying to understand the code created by
 generate scaffold.  I'm using Rails 2.2.2.

 $ ./script/generate scaffold Task description:string

 generated the following code in app/controller/tasks_controller.rb

 class TasksController  ApplicationController
   # GET /tasks
   # GET /tasks.xml
   def index
     @tasks = Task.find(:all)

     respond_to do |format|
       format.html # index.html.erb
       format.xml  { render :xml = @tasks }
     end
   end

   # GET /tasks/1
   # GET /tasks/1.xml
   def show
     @task = Task.find(params[:id])

     respond_to do |format|
       format.html # show.html.erb
       format.xml  { render :xml = @task }
     end
   end

   # GET /tasks/new
   # GET /tasks/new.xml
   def new
     @task = Task.new

     respond_to do |format|
       format.html # new.html.erb
       format.xml  { render :xml = @task }
     end
   end

   # GET /tasks/1/edit
   def edit
     @task = Task.find(params[:id])
   end

 I noticed that the edit method is missing some code.  If I remove those
 same lines from each of the methods above.  The code still works, why?

 I couldn't find ApplicationController in the API docs 
 athttp://api.rubyonrails.org/... I figured the behavior must be defined
 in the super class, but I can't seem to find the code for it either.

 Can someone point me in the right direction to illuminate this mystery?

 Thanks in advance,
 Sarah

 http://www.ultrasaurus.com/code(where I'm keeping a journal of my
 learning Rails so far)http://www.ultrasaurus.com(primary blog)
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] member on has_one or has_many

2008-12-29 Thread Freddy Andersen

Hi,

I was wondering if it is possible todo something like this in the
routes file:

  map.namespace(:admin) do |admin|
admin.resources :dashboard, :only = [ :index ],
  :has_one = :something, :member = [ :action = :get ],
  :has_many = [ :something_else ,:more_something ]
  end

The problem is the member in the has_one declaration, the member is
added to the dashboard and not the something controller. I tried
wrapping in [] and {} but no luck...

I got it working using :dashboard do BUT I would like to have the
nice :has_one :has_many...

Anyone?

PS I guess If I want to use :only and :except for the has_one this
also applies...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: mySQL setup - I'm losing it here.

2008-12-19 Thread Freddy Andersen

How did you install mysql?

If you used port then its mysql5 not mysql which is the command to
open the mysql client...

If you are trying to install mysql using anything other than
macports.. dont't... I recommend that you go to macports.org site and
download the latest version...



On Dec 19, 12:02 pm, Ryan Ororie rails-mailing-l...@andreas-s.net
wrote:
  Which simply means MySQL isn't in your PATH. You need to find
  where the MySQL executables are installed and add that directory
  to your path. Or create symlinks to, say, /usr/local/bin.

 First, how do I add it to my PATH? Second, I used this to install 
 mySQL:http://www.mamp.info/en/index.php

 Not sure if that was necessary/proper.

 The install folder for MAMP has this:
 /Applications/MAMP/tmp/mysql/

 Which holds two files mysql.pid and mysqp.sock - am I correct in
 assuming that those are the executables I need to set my path too?

 Symlinks?

 Thanks for the help thus far!
 --
 Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: error when installing rails on new linode instance

2008-12-16 Thread Freddy Andersen

which rails
find / -name rails

Is it installed in /usr/local/ ?

do you have /usr/local/bin/ in your path?

echo $PATH

Is rails installed?

gem list

Did you install the gems under a user ? maybe you should have done

sudo gem install rails

Just like on a mac if you use gem install on a none privileged user it
will install the gems in .gem in the users home directory... And most
likely you do not have that directory in your path...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Error in Mysql Connection

2008-12-15 Thread Freddy Andersen

I'm guessing in you database.yml file you have this:
development:
  adapter: mysql

So you need todo this:

# gem install mysql or if mysql is in a none standard area you need to
point to mysql_config like this:
# gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/
mysql_config (or where ever you have mysql installed)

Show us output from the following:

gem list
inside of you application = rake gems



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: How to share components between apps

2008-12-11 Thread Freddy Andersen

http://rails-engines.org/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Scheduling E-mail Alerts

2008-12-08 Thread Freddy Andersen

Hi,
Watch these and I'm sure you will find a solution to your problem...


http://railscasts.com/episodes/129-custom-daemon
http://railscasts.com/episodes/128-starling-and-workling
http://railscasts.com/episodes/127-rake-in-background
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: map.connect or map.resources?

2008-12-08 Thread Freddy Andersen

I would vote for number one... just looks cleaner and its easier to
add changes down the road like :only = [:index,:ajax_update] or
something like that...

just my 1 cent..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] rake gems broken when using capistrano-ext in rails 2.2.x

2008-12-03 Thread Freddy Andersen

Just tested the rails bort setup and got an error when running rake
gems:

 - [F] capistrano-ext
rake aborted!
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.dependencies

If I change to rails 2.1.2 it works fine but any of the rails 2.2.x
versions gives the same nil...
The problem line is = config.gem capistrano-ext, :lib =
capistrano

Anyone else seen this?

Here is the full trace:

 - [F] capistrano-ext
rake aborted!
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.dependencies
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/
gem_dependency.rb:77:in `dependencies'
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`to_proc'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/
gem_dependency.rb:80:in `map'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/
gem_dependency.rb:80:in `dependencies'
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`to_proc'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/
gem_dependency.rb:80:in `map'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails/
gem_dependency.rb:80:in `dependencies'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/gems.rake:
15:in `print_gem_status'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/gems.rake:4
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/gems.rake:3:in
`each'
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/gems.rake:3
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:617:in
`execute'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:612:in
`execute'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
`invoke_with_call_chain'
/opt/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
`invoke_with_call_chain'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:564:in
`invoke'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in
`invoke_task'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`top_level'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in
`top_level'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in
`top_level'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/Users/freddy/.gem/ruby/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: rake gems broken when using capistrano-ext in rails 2.2.x

2008-12-03 Thread Freddy Andersen

Found it... There was a bug that was found and will be fixed in Rails
2.2.3... The patch at lighthouse is here:

http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1464


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Calling Rake from INSIDE the application

2008-12-01 Thread Freddy Andersen

def run_task
  result = %x(rake #{params[:rake_task]})
end

If you don't want to hold the thread you can install the crontab gem
and install a new crontab with a ts:in or use background-fu and push
the job to the background...




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: setup rails

2008-11-29 Thread Freddy Andersen

Whats the exact message you get? And is this on a linux/mac or windows
desktop?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Comparisons between mod_ruby and FastCGI

2008-11-28 Thread Freddy Andersen

Or my new favorite  JRuby with Glassfish...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Developing with Ruby 1.8.2

2008-11-25 Thread Freddy Andersen

I know that this is NOT what you want to hear but you will save your
self a bunch of time if you just upgrade to 1.8.6/7 and go with the
latest rails. If you are on a old linux platform that comes with 1.8.2
(I think an older debian did that) Just get the latest ruby source and
compile/make/make install ...

my 2 cents.. back to bobnations question why?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Namespacing conventions

2008-11-24 Thread Freddy Andersen

I guess you have the answer in your question... You don't need the
controller part so it would look like this:

map.resource  :account do |account|
   account.resources :properties
   account.resources :photos
end


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Apche + SSL Configuration Issue

2008-11-20 Thread Freddy Andersen

James is on to something but you could also remove mongrel from the
mix and just test a plain html or gif. How do you have it configured
between apache and mongrel? ProxyPass ? Do you have the ssl plugin
installed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: What is the preferred lightbox plugin?

2008-11-18 Thread Freddy Andersen

If you are willing to use JQuery then http://handlino.com/blog/2008/02/26/57/
is a good plugin. I'm on 2.1 and 2.2 for the projects where I'm using
this plugin.

I installed jrails and replaced prototype completely..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: connection refused

2008-11-13 Thread Freddy Andersen

Exactly what is it you are trying todo?

Is there a firewall?
Is the server running?
Can you see the port using netstat?
does wget/telnet or links work from the local server?
Windows/Linux?

apache/mongrel/webrick?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



  1   2   >