[Rails] Re: Versionning system

2009-01-08 Thread Bosko Ivanisevic

I rarely use GUI tools that come with git. Although gitk is really
excellent if you want to examine history, especially since feature to
use external diff viewer is added. MinGW version of Git works good on
Windows but if you need to use git-svn you'll have to work with Cygwin
because MinGW version still doesn't work well.

Nevertheless what really amazed me in Git are easy branching and
merging, git stash (put away your current, not commited work, make
changes and applying ongoing work back) and git bisect that is really
helpful in chasing bugs that occur at some point in time.

On Jan 8, 7:31 pm, pepe  wrote:
> Thank you to all of you.
>
> I have been reading up about different tools and I was leaning towards
> Git, among other things because of Github, as Robert mentioned. I
> don't know much about the tool yet and I know there are 2 sides to it,
> the shell screen and the GUI version. Is the same functionality
> available in both areas, which one should I go with?
>
> Thanks a lot again.
>
> Pepe
>
> On Jan 8, 10:42 am, Fernando Perez 
> wrote:
>
> > pepe wrote:
> > > Hi all.
>
> > > I want to apologize, I guess this is not the best place to post this
> > > but I'm interested to know what RoR developers think.
>
> > > What would be a good open source versionning system for somebody that
> > > has never used one?
>
> > > Thanks a lot.
>
> > > Pepe
>
> > We use Mercurial because back in time the support of Git on Windows was
> > bad. On Mac and GNU/Linux, Mercurial and Git are both excellent choices,
> > so you won't be wrong. Don't use SVN, it's out of the game for new
> > commers.
>
> > --
> > Video training with screencasts athttp://www.digiprof.fr
>
> > --
> > 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: To get more understanding of REST

2009-01-08 Thread Ryan Bigg

http://guides.rubyonrails.org has a routing guide which is pretty  
comprehensive.
-
Ryan Bigg
Freelancer
http://frozenplague.net







On 09/01/2009, at 5:31 PM, Sijo Kg wrote:

>
> Hi
> Could any body please explain the difference below
>
> map.resources :people
> map.resource :book  # or books
>
>Also I would like to know why to specify member like
> map.resources :templates,
>:member => {  :attach_file_js => :post,
>  :delete_file => :delete,
>  :update_pictures => :get,
>  },
>:collection => { :search => :post }
>
>  map.with_options :controller => 'search',
>  :path_prefix => 'search',
>  :name_prefix => 'search_' do |advanced_search|
>search.save_query  'save', :action => 'save'
>search.show_query  'show/:query_id', :action => 'show'
>  end
>
>   I did not understand any of this..Please suggest any links or
> books to get proper understanding of all these
>
> Thanks in advance
> Sijo
> -- 
> Posted via http://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] Using "eval" to display a summary

2009-01-08 Thread Ferdie Ferdie

Hi,

Anyone can helps to display a summary list instead of a details list.

Here is my code;

recgroup = eval(tablename.fieldname) if !tablename.fieldname.nil?

puts  recgroup[:textgroup] + recgroup[:countgroup].inject(0) {|sum,
room| sum + room.length}.to_s + '; ' + recgroup[:countgroup].length.to_s
if !recgroup.nil?


It was displays as a details;

textdata1 1 1
textdata2 1 2
textdata1 2 2


But I need to display as a summary;


textdata1 3 3
textdata2 1 2


Thanks!
-- 
Posted via http://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] To get more understanding of REST

2009-01-08 Thread Sijo Kg

Hi
 Could any body please explain the difference below

map.resources :people
map.resource :book  # or books

Also I would like to know why to specify member like
map.resources :templates,
:member => {  :attach_file_js => :post,
  :delete_file => :delete,
  :update_pictures => :get,
  },
:collection => { :search => :post }

  map.with_options :controller => 'search',
  :path_prefix => 'search',
  :name_prefix => 'search_' do |advanced_search|
search.save_query  'save', :action => 'save'
search.show_query  'show/:query_id', :action => 'show'
  end

   I did not understand any of this..Please suggest any links or
books to get proper understanding of all these

Thanks in advance
Sijo
-- 
Posted via http://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: How can I let plugin go through proxy

2009-01-08 Thread NAYAK
Hi,

you can use rubysspi gem for the same.
install this gem first by downloading it from the net
copy rspa.rb from the gem folder to your mswin32 folder(check readme of the
gem)
set ENV variables (PROXY_HOST)
run the plugin install command with
ruby -rspa script/install ...

Please let me know if you face any problems

Regards,
NAYAK

On Fri, Jan 9, 2009 at 8:59 AM, Zhao Yi wrote:

>
> I use script/plugin to install plugins. but how to configure the proxy
> hostname it uses?
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


-- 
- NAYAK

--~--~-~--~~~---~--~~
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] gem update problem

2009-01-08 Thread Konstantin

Hello!

I cannot force a new application to run, it cannot update gems to the
required version. Could you suggest a solution?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 7.10
Release:7.10
Codename:   gutsy
$ ruby -v
ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]
$ gem -v
1.2.0

$ sudo gem install rubygems-update
Successfully installed rubygems-update-1.3.1
1 gem installed
$ sudo gem update --system
Updating RubyGems
Nothing to update
$ script/console
Rails requires RubyGems >= 1.3.1 (you have 1.1.0). Please `gem update
--system` and try 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: Authenticating users on different sources

2009-01-08 Thread NAYAK
Hi,

Can you have two diferent login pages then, else you can do the same by
first authenticating with DB if it fails only then with AD

NAYAK

On Fri, Jan 9, 2009 at 6:55 AM, José Tiburcio Ribeiro Netto <
jtibune...@gmail.com> wrote:

> Hi NAYAK!
>
> Interesting, but I need both of them authenticating the same time.
>
> The AD for the staff and other people of the organization, and db for
> people outside of the organization.
>
> I will try something and if it works, I will post here.
>
> Thanks for your response!
>
>
>
> On Thu, Jan 8, 2009 at 6:46 AM, NAYAK  wrote:
>
>> Hi,
>>
>> I have implemented an application which can authenticate users against db
>> auth or Active Directory based on the configuration set by the admin. But
>> this works either one at a time, not both together.
>>
>> For this all the methods for auth, signup etc had checks for AD/ DB and
>> perform authentication appropriately.
>> Please let me know if you need any more help
>>
>> - NAYAK
>>
>> On Thu, Jan 8, 2009 at 11:03 AM, José Tiburcio Ribeiro Netto <
>> jtibune...@gmail.com> wrote:
>>
>>> Hi there folks!
>>>
>>> I need to authenticate users on different sources (for instance, local
>>> database and Active Directory), and make registration (on local db) possible
>>> for users who don't have an AD account..
>>>
>>> For the db authentication, I have chosen restful_authentication. This
>>> way, new users who are not part of the organization are able to register and
>>> use the application.
>>>
>>> But for the AD auth, I don't know how to implement it yet.
>>>
>>> I thought about creating some additional methods on sessions controller
>>> to take care of this AD authentication process if the user selects the
>>> option of using it's existing AD account on the login page.
>>>
>>> Have anyone experimented this scenario?
>>>
>>> If so, what tips do you have for me?
>>>
>>> Thanks in advance!
>>>
>>>
>>>
>>
>>
>>
>
> >
>


-- 
- NAYAK

--~--~-~--~~~---~--~~
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] Testing data from a file

2009-01-08 Thread Simon Macneall

Hi,

I have some functional tests that require XML input that gets set into the
RAW_POST_DATA. I would like to get the XML for each tests from files (to
save having lots of XML in my test.rb. Is there anything in the testing
framework to handle this, or should I just load the file manually?

Cheers
Simon

--~--~-~--~~~---~--~~
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] How to create a progress bar and status messages?

2009-01-08 Thread dare ruby

Dear all,

Iam working on video gallery and i have created a file uploading
page(add.rhtml), list page which lists all uploaded video files.

In uploading, i have used ffmpeg tool to convert all movie files into
flash files and also i have used ffmpeg tool to take thumbnails. Could
anyone please suggest about the methods to create a progess bar for this
functionality.

As my form is not an ajaxified form, i need to know how to create a
progress bar and displaying the satus of progreess like,

 1) Uploading in Progress
 2) File uploaded sucessfully, conversion of movie file to flash file in
progress
 3) Conversion of files done successfully, thumbnail generation in
progress
 4) sucess.

So along with a progress bar it should display the above texts, in each
process. Please suggest me a way to do?

my add.rhtml



<%= flash.now[:notice] %>

<% form_for(:videos, :html => {:multipart => true}) do |f| %>

Caption <%= f.text_field 'caption' %>

Image <%=file_field("image","blob")%>

Description <%= f.text_area :description, :size => "25x3"%>



<%= f.select :category_id,
  Category.find( :all ).collect {|c| [ c.category_name, c.id ] }
%>

<%= submit_tag "uploadfile", :url => {:action => 'add'}, :class =>
'submit' %>

<%end %>


My controller(videos_controller)

def add
#

if request.post? and params[:videos] and params[:image][:blob]
@video = Video.new(params[:videos])
video = params[:image][:blob]
if video == ''
   flash[:notice] = "Please browse a video file"
else
   video_name=params[:image][:blob].original_filename
   video_size = params[:image][:blob].size/1024
   @video.video_size = video_size
   videoname = video_name.split('.')[0]
   videoname_type = video_name.split('.')[1]
   if videoname_type == 'flv' or videoname_type == 'swf'
  @video.video = video_name
  if @video.save
 File.open(RAILS_ROOT + "/public/videos/" + video_name ,
"wb") do |f|
 f.write(video.read)
 system "ffmpeg  -itsoffset -4  -i
public/videos/#{video_name} -vcodec mjpeg -vframes 1 -an -f rawvideo -s
160x120 public/images/thumbs/#{videoname}.jpg"
 end
  end
  if File.exists? RAILS_ROOT + "/public/videos/" + video_name
and
File.exists? RAILS_ROOT +
"/public/images/thumbs/#{videoname}.jpg"
redirect_to :action => 'list'
  end
else
   videoname = video_name.split('.')[0]
   @video.video = videoname+".flv"
   if @video.save
  File.open(RAILS_ROOT + "/public/videos/" + video_name ,
"wb") do |f|
  f.write(video.read)
  flash[:notice] = "conversion of movie file to flash file
in progress"
  if system "ffmpeg -i public/videos/#{video_name} -ar 44100
public/videos/#{videoname}.flv"
  system "ffmpeg  -itsoffset -4  -i
public/videos/#{videoname}.flv -vcodec mjpeg -vframes 1 -an -f rawvideo
-s 160x120 public/images/thumbs/#{videoname}.jpg"

else

  flash[:notice] = "Video format is not supported"

end
  end
  if File.exists? RAILS_ROOT + "/public/videos/" + video_name
and
File.exists? RAILS_ROOT +
"/public/images/thumbs/#{videoname}.jpg"
if File.delete("public/videos/#{video_name}")
redirect_to :action => 'list'

  end
  else
 redirect_to :action => 'list'
  end
end
  end
   end
 end
end

Thanks in advance

Regards,
Martin
-- 
Posted via http://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] Is there any way to let the user edit the stylesheet file?

2009-01-08 Thread Bob Sanders

I'm curious how to let the user edit the public/stylesheets/site.css
file through views (e.g., http://localhost/admin/edit_stylesheet).

Do you know what steps I should take, or is there any documentation on
how to do this, or any resources I should look at?
-- 
Posted via http://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: routes.rb question

2009-01-08 Thread Bobnation

Try what was recommended and what does your controller look like?

On Jan 8, 10:29 pm, Joshua Abbott 
wrote:
> Richard,
>
> Why not just lose this line from your routes file:
>
> map.connect '/:controller/:action'
>
> Since map.resources came along, I always delete the default stuff that
> comes in the routes file. See if /phrases/new works the way it should
> after removing that line.
>
> -- Joshhttp://iammrjoshua.com
>
>
>
> Richard Schneeman wrote:
> > I'm trying to go to localhost/phrases/new
>
> > where 'phrases' is my controller and 'new' is my action which will
> > simply show my new.html.erb
>
> > In my routes i have:
> >   map.connect '/:controller/:action'
>
> > Yet every time i go to phrases/new, I get redirected to my show action
>
> >http://pastie.org/356249
>
> > I can get around this if i use:
> >   map.connect '/:controller/:action.'
>
> > But i find it distasteful to have that period at the end of my URL. Any
> > clue why everything gets redirected to :action => 'show'
>
> --
> 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] rails app with javasript

2009-01-08 Thread Santosh Turamari

i hav a problem... to fetch a correponding value of radio button.




  
  <%= radio_button :org_review, :Q1, 5%>
  <%= radio_button :org_review, :Q1, 4%>
  <%= radio_button :org_review, :Q1, 3%>
  <%= radio_button :org_review, :Q1, 2%>
  <%= radio_button :org_review, :Q1, 1%>


Like this I have from Q1 to Q20 later I want to get the
corresponding values of Q1 to Q20... to know if all are same then
display a message..

var Qarray1 = new
Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20");

var m = 0;
var n = Qarray1[m];
$temp = "org_review[Q" + n + "]";
$res1 = document.getElementById($temp)
 var flag = 0;

   for (var j = 1; j <= 20; j++)
   {
  $temp1 = "org_review[Q" + j + "]";
  $res2 = document.getElementById($temp1)

if ($res1 == $res2)
 {
   alert($temp);
flag = 1;
 }
 else
 {
flag = 0;
   }
  }
 if (flag == 1)
 {
 alert("Hey, please go throgh the questions... Its not
boring");
   return false;
 }
}

But I am not able to fetch the vales... pls help me out somebody.
-- 
Posted via http://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: RoR 2.2.2 and MySQL -- HELP

2009-01-08 Thread Lost Warrior

zero0x wrote:
> Hi, I had to install 32 bit MySQL in order to get Rails running on my
> Mac.

If u are a debian user then after typing the below command just press 
tab you will find the list of libraries as given below and select the 
library suited to ur machine.i have installed  libmysqlclient15-dev  for 
my ubuntu 8.04 64 bit


apt-get install libmysqlclient
libmysqlclient10-dev  libmysqlclient15  libmysqlclient-dev
libmysqlclient12-dev  libmysqlclient15-dev
libmysqlclient14-dev  libmysqlclient15off
-- 
Posted via http://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: Validating a legal subdomain

2009-01-08 Thread scottmotte

Thanks Jeff. =)

On Jan 8, 7:40 pm, Jeff  wrote:
> I eventually settled on a regex that permits only letters, numbers and
> hyphens. Close enough for my needs:
>
>   validates_format_of     :subdomain,
>                           :with => /^[a-zA-Z0-9\-]*?$/,
>                           :message => 'accepts only letters, numbers
> and hyphens'
>
> Hope that's helpful!
>
> Jeff
>
> On Jan 8, 5:10 pm, scottmotte  wrote:
>
> > I think what Jeff meant is how to validate the subdomain as a normal
> > combination of letters and integers without a bunch of strange keys.
> > He's not talking about authentication, he's talking about validation.
>
> > I'll post here if I get this going Jeff. I'm also working on a way. It
> > looks like it will have to be a regular expression.
>
> > On Dec 12 2008, 12:33 am, Peter De Berdt 
> > wrote:
>
> > > On 11 Dec 2008, at 17:06, jeffpatter...@gmail.com wrote:
>
> > > > I have a Rails app that uses subdomains as account keys. Users name
> > > > their own subdomains. How can I validate those subdomains as legal?
>
> > > Just like you would verify a user login. The subdomain then becomes  
> > > part of the login procedure. You store it in a table and you  
> > > "authenticate" the domain in a before_filter.
>
> > > Best regards
>
> > > Peter De Berdt
>
>
--~--~-~--~~~---~--~~
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 question

2009-01-08 Thread Joshua Abbott

Richard,

Why not just lose this line from your routes file:

map.connect '/:controller/:action'

Since map.resources came along, I always delete the default stuff that 
comes in the routes file. See if /phrases/new works the way it should 
after removing that line.

-- Josh
http://iammrjoshua.com


Richard Schneeman wrote:
> I'm trying to go to localhost/phrases/new
> 
> where 'phrases' is my controller and 'new' is my action which will
> simply show my new.html.erb
> 
> In my routes i have:
>   map.connect '/:controller/:action'
> 
> Yet every time i go to phrases/new, I get redirected to my show action
> 
> http://pastie.org/356249
> 
> I can get around this if i use:
>   map.connect '/:controller/:action.'
> 
> But i find it distasteful to have that period at the end of my URL. Any
> clue why everything gets redirected to :action => 'show'

-- 
Posted via http://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: Installing Ruby on Rails

2009-01-08 Thread Bobnation

I'll add http://articles.slicehost.com/ to the list as well.

On Jan 8, 8:26 pm, "jason white" 
wrote:
> Windows, Mac, Linux?
>
> some 
> resourceswww.learningrails.comwww.railscast.comwww.envycast.comwww.railsinside.com
>
> there are quite a few more, but i know those off the top.
>
> Jason
>
> On Thu, Jan 8, 2009 at 7:53 PM, Johny ben
> wrote:
>
>
>
> > crazy canuck wrote:
> > > I am completely new to all of this. I was told by a potential employer
> > > if I learned Ruby on Rails and PostgreSQL I would have a job in 6-9
> > > months. My dilemma is that I cant even seem to install it properly
> > > lol. Please can someone give me the prompts and whether I have to be
> > > SU or use sudo. thank you so very much.
>
> > try this..
> >http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-installation.htm
> > --
> > 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: Validating a legal subdomain

2009-01-08 Thread Bobnation

That is pretty much what I was going to recommend.

On Jan 8, 9:40 pm, Jeff  wrote:
> I eventually settled on a regex that permits only letters, numbers and
> hyphens. Close enough for my needs:
>
>   validates_format_of     :subdomain,
>                           :with => /^[a-zA-Z0-9\-]*?$/,
>                           :message => 'accepts only letters, numbers
> and hyphens'
>
> Hope that's helpful!
>
> Jeff
>
> On Jan 8, 5:10 pm, scottmotte  wrote:
>
> > I think what Jeff meant is how to validate the subdomain as a normal
> > combination of letters and integers without a bunch of strange keys.
> > He's not talking about authentication, he's talking about validation.
>
> > I'll post here if I get this going Jeff. I'm also working on a way. It
> > looks like it will have to be a regular expression.
>
> > On Dec 12 2008, 12:33 am, Peter De Berdt 
> > wrote:
>
> > > On 11 Dec 2008, at 17:06, jeffpatter...@gmail.com wrote:
>
> > > > I have a Rails app that uses subdomains as account keys. Users name
> > > > their own subdomains. How can I validate those subdomains as legal?
>
> > > Just like you would verify a user login. The subdomain then becomes  
> > > part of the login procedure. You store it in a table and you  
> > > "authenticate" the domain in a before_filter.
>
> > > Best regards
>
> > > Peter De Berdt
>
>
--~--~-~--~~~---~--~~
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] ActiveRecord handling of obj.dup vs obj.clone

2009-01-08 Thread Daudi Mogaka

AR seems to be handling model object dup and cloning differently from
Ruby documented behavior.  I've checked out both ways (as an AR model
and not) and the behavior is different.  I don't see anything in the
RAILS documentation about this.  Am I missing something? is this a bug?
a feature? an interesting lifestyle?
I can easily hack around this difference/bug/feature but it should be
unnecessary.
---
example 1 using AR:

class Model < ActiveRecord::Base
# etc, normal model stuff, associations
  def initialize_copy(old_obj)
# do something
  end
end

obj = Model.find(1)
obj_dup = obj.dup   # does NOT yield a new object;
# does invoke obj_dup.initialize_copy(obj)
# at this point obj_dup is same object as obj;
# any changes to obj_dup will change obj
# but obj_dup changes have not been saved to DB yet

obj_clone = obj.clone  # does yield a new object;
   # does NOT invoke obj_clone.initialize_copy(obj)
# at this point obj_clone is a different object but not yet saved to DB
# which is ok and expected; NOT invoking initialize_copy is NOT ok

example 2 using pure Ruby:

class Test
   attr_reader  :name
   def initialize(str)
 @name = str
   end
   def initialize_copy(old)
  @name += ' *** COPY ***'
   end
end

a = Test.new 'john'   # a.name is now: 'john'
b = a.dup# b.name is now: 'john *** COPY ***'
c = a.clone  # c.name is now: 'john *** COPY ***'

# a, b, c are all DIFFERENT objects
# b.initialize_copy(a) was invoked per Ruby documentation #
c.initialize_copy(a) was invoked per Ruby documentation
-- 
Posted via http://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: could not find [gem] locally or in a repository

2009-01-08 Thread Ss Kk

MaD wrote:
> you're obviously on windows. have you installed nmake? did you add it
> to your path-variable? it seems like it is not found on your machine.

Thanks for the reply.

Any hints how to do that?
-- 
Posted via http://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: Validating a legal subdomain

2009-01-08 Thread Jeff

I eventually settled on a regex that permits only letters, numbers and
hyphens. Close enough for my needs:

  validates_format_of :subdomain,
  :with => /^[a-zA-Z0-9\-]*?$/,
  :message => 'accepts only letters, numbers
and hyphens'

Hope that's helpful!

Jeff



On Jan 8, 5:10 pm, scottmotte  wrote:
> I think what Jeff meant is how to validate the subdomain as a normal
> combination of letters and integers without a bunch of strange keys.
> He's not talking about authentication, he's talking about validation.
>
> I'll post here if I get this going Jeff. I'm also working on a way. It
> looks like it will have to be a regular expression.
>
> On Dec 12 2008, 12:33 am, Peter De Berdt 
> wrote:
>
> > On 11 Dec 2008, at 17:06, jeffpatter...@gmail.com wrote:
>
> > > I have a Rails app that uses subdomains as account keys. Users name
> > > their own subdomains. How can I validate those subdomains as legal?
>
> > Just like you would verify a user login. The subdomain then becomes  
> > part of the login procedure. You store it in a table and you  
> > "authenticate" the domain in a before_filter.
>
> > Best regards
>
> > Peter De Berdt
--~--~-~--~~~---~--~~
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] How can I let plugin go through proxy

2009-01-08 Thread Zhao Yi

I use script/plugin to install plugins. but how to configure the proxy
hostname it uses?
-- 
Posted via http://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: Installing Ruby on Rails

2009-01-08 Thread jason white
Windows, Mac, Linux?

some resources
www.learningrails.com
www.railscast.com
www.envycast.com
www.railsinside.com

there are quite a few more, but i know those off the top.

Jason

On Thu, Jan 8, 2009 at 7:53 PM, Johny ben
wrote:

>
> crazy canuck wrote:
> > I am completely new to all of this. I was told by a potential employer
> > if I learned Ruby on Rails and PostgreSQL I would have a job in 6-9
> > months. My dilemma is that I cant even seem to install it properly
> > lol. Please can someone give me the prompts and whether I have to be
> > SU or use sudo. thank you so very much.
>
> try this..
> http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-installation.htm
> --
> Posted via http://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: What is wrong with validates_presence_of :my_association ?

2009-01-08 Thread Mark Reginald James

Ben Johnson wrote:
> Category.has_many :products
> 
> Let's say a product must belong to a category. I know it is recommended
> to do the following:
> 
> class Product
> validates_presence_of :category_id
> end
> 
> But, as we all know, this is a pain for new records, meaning what if the
> associated category is a new record?
> 
> I've been meaning to ask this, but what's wrong with doing the
> following:
> 
> class Product
> validates_presence_of :category
> end
> 
> I never understood why that was so wrong. So I wanted to ask and see if
> I am missing something. What do you think? Thanks for your help!

It isn't wrong, it's the right way to do it. You just have to
assign a category object when building a new Product.

-- 
Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.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: Installing Ruby on Rails

2009-01-08 Thread Johny ben

crazy canuck wrote:
> I am completely new to all of this. I was told by a potential employer
> if I learned Ruby on Rails and PostgreSQL I would have a job in 6-9
> months. My dilemma is that I cant even seem to install it properly
> lol. Please can someone give me the prompts and whether I have to be
> SU or use sudo. thank you so very much.

try this..
http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-installation.htm
-- 
Posted via http://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: What is wrong with validates_presence_of :my_association ?

2009-01-08 Thread Xie Hanjian
* Ben Johnson  [2009-01-09 01:13:53 +0100]:

> 
> Category.has_many :products
> 
> Let's say a product must belong to a category. I know it is recommended
> to do the following:
> 
> class Product
> validates_presence_of :category_id
> end
> 
> But, as we all know, this is a pain for new records, meaning what if the
> associated category is a new record?
> 
> I've been meaning to ask this, but what's wrong with doing the
> following:
> 
> class Product
> validates_presence_of :category
> end

In this case you may need validates_associated or write your own
validation by def validate.

> 
> I never understood why that was so wrong. So I wanted to ask and see if
> I am missing something. What do you think? Thanks for your help!
> -- 
> Posted via http://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
> -~--~~~~--~~--~--~---

-- 
jan=callcc{|jan|jan};jan.call(jan)


pgp5SttkymKpl.pgp
Description: PGP signature


[Rails] Re: Installing Ruby on Rails

2009-01-08 Thread Ryan Bigg
http://guides.rubyonrails.org/getting_started_with_rails.html
-
Ryan Bigg
Freelancer
http://frozenplague.net







On 09/01/2009, at 10:49 AM, crazy canuck wrote:

>
> I am completely new to all of this. I was told by a potential employer
> if I learned Ruby on Rails and PostgreSQL I would have a job in 6-9
> months. My dilemma is that I cant even seem to install it properly
> lol. Please can someone give me the prompts and whether I have to be
> SU or use sudo. thank you so very much.
>
> >


--~--~-~--~~~---~--~~
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] Installing Ruby on Rails

2009-01-08 Thread crazy canuck

I am completely new to all of this. I was told by a potential employer
if I learned Ruby on Rails and PostgreSQL I would have a job in 6-9
months. My dilemma is that I cant even seem to install it properly
lol. Please can someone give me the prompts and whether I have to be
SU or use sudo. thank you so very much.

--~--~-~--~~~---~--~~
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: Issue with scaffolding with rail 2.2 and mySQL

2009-01-08 Thread Redden96

I think that's crap. The scaffold should create the table if it does
not exist but if the table already exists then inspect the table and
generate the appropriate stuff. What a pain in the ass.

On Dec 13 2008, 7:22 am, Frederick Cheung 
wrote:
> On Dec 13, 11:11 am, "Stephen Morrison" 
> wrote:
>
>
>
> > Hi guys,
> > I'm having problems when creating basic web applications using rails
> > 2.2 and mySQL databases.
> > If I create the following table in a database named moviecritc_development:
>
> > CREATE TABLE movies (
> >     id INT NOT NULL AUTO_INCREMENT PRIMARY_KEY,
> >     name VARCHAR(30) NOT NULL );
>
> > and then run the following ruby commands:
>
> > rails -d mysql moviecritic (creates all the necessary files without any 
> > issue.)
>
> > I then modify the config/database.yml to include the root password to
> > my database and run then ruby the following ruby command:
>
> > ruby script/generate scaffold Movie (creates usual files without error).
>
> > If i now view the db/migrate.create_movies.rb i see the following:
> > class CreateMovies < ActiveRecord::Migration
> >   def self.up
> >     create_table :movies do |t|
>
> >       t.timestamps
> >     end
> >   end
>
> >   def self.down
> >     drop_table :movies
> >   end
> > end
>
> > It doesn't make a reference to the name column i created! This is
>
> You've got things back to front. the migration generator does not look
> at an existing table. It's expecting that it will be creating a new
> table.
> The scaffolding stuff used to introspect the database but that died a
> while back
>
> These days what you should do is
> - create your rails app
> - create the database
>
> ruby script/generate scaffold Movie name:string
> This will create the migration, views and controller. The migration
> will create a table with a name column called string and the views
> will show that field.
> then run
> rake db:migrate
>
> to run the migration (ie actually create the table).
>
> Fred
>
> > reflected when i navigate to localhost:3000/movies/new i only see a
> > Back link and a Create Button, i don't see a NAME FIELD INPUT.
>
> > Has anyone any ideas why this is happening?
> > Thanks in advance,
> > Stephen

--~--~-~--~~~---~--~~
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: Authenticating users on different sources

2009-01-08 Thread José Tiburcio Ribeiro Netto
Hi NAYAK!

Interesting, but I need both of them authenticating the same time.

The AD for the staff and other people of the organization, and db for people
outside of the organization.

I will try something and if it works, I will post here.

Thanks for your response!


On Thu, Jan 8, 2009 at 6:46 AM, NAYAK  wrote:

> Hi,
>
> I have implemented an application which can authenticate users against db
> auth or Active Directory based on the configuration set by the admin. But
> this works either one at a time, not both together.
>
> For this all the methods for auth, signup etc had checks for AD/ DB and
> perform authentication appropriately.
> Please let me know if you need any more help
>
> - NAYAK
>
> On Thu, Jan 8, 2009 at 11:03 AM, José Tiburcio Ribeiro Netto <
> jtibune...@gmail.com> wrote:
>
>> Hi there folks!
>>
>> I need to authenticate users on different sources (for instance, local
>> database and Active Directory), and make registration (on local db) possible
>> for users who don't have an AD account..
>>
>> For the db authentication, I have chosen restful_authentication. This way,
>> new users who are not part of the organization are able to register and use
>> the application.
>>
>> But for the AD auth, I don't know how to implement it yet.
>>
>> I thought about creating some additional methods on sessions controller to
>> take care of this AD authentication process if the user selects the option
>> of using it's existing AD account on the login page.
>>
>> Have anyone experimented this scenario?
>>
>> If so, what tips do you have for me?
>>
>> Thanks in advance!
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Testing ActiveResource models with HttpMock

2009-01-08 Thread Chad Woolley

On Thu, Nov 20, 2008 at 3:11 AM, Xavier  wrote:
> Any help about this will be greatly appreciated.  If I judge by the
> number of results returned by my various Google searches on that
> topic, it seems like there are not many people using ActiveResource
> testing... or only a bunch unlucky few have problems with it. ;)

I just wrote a blog post summarizing what I could find, and how we are
going to address the problem of testing (hit a real server with the AR
client):

http://pivotallabs.com/users/chad/blog/articles/656-automated-end-to-end-integration-testing-for-activeresource-apis

-- Chad

--~--~-~--~~~---~--~~
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: Validating a legal subdomain

2009-01-08 Thread scottmotte

I think what Jeff meant is how to validate the subdomain as a normal
combination of letters and integers without a bunch of strange keys.
He's not talking about authentication, he's talking about validation.

I'll post here if I get this going Jeff. I'm also working on a way. It
looks like it will have to be a regular expression.

On Dec 12 2008, 12:33 am, Peter De Berdt 
wrote:
> On 11 Dec 2008, at 17:06, jeffpatter...@gmail.com wrote:
>
> > I have a Rails app that uses subdomains as account keys. Users name
> > their own subdomains. How can I validate those subdomains as legal?
>
> Just like you would verify a user login. The subdomain then becomes  
> part of the login procedure. You store it in a table and you  
> "authenticate" the domain in a before_filter.
>
> Best regards
>
> Peter De Berdt
--~--~-~--~~~---~--~~
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] routes.rb question

2009-01-08 Thread Richard Schneeman

I'm trying to go to localhost/phrases/new

where 'phrases' is my controller and 'new' is my action which will
simply show my new.html.erb

In my routes i have:
  map.connect '/:controller/:action'

Yet every time i go to phrases/new, I get redirected to my show action

http://pastie.org/356249

I can get around this if i use:
  map.connect '/:controller/:action.'

But i find it distasteful to have that period at the end of my URL. Any
clue why everything gets redirected to :action => 'show'
-- 
Posted via http://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] Binary Data over JSON/XML?

2009-01-08 Thread Jörg Battermann

Hello there,

I am currently putting together a rails-based web application which
will only serve and receive data via json and xml. However, some
requirements contain the ability to upload binary data (images). Now
to my understanding JSON is not entirely meant for that... but how do
you in general tackle the problem of receiving binary files/data over
those two entrypoints to your application?


Cheers and thanks,
-Joerg
--~--~-~--~~~---~--~~
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: What is wrong with validates_presence_of :my_association ?

2009-01-08 Thread Ryan Bigg

That will check the value for a field called category, not an  
association.
-
Ryan Bigg
Freelancer
http://frozenplague.net







On 09/01/2009, at 10:43 AM, Ben Johnson wrote:

>
> Category.has_many :products
>
> Let's say a product must belong to a category. I know it is  
> recommended
> to do the following:
>
> class Product
> validates_presence_of :category_id
> end
>
> But, as we all know, this is a pain for new records, meaning what if  
> the
> associated category is a new record?
>
> I've been meaning to ask this, but what's wrong with doing the
> following:
>
> class Product
> validates_presence_of :category
> end
>
> I never understood why that was so wrong. So I wanted to ask and see  
> if
> I am missing something. What do you think? Thanks for your help!
> -- 
> Posted via http://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] What is wrong with validates_presence_of :my_association ?

2009-01-08 Thread Ben Johnson

Category.has_many :products

Let's say a product must belong to a category. I know it is recommended
to do the following:

class Product
validates_presence_of :category_id
end

But, as we all know, this is a pain for new records, meaning what if the
associated category is a new record?

I've been meaning to ask this, but what's wrong with doing the
following:

class Product
validates_presence_of :category
end

I never understood why that was so wrong. So I wanted to ask and see if
I am missing something. What do you think? Thanks for your help!
-- 
Posted via http://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: remote_form_for not passing form values

2009-01-08 Thread Allen Walker

I solved it: Don't put your form tag under a  tag. Argh.
-- 
Posted via http://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: NEWBIE: How come I don't see new database records?

2009-01-08 Thread Tom Nen

Ben, Thanks for the reply. Do you know how I can toggle to "production 
mode"? I see 3 databases in the database.yml file (development, test, 
production).

Thanks for your help.

Tom
-- 
Posted via http://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: NEWBIE: How come I don't see new database records?

2009-01-08 Thread Ben

Look in your config/database.yml file to see how your databases are
configured.

You should be in production mode on your server.  I'm guessing you are
looking at the wrong db.

On Jan 8, 3:26 pm, Tom Nen  wrote:
> I just inherited a Ruby on Rails web site. I don't know anything about
> this topic (I do VB.NET normally). I'm so confused that I'm about to
> either throw my laptop out the window or throw myself out the window
>
> I connected to MySQL Query Browser and added a record using an INSERT
> command. But then on the web site, I don't see the new record anywhere.
>
> And vice versa... I add a record into the web site's CMS program but
> then I don't see it anywhere in MySQL.
>
> I don't know anything about Ruby on Rails apps. Do I need to compile it
> before seeing changes? or run some sort of deployment utility?
>
> Any help would be very helpful...
>
> 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] NEWBIE: How come I don't see new database records?

2009-01-08 Thread Tom Nen

I just inherited a Ruby on Rails web site. I don't know anything about
this topic (I do VB.NET normally). I'm so confused that I'm about to
either throw my laptop out the window or throw myself out the window

I connected to MySQL Query Browser and added a record using an INSERT
command. But then on the web site, I don't see the new record anywhere.

And vice versa... I add a record into the web site's CMS program but
then I don't see it anywhere in MySQL.

I don't know anything about Ruby on Rails apps. Do I need to compile it
before seeing changes? or run some sort of deployment utility?

Any help would be very helpful...

Tom
-- 
Posted via http://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: polymprphic == confusion

2009-01-08 Thread scott


On Jan 8, 5:25 pm, scott  wrote:
> I couldn't find a complete example of a double polymorphic
> relationship so I will post what I have in case someone comes across
> this using Google. It seems to be working so far, but I don't know if
> I have everything setup correctly yet.

My last post was wrong. The only place we need to define the
relationships is in the join model, the other models can be blank. It
is even cleaner now!!!
One problem I still have is the "destins" (addresses ,phones ,emails,
etc.) can belong to many "origins". I need to make this work as a
has_one instead of a has_many.

git submodule add git://github.com/fauna/has_many_polymorphs.git
vendor/plugins/has_many_polymorphs
git submodule init
git submodule update

ruby script/generate model User name:string
ruby script/generate model Business name:string
ruby script/generate model Charity name:string

ruby script/generate model Address street:string street2:string
city:string state:string zip:string
ruby script/generate model EmailAddress address:string
ruby script/generate model Website address:string
ruby script/generate model PhoneNumber number:string

ruby script/generate model Linkage

class CreateLinkages < ActiveRecord::Migration
  def self.up
create_table :linkages do |t|
  t.references :origin, :polymorphic => true
  t.references :destin, :polymorphic => true
  t.timestamps
end
  end
  def self.down
drop_table :linkages
  end
end

Origins
--
class User < ActiveRecord::Base
end
class Business < ActiveRecord::Base
end
class Charity < ActiveRecord::Base
end

Double Polymorphic Join Model
--
class Linkage < ActiveRecord::Base
  # id:int
  # origin_id:int
  # origin_type:string
  # destin_id:int
  # destin_type:string

  belongs_to :origin, :polymorphic => true
  belongs_to :destin, :polymorphic => true

  acts_as_double_polymorphic_join(
:origins => [:users, :businesses, :charities],
:destins =>
[:addresses, :email_addresses, :phone_numbers, :websites]
  )
end

Destins
--
class Address < ActiveRecord::Base
end
class EmailAddress < ActiveRecord::Base
end
class PhoneNumber < ActiveRecord::Base
end

How It Works

ruby script/console
>> u=User.new
>> u.name="Scott"
>> u.save
>> w=Website.new
>> w.address="http://google.com";
>> w.save
>> u.destins << w
>> u.destins
=> [#http://google.com";, created_at:
"2009-01-08 21:55:12", updated_at: "2009-01-08 21:55:12">]
>> w.origins
=> [#]
>> u.websites
=> [#http://google.com";, created_at:
"2009-01-08 21:55:12", updated_at: "2009-01-08 21:55:12">]


--~--~-~--~~~---~--~~
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: Dumb problem using BackgroundRb

2009-01-08 Thread Federico Brubacher

huard.el...@gmail.com wrote:
> hi,
> 
> the invocation in your controller should go
> Middleman.worker(:my_worker).my_method(:arguments)
> see documentation: http://backgroundrb.rubyforge.org/
> 
> btw I'm not using backgroundrb anymore, i got fed up with unclear
> error messages and relative instability.  I'm now using workling-
> starling for any new projects.
> 
> Elise
> 
> On Jan 8, 3:22�pm, Federico Brubacher http://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: Installing and using restful_auth

2009-01-08 Thread Joshua Partogi

Yes. I typed restful_auth because everyone use that. No wonder I can
not find it on github. Thanks!

On Jan 9, 2:40 am, Fernando Perez 
wrote:
> Joshua Partogi wrote:
> > Dear all,
>
> > I've saw a plugin called restful_auth several times in rails
> > community, but I couldn't find any resources on how to use it. Does
> > anyone know how to install and use it? Help really appreciated.
>
> > Best regards,
>
> In google type: "restful_authentication github"
>
> --
> Video training with screencasts athttp://www.digiprof.fr
> --
> 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] remote_form_for not passing form values

2009-01-08 Thread Allen Walker

I have the following:

<% form_remote_for :role, :method => :put, :url => {:controller =>
"roles", :action => "update", :id => @role.id\
}  do |f| %>
  
<%= select("role", "default_view", Account::ROLES) %>
<%= submit_tag("Update"); %> 

  
  

  
<% end -%>


Controller code:
 def update
role = Role.find(params[:id])
role.update_attributes(params[:role])
render :update do |page|
  logger.info "update: " + debug(params)
 end


the "debug(params)" outputs:

update: --- !map:HashWithIndifferentAccess
_method: put
action: update
id: "6"
controller: roles



There is no "default_view" field from my drop down. Just the params
passed on the URL string. Not sure why this is happening.

Thanks for any help
-- 
Posted via http://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: Making display options sort

2009-01-08 Thread Jeffrey L. Taylor

Quoting Ryan Ororie :
> 
> I'm doing some editing on an existing rails app and this view;
> _tour_listing.html.erb looks like this:
[snip]
> My question is with the render :partial => etc... line. I need to find
> away to sort the data that is getting spit out by a specific field, how
> would I do that?
>

Sort it in the controller or model, wherever the find() is.  Often:

@upcoming_tour_requests = TourRequests.find(:all, :order => 'date')

Anything SQL accepts can go in the :order value, 'date DESC', 'id', etc.

Another point, blank? is for strings, empty? is standard Ruby for arrays.

HTH,
  Jeffrey

--~--~-~--~~~---~--~~
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: polymprphic == confusion

2009-01-08 Thread scott

I couldn't find a complete example of a double polymorphic
relationship so I will post what I have in case someone comes across
this using Google. It seems to be working so far, but I don't know if
I have everything setup correctly yet.

# install as a plugin or as a gem
git submodule add git://github.com/fauna/has_many_polymorphs.git
vendor/plugins/has_many_polymorphs
git submodule init
git submodule update

# setup the models
ruby script/generate model User name:string
ruby script/generate model Business name:string
ruby script/generate model Charity name:string

ruby script/generate model Address street:string street2:string
city:string state:string zip:string
ruby script/generate model EmailAddress address:string
ruby script/generate model Website address:string
ruby script/generate model PhoneNumber number:string

ruby script/generate model Linkage

# edit the linkage migration
class CreateLinkages < ActiveRecord::Migration
  def self.up
create_table :linkages do |t|
  t.references :origin, :polymorphic => true
  t.references :destin, :polymorphic => true
  t.timestamps
end
  end
  def self.down
drop_table :linkages
  end
end

# add the relationships to the models

Origins
--
class User < ActiveRecord::Base
  has_many_polymorphs :destins, :from =>
[:addresses, :email_addresses, :phone_numbers, :websites], :through
=> :linkages
end
class Business < ActiveRecord::Base
  has_many_polymorphs :destins, :from =>
[:addresses, :email_addresses, :phone_numbers, :websites], :through
=> :linkages
end
class Charity < ActiveRecord::Base
  has_many_polymorphs :destins, :from =>
[:addresses, :email_addresses, :phone_numbers, :websites], :through
=> :linkages
end

Double Polymorphic Join Model
--
class Linkage < ActiveRecord::Base
  # id:int
  # origin_id:int
  # origin_type:string
  # destin_id:int
  # destin_type:string

  belongs_to :origin, :polymorphic => true
  belongs_to :destin, :polymorphic => true

  acts_as_double_polymorphic_join(
:origins => [:users, :businesses, :charities],
:destins =>
[:addresses, :email_addresses, :phone_numbers, :websites]
  )
end

Destins
--
class Address < ActiveRecord::Base
  has_many_polymorphs :origins, :from =>
[:users, :businesses, :charities], :through => :linkages
end
class EmailAddress < ActiveRecord::Base
  has_many_polymorphs :origins, :from =>
[:users, :businesses, :charities], :through => :linkages
end
class PhoneNumber < ActiveRecord::Base
  has_many_polymorphs :origins, :from =>
[:users, :businesses, :charities], :through => :linkages
end

How It Works

rake db:migrate
ruby script/console
>> u=User.new
>> u.name="Scott"
>> u.save
>> w=Website.new
>> w.address="http://google.com";
>> w.save
>> u.destins << w
>> u.destins
=> [#http://google.com";, created_at:
"2009-01-08 21:55:12", updated_at: "2009-01-08 21:55:12">]
>> w.origins
=> [#]
>> u.websites
=> [#http://google.com";, created_at:
"2009-01-08 21:55:12", updated_at: "2009-01-08 21:55:12">]



On Jan 8, 2:27 pm, scott  wrote:
> I guess you are using the has_many_polymorphs 
> plugin.http://github.com/fauna/has_many_polymorphs/tree/master
>
> looks interesting. i'll give it a try.
>
> thanks,
> scott
>
> On Jan 8, 12:22 pm, Ar Chron  wrote:
>
> > google for acts_as_double_polymorphic_join
>
> > From my app,
>
> > Table name: linkages
>
> > id           :integer(11) not null, primary key
> > origin_id    :integer(11)
> > origin_type  :string(20)
> > destin_id    :integer(11)
> > destin_type  :string(20)
>
> > In linkage.rb:
>
> > belongs_to :origin, :polymorphic => true
> > belongs_to :destin, :polymorphic => true
>
> > acts_as_double_polymorphic_join(
> >   :origins => [list your models that can be origins],
> >   :destins => [list your models that can be destins]
> > )
>
> > Pretty sweet plugin.
> > --
> > 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: Making display options sort

2009-01-08 Thread Ar Chron

> My question is with the render :partial => etc... line. I need to find
> away to sort the data that is getting spit out by a specific field, how
> would I do that?

You'll want to do that when the data is marshalled, not in the view or 
parital code... look into the controller to see how your data is 
retrieved.

Then, the model whose is being displayed should be able to provide the 
data in the desired order...
-- 
Posted via http://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: Making display options sort

2009-01-08 Thread Freddy Andersen

How about making the  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] Making display options sort

2009-01-08 Thread Ryan Ororie

I'm doing some editing on an existing rails app and this view;
_tour_listing.html.erb looks like this:

<% if @upcoming_tour_requests.blank? %>
No upcoming tour requests.
<% else %>


  Group Name
  Contact Name
  Status
  Date
  Actions

<%= render :partial => "tour_listing", :collection =>
@upcoming_tour_requests %>

<% end %>
Other Active Tour Requests
Tour requests not scheduled to take place within the next two weeks,
but still having a status of initial, received, or confirmed:
<% if @tour_requests.blank? %>
No other active tour requests.
<% else %>


  Group Name
  Contact Name
  Status
  Date
  Actions

<%= render :partial => "tour_listing", :collection => @tour_requests %>

<% end %>

My question is with the render :partial => etc... line. I need to find
away to sort the data that is getting spit out by a specific field, how
would I do that?
-- 
Posted via http://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] Problem with migration number

2009-01-08 Thread Michael Satterwhite

I have recently had to reload my computer. I don't know if this if
relevant at all to this problem, but wanted to mention it.

I have an application that I'm needing to make some changes to. To
prepare for it, I'm doing a new migration. In the db/migrate directory,
the last migration was 019_... My new migration is 020_...

The problem that I'm having is that rake seems to want to rerun
migrations beginning with 001. This causes it to error off. I've looked
at schema_info and schema_migrations in the database. Both have their
version set to 19.

What would be causing this? It would be a snap to go into mysql and just
do the migration manually, but I'd rather stay in the rails framework.

Thanks in advance
---Michael
-- 
Posted via http://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: Versionning system

2009-01-08 Thread James Byrne

pepe wrote:
> Thank you to all of you.
> 
> I have been reading up about different tools and I was leaning towards
> Git, among other things because of Github, as Robert mentioned. I
> don't know much about the tool yet and I know there are 2 sides to it,
> the shell screen and the GUI version. Is the same functionality
> available in both areas, which one should I go with?
> 

Git syntax for everyday tasks is so simple it really does not warrant a 
GUI.  Looking at past branches and merges, well there a gui like gitk 
has real value.

Create a new repository:
$ git init

Add files to stage:
$ git add 

Commit staged files to repository:
$ git commit -m"commit message"

Copy a repository:
$ git clone [://] 

Update and merge from a remote repository:
$ git pull ://

Update local commits to remote:
$ git push

Check local against remote:
$ git fetch

Look at local changes against remote
$ git diff

Unwind a local commit and preserve subsequent work:
$ git reset --merge

Abandon all local changes and reset to remote:
$ git fetch; git status; git pull
#all steps required in that order to place index in known state

Ignore files and directories:
$ vi .gitignore

The rest of it, and there is a great deal of material in the rest of it, 
is rarely used.  The supported protocols are git://, ssh:// and 
http(s)://.
-- 
Posted via http://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: Problem with disable_with

2009-01-08 Thread Walter Lockhart

Hi Klaus,

thanks for your help. The following code now works:





Thanks again.

Regards

Walter

On Jan 8, 8:39 pm, Walter Lockhart  wrote:
> Hi Klaus,
>
> now I'm really confused.  When I remove the validation and use return
> true:
>
> 
> 
> 
>
> It posts, no problem.
>
> Any ideas?
>
> Regards
>
> Walter
>
> On Jan 8, 8:29 pm, Walter Lockhart  wrote:
>
> > Hi Klaus,
>
> > thanks for your response.  I tried this:
>
> > 
> > 
> > 
>
> > which I hope is what you were proposing in your response, but it still
> > doesn't Post.  It just hangs.
>
> > Regards
>
> > Walter
>
> > On Jan 8, 7:26 pm, Klaus Paiva  wrote:
>
> > > You can always return false and inside the else block, add this
> > > javascript that will submit the form:
> > > document.forms["myForm"].submit();
>
> > > On Jan 8, 3:19 pm, Walter Lockhart  wrote:
>
> > > > Hi Group,
>
> > > > I have a registration.html.erb page with the following JavaScript at
> > > > the top which I use to validate form fields:
>
> > > > 
> > > > 
> > > > 
>
> > > > further down the page I have the form:
>
> > > > <% form_tag({:action => 'sendregistration'}, {:name =>
> > > > "myForm", :onSubmit => "return validate()"}) do -%>
>
> > > > Project Name: * > > > td><%= text_field 'email', 'projectname', :size => 30 %>
> > > > Project Type: * > > > td><%= collection_select 'email', 'projecttype_id',
> > > > @projecttypes, :id, :name, { :include_blank => true } %>
> > > > Region: *<%=
> > > > collection_select 'email', 'region_id', @regions, :id, :name,
> > > > { :include_blank => true } %>
>
> > > > etc.
>
> > > > <%= submit_tag "Send", :class => "submit", :id =>
> > > > "mysubmit", :disable_with => "Please wait..." %>
>
> > > > <% end -%>
>
> > > > When I click 'Send' without the required fields the 'Send' button is
> > > > disabled and the text is replaced with 'Please wait...' which is as I
> > > > expected.  It also performs the 'validate' JavaScript function and
> > > > discovers that the required fields are not provided and displays a
> > > > popup window with the text 'You must fill in all of the required
> > > > fields!'
>
> > > > When I click 'Send' with the required fields the 'Send' button is
> > > > disabled and the text is replaced with 'Please wait...' which again is
> > > > as I expected.  However, the form does not Submit / Post, it just
> > > > hangs.
>
> > > > What am I doing wrong?  Would someone please help.
>
> > > > Thanks.
>
> > > > Regards
>
> > > > Walter
--~--~-~--~~~---~--~~
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 disable_with

2009-01-08 Thread Walter Lockhart

Hi Klaus,

now I'm really confused.  When I remove the validation and use return
true:





It posts, no problem.

Any ideas?

Regards

Walter

On Jan 8, 8:29 pm, Walter Lockhart  wrote:
> Hi Klaus,
>
> thanks for your response.  I tried this:
>
> 
> 
> 
>
> which I hope is what you were proposing in your response, but it still
> doesn't Post.  It just hangs.
>
> Regards
>
> Walter
>
> On Jan 8, 7:26 pm, Klaus Paiva  wrote:
>
> > You can always return false and inside the else block, add this
> > javascript that will submit the form:
> > document.forms["myForm"].submit();
>
> > On Jan 8, 3:19 pm, Walter Lockhart  wrote:
>
> > > Hi Group,
>
> > > I have a registration.html.erb page with the following JavaScript at
> > > the top which I use to validate form fields:
>
> > > 
> > > 
> > > 
>
> > > further down the page I have the form:
>
> > > <% form_tag({:action => 'sendregistration'}, {:name =>
> > > "myForm", :onSubmit => "return validate()"}) do -%>
>
> > > Project Name: * > > td><%= text_field 'email', 'projectname', :size => 30 %>
> > > Project Type: * > > td><%= collection_select 'email', 'projecttype_id',
> > > @projecttypes, :id, :name, { :include_blank => true } %>
> > > Region: *<%=
> > > collection_select 'email', 'region_id', @regions, :id, :name,
> > > { :include_blank => true } %>
>
> > > etc.
>
> > > <%= submit_tag "Send", :class => "submit", :id =>
> > > "mysubmit", :disable_with => "Please wait..." %>
>
> > > <% end -%>
>
> > > When I click 'Send' without the required fields the 'Send' button is
> > > disabled and the text is replaced with 'Please wait...' which is as I
> > > expected.  It also performs the 'validate' JavaScript function and
> > > discovers that the required fields are not provided and displays a
> > > popup window with the text 'You must fill in all of the required
> > > fields!'
>
> > > When I click 'Send' with the required fields the 'Send' button is
> > > disabled and the text is replaced with 'Please wait...' which again is
> > > as I expected.  However, the form does not Submit / Post, it just
> > > hangs.
>
> > > What am I doing wrong?  Would someone please help.
>
> > > Thanks.
>
> > > Regards
>
> > > Walter
--~--~-~--~~~---~--~~
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] Using dom_id to localize testing.

2009-01-08 Thread James Byrne

I am trying to test a rails app using webrat.  I have this sort of
construct:

  

  

  Short Name
...


  Legal Name

  

  

<% for entity in @entities %>
  
<%=h entity.entity_name.titlecase -%>
...

   <%= link_to 'Show Entity', entity -%>

   <%= link_to 'Edit Entity', edit_entity_path(entity) -%>

   <%= link_to 'Destroy Entity', entity,
:confirm => 'Are you sure?',
:method => :delete -%>
  

I am trying to test the destroy link using this webrat code:

  my_entity = Entity.find_by_entity_name(
"my entity number #{row.hll_words_to_i}")
  within("body > table > tbody > tr#" + dom_id(my_entity, :list) +
 " > td#" + dom_id(my_entity, :delete)) do
click_link "Destroy Entity"
  end

This fails with a nil exception error:

  You have a nil object when you didn't expect it!
  The error occurred while evaluating nil.to_html (NoMethodError)
  /usr/lib64/ruby/gems/1.8/gems/webrat-0.3.4/lib/webrat/core/scope.rb:176:in
`scoped_dom'
...


I have tried with other variants of the selector.  If I check for the
selector using have_selector("td#" + dom_id(my_entity, :delete)) then it
passes.  If I use the long form above it also passes.  I test for a
missing selector then have_selector fails as expected. Therefore, I am
reasonably certain that the selector is indeed being found on the page.

Any ideas as to what I am doing wrong?
-- 
Posted via http://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: Problem with disable_with

2009-01-08 Thread Walter Lockhart

Hi Klaus,

thanks for your response.  I tried this:





which I hope is what you were proposing in your response, but it still
doesn't Post.  It just hangs.

Regards

Walter

On Jan 8, 7:26 pm, Klaus Paiva  wrote:
> You can always return false and inside the else block, add this
> javascript that will submit the form:
> document.forms["myForm"].submit();
>
> On Jan 8, 3:19 pm, Walter Lockhart  wrote:
>
> > Hi Group,
>
> > I have a registration.html.erb page with the following JavaScript at
> > the top which I use to validate form fields:
>
> > 
> > 
> > 
>
> > further down the page I have the form:
>
> > <% form_tag({:action => 'sendregistration'}, {:name =>
> > "myForm", :onSubmit => "return validate()"}) do -%>
>
> > Project Name: * > td><%= text_field 'email', 'projectname', :size => 30 %>
> > Project Type: * > td><%= collection_select 'email', 'projecttype_id',
> > @projecttypes, :id, :name, { :include_blank => true } %>
> > Region: *<%=
> > collection_select 'email', 'region_id', @regions, :id, :name,
> > { :include_blank => true } %>
>
> > etc.
>
> > <%= submit_tag "Send", :class => "submit", :id =>
> > "mysubmit", :disable_with => "Please wait..." %>
>
> > <% end -%>
>
> > When I click 'Send' without the required fields the 'Send' button is
> > disabled and the text is replaced with 'Please wait...' which is as I
> > expected.  It also performs the 'validate' JavaScript function and
> > discovers that the required fields are not provided and displays a
> > popup window with the text 'You must fill in all of the required
> > fields!'
>
> > When I click 'Send' with the required fields the 'Send' button is
> > disabled and the text is replaced with 'Please wait...' which again is
> > as I expected.  However, the form does not Submit / Post, it just
> > hangs.
>
> > What am I doing wrong?  Would someone please help.
>
> > Thanks.
>
> > Regards
>
> > Walter
--~--~-~--~~~---~--~~
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: polymprphic == confusion

2009-01-08 Thread scott

I guess you are using the has_many_polymorphs plugin.
http://github.com/fauna/has_many_polymorphs/tree/master

looks interesting. i'll give it a try.

thanks,
scott

On Jan 8, 12:22 pm, Ar Chron  wrote:
> google for acts_as_double_polymorphic_join
>
> From my app,
>
> Table name: linkages
>
> id           :integer(11) not null, primary key
> origin_id    :integer(11)
> origin_type  :string(20)
> destin_id    :integer(11)
> destin_type  :string(20)
>
> In linkage.rb:
>
> belongs_to :origin, :polymorphic => true
> belongs_to :destin, :polymorphic => true
>
> acts_as_double_polymorphic_join(
>   :origins => [list your models that can be origins],
>   :destins => [list your models that can be destins]
> )
>
> Pretty sweet plugin.
> --
> 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: Problem with disable_with

2009-01-08 Thread Klaus Paiva

You can always return false and inside the else block, add this
javascript that will submit the form:
document.forms["myForm"].submit();

On Jan 8, 3:19 pm, Walter Lockhart  wrote:
> Hi Group,
>
> I have a registration.html.erb page with the following JavaScript at
> the top which I use to validate form fields:
>
> 
> 
> 
>
> further down the page I have the form:
>
> <% form_tag({:action => 'sendregistration'}, {:name =>
> "myForm", :onSubmit => "return validate()"}) do -%>
>
> Project Name: * td><%= text_field 'email', 'projectname', :size => 30 %>
> Project Type: * td><%= collection_select 'email', 'projecttype_id',
> @projecttypes, :id, :name, { :include_blank => true } %>
> Region: *<%=
> collection_select 'email', 'region_id', @regions, :id, :name,
> { :include_blank => true } %>
>
> etc.
>
> <%= submit_tag "Send", :class => "submit", :id =>
> "mysubmit", :disable_with => "Please wait..." %>
>
> <% end -%>
>
> When I click 'Send' without the required fields the 'Send' button is
> disabled and the text is replaced with 'Please wait...' which is as I
> expected.  It also performs the 'validate' JavaScript function and
> discovers that the required fields are not provided and displays a
> popup window with the text 'You must fill in all of the required
> fields!'
>
> When I click 'Send' with the required fields the 'Send' button is
> disabled and the text is replaced with 'Please wait...' which again is
> as I expected.  However, the form does not Submit / Post, it just
> hangs.
>
> What am I doing wrong?  Would someone please help.
>
> Thanks.
>
> Regards
>
> Walter
--~--~-~--~~~---~--~~
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: RoR 2.2.2 and MySQL -- HELP

2009-01-08 Thread zero0x

Hi, I had to install 32 bit MySQL in order to get Rails running on my
Mac.

On Jan 7, 5:16 pm, jabauer  wrote:
> On Monday I "upgraded" from Rails 1.2.6 to 2.2.2 (also upgrading to
> gem 1.3.1) but in the process have lost the ability to connect with my
> mysql database.  After finally reinstalling the MySQL gem with the
> following gerrymandered command I found on a website (http://
> involution.com/category/ruby-on-rails/):
>
> sudo env ARCHFLAGS="-arch ppc64″ gem install -V mysql -- -with-mysql-
> include=/usr/local/mysql/include/ -with-mysql-lib=/usr/local/mysql/lib
> -with-mysql-config=/usr/local/mysql/bin/mysql_config -with-mysql-dir=/
> usr/local/mysql
>
> It still doesn't work!  After attempting to access one of my views in
> Firefox (3.0.3) I got the following error message:
>
> !!! The bundled mysql.rb driver has been removed from Rails 2.2.
> Please install the mysql gem and try again: gem install mysql.
> /!\ FAILSAFE /!\  Wed Jan 07 10:57:23 -0500 2009
>   Status: 500 Internal Server Error
>   dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9):
> no suitable image found.  Did find:
>         /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle: mach-o, but
> wrong architecture - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/
> mysql.bundle
>     /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
>
> Simply running "gem install mysql" still doesn't work (hence the hyper
> specific command above).
>
> I'm running Mac OS X 10.5.6 on a MacBook with Intel Core 2 Duo.
>
> If anyone has any suggestions I'm all ears.  I've been locked out of
> my rails system for 2 days now and really need to get back to work.
>
> Many thanks.
>
> --Jean--
--~--~-~--~~~---~--~~
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: Problems with SQL Server 2008 and migrations using activerecord-odbc-adapter gem

2009-01-08 Thread Brian Hogan

It shouldn't be hard to remove that restriction from the code :) I
wonder what would happen? I don't have sql2k8 around but I'd love to
hack on it.

On Thu, Jan 8, 2009 at 10:41 AM, Ben  wrote:
>
> Once I figured out how to use it, it usefully tells you its only
> supported for SQL Server 2000 and 2005 databases.
>
> rake db:migrate
> rake aborted!
> Currently, only 2000 and 2005 are supported.
>
> So it looks like I'm on my own to try and fix activerecord-odbc-
> adapter joy!
>
> Unless any else knows of yet another adapter...?
>
> Thanks :)
> >
>

--~--~-~--~~~---~--~~
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 solve/debug "gem update" problem?

2009-01-08 Thread LRaiz

I am not sure what to look for in the output of "gem env" but here it
is
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.1
  - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
  - INSTALLATION DIRECTORY: C:/InstantRails2.0/ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: C:/InstantRails2.0/ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/InstantRails2.0/ruby/bin
  - RUBYGEMS PLATFORMS:
- ruby
- x86-mswin32-60
  - GEM PATHS:
 - C:/InstantRails2.0/ruby/lib/ruby/gems/1.8
 - C:/Documents and Settings/Leonid/.gem/ruby/1.8
  - GEM CONFIGURATION:
 - :update_sources => true
 - :verbose => true
 - :benchmark => false
 - :backtrace => false
 - :bulk_threshold => 1000
  - REMOTE SOURCES:
 - http://gems.rubyforge.org/

The only thing that appears a bit strange is the second line in GEM
PATHS because it points to my documents folder while I expected RoR
installation to be entirely self contained under C:/InstantRails2.0. I
have already tried deleting everything (is that the right way to
uninstall RoR?)  and unzipped everything again from
InstantRails-2.0.zip. Then I run "gem update --system" again and it
upgraded rubygems to 1.3.1. I also observed that this gem update
command added the second path to GEM PATHS (is it OK?). Now I am back
hitting the same wall; still can not update rails and at a loss.

Thanks for trying to help,
- LR


On Jan 8, 11:45 am, Martin Hawkins  wrote:
> I've had problems with upgrading gem in the past but they have
> involved gem itself and not running it once installed.
> Have a look athttp://rubyforge.org/forum/forum.php?forum_id=28071and
> try re-installing.
>
> Does 'gem env' give you anything out of the ordinary?
> Martin
>
> On Jan 8, 4:12 pm, LRaiz  wrote:
>
> > Here is the output of "gem list --local"
>
> > *** LOCAL GEMS ***
>
> > actionmailer (2.0.2)
> > actionpack (2.0.2)
> > activerecord (2.0.2)
> > activeresource (2.0.2)
> > activesupport (2.0.2)
> > capistrano (2.1.0)
> > cgi_multipart_eof_fix (2.5.0)
> > cmdparse (2.0.2)
> > fxri (0.3.6)
> > fxruby (1.6.12)
> > gem_plugin (0.2.3)
> > highline (1.4.0)
> > hpricot (0.6)
> > log4r (1.0.5)
> > mongrel (1.1.2)
> > mysql (2.7.3)
> > needle (1.3.0)
> > net-sftp (1.1.0)
> > net-ssh (1.1.2)
> > rails (2.0.2)
> > rake (0.8.3)
> > rubygems-update (1.3.1)
> > sources (0.0.1)
> > sqlite3-ruby (1.2.1)
> > win32-api (1.0.4)
> > win32-clipboard (0.4.3)
> > win32-dir (0.3.2)
> > win32-eventlog (0.4.6)
> > win32-file (0.5.4)
> > win32-file-stat (1.2.7)
> > win32-process (0.5.3)
> > win32-sapi (0.1.4)
> > win32-sound (0.4.1)
> > windows-api (0.2.0)
> > windows-pr (0.7.2)
>
> > On Jan 8, 11:08 am, Martin Hawkins  wrote:
>
> > > What does 'gem list --local' return?
> > > I presume you are doing this with administrative rights?
> > > Martin
>
> > > On Jan 8, 2:59 pm, LRaiz  wrote:
>
> > > > I used InstantRails 2.0 to install RoR on Win XP SP3. It brought rails
> > > > 2.0.2 and I am having problems updating to rails 2.2.2
>
> > > > After initial installation I run “gem update—system” w/o a problem.
> > > > However the subsequent “gem update rails” results in
>
> > > > ERROR: While executing gem … (Gem::InstallError) rails requires
> > > > activesupport (= 2.2.2, runtime)
>
> > > > Trying to manually update activesupport by “gem update activesupport”
> > > > results in
>
> > > > ERROR: While executing gem … (Gem::GemNotFoundException) could not
> > > > find gem activesupport locally or in a repository
>
> > > > Other variations (“gem install rails—version 2.2.2”, "gem install
> > > > activesupport", etc.) produce same errors.
>
> > > > A few more data points that may be helpful
> > > > “gem -v” returns 1.3.1.
> > > > "gem sources" outputs “http://gems.rubyforge.org/”and
> > > > "gem list—remote" output does include “activesupport (2.2.2)”
>
> > > > Any suggestions on how to resolve or at least debug the issue? I am a
> > > > relative novice and am lost.
--~--~-~--~~~---~--~~
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: Passing information to the controller from view

2009-01-08 Thread Brian Hogan

bphogan at gmail dot com

On Thu, Jan 8, 2009 at 8:47 AM, Ryan Mckenzie
 wrote:
>
> Brian Hogan wrote:
>> In your controller, you just need
>>
>>data = render_to_string({:action => 'create.html.erb',
>> :layout=>false})
>>
>> I'm doing a PDF (using HTMLDOC) that way. Works awesome.
>
> Hi Brian, that works a treat thanks.  I'm also trying to output some
> information to a pdf.  Have you got an email address I can contact you
> at?
>
> Thanks
> --
> Posted via http://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: hashed password, send reminder email...impossible?

2009-01-08 Thread mikhailov

sure, you can't send the forgotten password. So, more secure way is to
store hashed password instead uncrypted one.
I usually send a password's reset link via e-mail.
I just publish an article with using before_on_create callback,
because is more useful way, which declare principe: Skinny
controllers, fat models.

On 8 янв, 15:25, Frederick Cheung  wrote:
> On Jan 8, 8:18 am, Anatoly Mikhailov 
> s.net> wrote:
> > You can send an e-mail with password reset link.
> > I use follow code for send uncrypted password, after that system will
> > encrypt the 
> > passwordhttp://www.railsgeek.com/2009/1/6/generate-random-password-in-rails
>
> If you're asking whether you can retrieve the password to send it to
> forgetful users, the answer is no you can't.
>
> Fred
>
> > --
> > 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] Strange Session Issue

2009-01-08 Thread EddM

Hey Everyone,

This is tricky. I'm having a very strange issue with a particular app
which, we think, is related to sessions. I'm afraid it's very hard to
explain, so if you would like anything elaborated on then please let
me know.

A user registers at my site, and activate their account. They attempt
to log in, and the system rejects their password, even if it's
correct. But, if the user then clears their cache/cookies (we're not
entirely sure which, because we can't replicate the error ourselves),
and then attempts with the same password they are logged in without a
problem.

It's possible that this issue is isolated only to IE users, as we have
only received complaints from them - although we have tried ourselves
in multiple flavours of IE with no problem.

I understand this isn't very well explained, so if you would like to
see any particular code please ask.

I thank you all in advance,

Edd :)
--~--~-~--~~~---~--~~
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: Versionning system

2009-01-08 Thread Bobnation

I haven't used the GUI that much, but I might take a look in the
future.

Personally, I happen to like CLI tools overall for many things. Even
though Textmate is still one of my favorite editors, there is
something nice about opening up VIM and using that for quick edit
jobs.

My opinion: try both! ;)

On Jan 8, 12:31 pm, pepe  wrote:
> Thank you to all of you.
>
> I have been reading up about different tools and I was leaning towards
> Git, among other things because of Github, as Robert mentioned. I
> don't know much about the tool yet and I know there are 2 sides to it,
> the shell screen and the GUI version. Is the same functionality
> available in both areas, which one should I go with?
>
> Thanks a lot again.
>
> Pepe
>
> On Jan 8, 10:42 am, Fernando Perez 
> wrote:
>
> > pepe wrote:
> > > Hi all.
>
> > > I want to apologize, I guess this is not the best place to post this
> > > but I'm interested to know what RoR developers think.
>
> > > What would be a good open source versionning system for somebody that
> > > has never used one?
>
> > > Thanks a lot.
>
> > > Pepe
>
> > We use Mercurial because back in time the support of Git on Windows was
> > bad. On Mac and GNU/Linux, Mercurial and Git are both excellent choices,
> > so you won't be wrong. Don't use SVN, it's out of the game for new
> > commers.
>
> > --
> > Video training with screencasts athttp://www.digiprof.fr
>
> > --
> > 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: Trying to sort results of one-to-many relationship find

2009-01-08 Thread Corey Murphy

Harold wrote:
> orders = Order.find(:all, :conditions => '...', :include
> => :payee, :order => 'payees.last_name')


Awesome.  The ":include" option wasn't something I was aware you could 
use in a find for the model.  I knew this could be handled using a nice 
rails-like convention without having to code some convoluted sorting 
method.

That makes life much easier.  Thank you very much!
-- 
Posted via http://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: Dumb problem using BackgroundRb

2009-01-08 Thread hemant

On Thu, Jan 8, 2009 at 7:52 PM, Federico Brubacher
 wrote:
>
>  i'm trying to use BackgroundRb but when I doworker =
> MiddleMan(:tag_sending_worker) in my controller i get "undefined method
> `MiddleMan' for # , but when i do it from
> the console it works fine.
>
> Of course i tried restarting my mongrel and restarting the backgroundrb
> process but no luck , any ideas o this ? It iis a weird problem , I
> don't know why it does the lookup in my Controller class only :(
>

Okay. Looks like, you have config.plugins in your
RAILS_ROOT/environments/production.rb and hence backgroundrb isn't
getting loaded. If not that, are you using config.plugins in
environment.rb??

--~--~-~--~~~---~--~~
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: :after_update_element and text_field_with_auto_complete

2009-01-08 Thread Peter Jeppesen

Peter Jeppesen wrote:
> Am I totally misunderstanding something here or...
> Please help! - I'm really stuck on this!

OK finally I got it sorted out.
After a minor bugfix in my javascript, params[:selected_company_name] 
did the trick.

Amazing and smooth... - I just love Rails!

Peter
-- 
Posted via http://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: Versionning system

2009-01-08 Thread pepe

Thank you to all of you.

I have been reading up about different tools and I was leaning towards
Git, among other things because of Github, as Robert mentioned. I
don't know much about the tool yet and I know there are 2 sides to it,
the shell screen and the GUI version. Is the same functionality
available in both areas, which one should I go with?

Thanks a lot again.

Pepe

On Jan 8, 10:42 am, Fernando Perez 
wrote:
> pepe wrote:
> > Hi all.
>
> > I want to apologize, I guess this is not the best place to post this
> > but I'm interested to know what RoR developers think.
>
> > What would be a good open source versionning system for somebody that
> > has never used one?
>
> > Thanks a lot.
>
> > Pepe
>
> We use Mercurial because back in time the support of Git on Windows was
> bad. On Mac and GNU/Linux, Mercurial and Git are both excellent choices,
> so you won't be wrong. Don't use SVN, it's out of the game for new
> commers.
>
> --
> Video training with screencasts athttp://www.digiprof.fr
>
> --
> 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: There is already an object named 'schema_migrations' in the database

2009-01-08 Thread Hassan Schroeder

On Thu, Jan 8, 2009 at 9:07 AM, Martin Hawkins  wrote:

> The database is a legacy SQL Server db with over 100 tables already in
> existence.
> I've noticed that db/schema.rb contains no information re the table
> that was built, hence rake trying to re-create the schema_migrations
> table.

> The first migration created a searches table:

And that was created with no errors? I assume you've looked in the
SQL Server error log(s)?

>  and the second migration tried to rename one of the columns:

So what does schema_migrations contain at this point?

> Dropping the whole DB is really not an option.

Got it. But if I were you, I'd create a new temporary rails projects, just
using sqlite3,. and try running your migrations there as a test. If they
work there, then there's something peculiar to your original config.

Caveat: I know zero about MS SQL Server so...

-- 
Hassan Schroeder  hassan.schroe...@gmail.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] Problem with disable_with

2009-01-08 Thread Walter Lockhart

Hi Group,

I have a registration.html.erb page with the following JavaScript at
the top which I use to validate form fields:





further down the page I have the form:

<% form_tag({:action => 'sendregistration'}, {:name =>
"myForm", :onSubmit => "return validate()"}) do -%>

Project Name: *<%= text_field 'email', 'projectname', :size => 30 %>
Project Type: *<%= collection_select 'email', 'projecttype_id',
@projecttypes, :id, :name, { :include_blank => true } %>
Region: *<%=
collection_select 'email', 'region_id', @regions, :id, :name,
{ :include_blank => true } %>

etc.

<%= submit_tag "Send", :class => "submit", :id =>
"mysubmit", :disable_with => "Please wait..." %>

<% end -%>

When I click 'Send' without the required fields the 'Send' button is
disabled and the text is replaced with 'Please wait...' which is as I
expected.  It also performs the 'validate' JavaScript function and
discovers that the required fields are not provided and displays a
popup window with the text 'You must fill in all of the required
fields!'

When I click 'Send' with the required fields the 'Send' button is
disabled and the text is replaced with 'Please wait...' which again is
as I expected.  However, the form does not Submit / Post, it just
hangs.

What am I doing wrong?  Would someone please help.

Thanks.

Regards

Walter

--~--~-~--~~~---~--~~
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] SMF Forum + Rails - any experience?

2009-01-08 Thread Mohit Sindhwani

Hi, I'm trying to see if I can get Simple Machines Forum (SMF) coexist 
with a Radiant CMS site.  So far, I have only found this: 
http://railsforum.com/viewtopic.php?pid=49374 which gives some idea.  
Also, SMF exports out some data such as 'Recent Posts' that I should be 
able to parse and create some pages on that basis.

Now, my Radiant site needs login - not to manage the content, but to 
possibly post comments.  I was wondering if anyone has any experience in 
sharing user logins, etc. between SMF and Rails?

Any general experience with both?

Thanks,
Mohit.
1/9/2009 | 2:05 AM.


--~--~-~--~~~---~--~~
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: randomly dropping sessions

2009-01-08 Thread Tim

Thanks for the input Muknd.

On Jan 8, 1:50 am, Mukund  wrote:
> Personally,  I would add in the logic to clean up old sessions
> periodically or during login.    

Yeah, when I said that I cleared them out I actually setup a cron job
to do it regularly.

> Also, is there a reason you are not
> using  Rails 2.1.2 or even better 2.2.2?  Staying updated with Rails
> versions usually resolves any odd defect that you see.

I may soon but I suspect that's not really the issue here.  I
typically don't like to
upgrade just for the sake of upgrading.

Thanks again!
Tim

>
> Thanks,
> Mukund
>
> On Jan 7, 3:36 am, Tim  wrote:
>
> > Hey all,
>
> > Most of our customers get through our shopping cart no problem so
> > orders continue to flow.  However we've recently (past 10 days)
> > started receiving reports of people not being able to add items to
> > their cart.  This seems to be affecting 2-3% of our customers.  Taking
> > a look at the logs I can see the sessions getting completely lost just
> > as if the client had cookies disabled.  I see no other warnings or
> > errors.
>
> > We did have nearly 350k sessions accumulated in our sessions table
> > which I cleared out to around 40k last night.  We haven't got any
> > reports since then but I can't say yet if it's helped.  I'm sure their
> > have been other times when our sessions table got that large without
> > this problem.  We have >>very<< beefy hardware for our needs so I
> > would expect to be able to handle that number of sessions without
> > trouble.
>
> > The site has been up for going on 3 years with no significant issues
> > and has had no code changes other than some minor template/html tweaks
> > in a couple months.
>
> > ubuntu 8.10
> > rails 2.1.0 && active_record_store
> > mysql 5.0.51
>
> > Any thoughts greatly appreciated.  Thanks in advance!
> > Tim
--~--~-~--~~~---~--~~
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: partials and comments and other fun things!

2009-01-08 Thread Roger Muthton


> 
> It is better practice to have a CommentsController to operate on your
> comments instead
> of using the Messages controller.  I highly suggest that you then use
> this tutorial as your
> starting point to move forward:
> 
> http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial
> 
> Good luck.
> 
> Franz

Hi Franz,

Thanks, ive got a comments controller being used now, along with a 
partial link,

<% for message in @messages %>
<%= render :partial => @comment = Comment.new, :locals => { :button_name 
=> 'Post'}%>
<% end %>

this creates commments but without a message_id

so I need to somehow pass the message_id to the partial so that it goes 
into the database.

any ideas?
-- 
Posted via http://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: Trying to sort results of one-to-many relationship find

2009-01-08 Thread Harold

This is a plain association, no join table involved.

Try this in script/console and see if it solves your problem. The DB
can easily take care of the sorting:

orders = Order.find(:all, :conditions => '...', :include
=> :payee, :order => 'payees.last_name')

Then,

orders.each { |o| puts o.payee.last_name }

-H

On Jan 8, 11:10 am, Corey Murphy 
wrote:
> Assuming I have two models:
>
> Order "belongs_to :payee"
> Payee "has_many :orders"
>
> In the orders table, I store the payee_id.
>
> If I want to pull all orders and display the list alphabetically by the
> payees last name, what would be the best way to do it?
>
> Would I need to setup a true "join" table and then run my find on it?  I
> can't do this through the view using a sort plugin since that simply
> changes the finders SQL and doesn't include the association logic needed
> here.
>
> Since I'm accessing the payee's name through the association
> "order.payee.last_name" what is the best way to accomplish what I need
> or do I need to write some convoluted method that breaks down the
> recordset and orders it manually?
> --
> 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: Anyone Recommend a File Uploader

2009-01-08 Thread Dave Smith


> 
> And to be honest, this is not really good code either.
> 
> You are manually assigning related record ids instead of relying on
> Rails' built-in safeguards.
> 
> I'd advise u to start looking at railscasts.com, starting for very
> early ones (complex forms might be a good one for you), getting a
> Rails book (The Rails Way, Agile Web Development with Rails) and
> getting to know the framework better.
> 
> 
> Best regards
> 
> Peter De Berdt

Hi Peter,

Many thanks for your extensive help on this one. I now have

@project_file = ProjectFile.new(params[:project][:uploaded_data])

in my projects controller.


  <%= f.file_field :uploaded_data %>

but it still says

 ActiveRecord::UnknownAttributeError in ProjectsController#create

unknown attribute: uploaded_data
-- 
Posted via http://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: polymprphic == confusion

2009-01-08 Thread Ar Chron

google for acts_as_double_polymorphic_join

>From my app,

Table name: linkages

id   :integer(11) not null, primary key
origin_id:integer(11)
origin_type  :string(20)
destin_id:integer(11)
destin_type  :string(20)

In linkage.rb:

belongs_to :origin, :polymorphic => true
belongs_to :destin, :polymorphic => true

acts_as_double_polymorphic_join(
  :origins => [list your models that can be origins],
  :destins => [list your models that can be destins]
)

Pretty sweet plugin.
-- 
Posted via http://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: polymprphic == confusion

2009-01-08 Thread scott

It looks like that is an option that might work, but is there a way to
do this without using single table inheritance?

Is it possible to do something like this in rails?

Owners
--
class User < ActiveRecord::Base
  has_many :contact_items, :through => :contact_links
  has_many :addresses, :through? => :contact_links?, :as?
=> :contact_items?
  has_many :...
end
class Business < ActiveRecord::Base
  has_many :contact_items, :through => :contact_links
  has_many :...
end
class Charity < ActiveRecord::Base
  has_many :contact_items, :through => :contact_links
  has_many :...
end

Double Polymorphic Join Model???
--
class ContactLink < ActiveRecord::Base
  # id:int
  # owner_id:int
  # owner_type:string
  # contact_item_id:int
  # contact_item_type:string

  belongs_to :owners, :polymorphic => true
  belongs_to :contact_items, :polymorphic => true
end

Contact Items
--
class Address < ActiveRecord::Base
  has_one :owner, :through => :contact_links
end
class EmailAddress < ActiveRecord::Base
  has_one :owner, :through => :contact_links
end
class PhoneNumber < ActiveRecord::Base
  has_one :owner, :through => :contact_links
end



On Jan 8, 3:58 am, stonefield  wrote:
> Maybe the below will help. I also know that railsenvy has a good video
> on this.
>
> First of all, it is the tables and associations that are plural, not
> the classes.
> I suggest that you would use single table inheritance for the users
> business etc.
> You need to have a type column defined in the owners table to signify
> class for the record
>
> Here's my suggestion:
>
> class Owner < ActiveRecord::Base
>         has_many :addresses, :through => :contact_items
>         has_many :websites, :through => :contact_items
>         has_many :phone_numbers, :through => :contact_items
> end
> class User < Owner
> end
> class Business < Owner
> end
> class Charities < Owner
> end
>
> # migration
> create_table :owners do |t|
>         ...
>   t.string :type
> end
>
> Polymorphic Association could be is solved like this
>
> class ContactItem < ActiveRecord::Base
>         belongs_to :owners
>         belongs_to :contacts, :polymorphic => true
> end
>
> # migration
> create_table :contact_item do |t|
>         ...
>   t.string :contact_type
>   t.integer :contact_id
> end
>
> class Address < ActiveRecord::Base
>         has_one :owner, :thorugh => :contact_items
> end
>
> class EmailAddress < ActiveRecord::Base
>         has_one :owner, :thorugh => :contact_items
> end
> class PhoneNumber < ActiveRecord::Base
>         has_one :owner, :thorugh => :contact_items
> end
> class Website < ActiveRecord::Base
>         has_one :owner, :thorugh => :contact_items
> end
>
> You can use either belongs_to or has_one on the above classes
>
> On Jan 8, 7:36 am, scott  wrote:
>
> > I have been having trouble setting up some relations.
>
> > I want to be able to do this:
>
> > user.contact_items    # an array of addresses, websites, phone
> > numbers, etc.
> > user.addresses         # an array of addresses
> > user.websites           # an array of websites
> > user.phone_numbers # an array of phone numbers
> > etc.
>
> > and the same for businesses, charities, etc.
>
> > Since users, businesses, and charities all can have multiple contact
> > items I assume a polymorphic relation makes sense.
>
> > I also want to be able to do
> > address.owner           # a user, business, or charity
> > website.owner           # a user, business, or charity
> > phone_number.owner # a user, business, or charity
> > etc.
>
> > After much searching, reading and experimenting, my head is beginning
> > to hurt. Can someone get me pointed in the right direction? How do I
> > setup my models? Will it be possible to add fields to my join table so
> > I can flag contact items with things like verified, public, labels,
> > etc?
>
> > OWNERS
> > ---
> > class Users
> >   has_many ???
> >   belongs_to ???
>
> > class Businesses
> >   has_many ???
> >   belongs_to ???
>
> > class Charities
> >   has_many ???
> >   belongs_to ???
>
> > JOIN TABLE
> > ---
> > class ContactItems
> >   has_many ???
> >   belongs_to ???
> >   #public:boolean
> >   #verified:boolean
> >   #label:string
>
> > CONTACT ITEMS
> > ---
> > class Addresses
> >   has_many ???
> >   belongs_to ???
>
> > class EmailAddresses
> >   has_many ???
> >   belongs_to ???
>
> > class PhoneNumbers
> >   has_many ???
> >   belongs_to ???
>
> > class Websites
> >   has_many ???
> >   belongs_to ???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post 

[Rails] Re: There is already an object named 'schema_migrations' in the database

2009-01-08 Thread Martin Hawkins

Yes, I agree that the second migration seems to be trying to re-create
the schema table.

The database is a legacy SQL Server db with over 100 tables already in
existence.
I've noticed that db/schema.rb contains no information re the table
that was built, hence rake trying to re-create the schema_migrations
table.
The first migration created a searches table:
class CreateSearches < ActiveRecord::Migration
  def self.up
create_table :searches do |t|
  t.date :start
  t.date :end
  t.integer :team_id
  t.integer :match_id
  t.integer :innings_id
  t.integer :over_id
  t.integer :ball_id
  t.integer :match_session_id
  t.integer :bowler_id
  t.integer :delivery_type_id
  t.integer :extra_type_id
  t.integer :appeal_id
  t.integer :shot_type_id
  t.integer :runs_id
  t.integer :batter_id
  t.integer :umpire_id
  t.integer :validity_id
  t.integer :decison_id
  t.integer :height_id
  t.integer :extra_runs_id
  t.timestamps
end
  end

  def self.down
drop_table :searches
  end
end
 and the second migration tried to rename one of the columns:

class RenameTeamId < ActiveRecord::Migration
  def self.up
rename_column :searches, :team_id, :home_team_id
  end

  def self.down
rename_column :searches, :home_team_id, :team_id
  end
end

Dropping the whole DB is really not an option.
Martin

On Jan 8, 4:41 pm, "Hassan Schroeder" 
wrote:
> On Thu, Jan 8, 2009 at 8:36 AM, Martin Hawkins  
> wrote:
> > No, I didn't edit an existing migration - I created a new one for the
> > rename.
>
> It sounds like your second migration is trying to create the schema table
> which already exists.
>
> Maybe you could post your migrations, or at least the failing one?
>
> > I understand what you are saying about dropping the table (not the
> > entire db surely :-0).
>
> Yes, the whole DB -- if you're wanting to fix a bad migration and run
> it all from the beginning. That's not a bad thing early in a project.
>
> --
> Hassan Schroeder  hassan.schroe...@gmail.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: Problem with RubyGems installation

2009-01-08 Thread Ronn

Thank-you Thank-you Thank-you

Was having the same problem.  The installing ruby-rdoc solved the
problem.

On Jan 3, 11:24 am, Paschal Nee 
wrote:
> Bobnation wrote:
> > Excellent. I'm still trying to figure out what was missing, but there
> > must have been a dependency missing. I'm glad I could help.
>
> Just in case anybody else is having the same problem.
>
> I encountered the same problem and, based on the error message, just did
> a
>
> yum install ruby-rdoc
>
> That seems to have fixed it.
>
> I'm on CentOS 5.2, there is no rubyfull/ruby-full in the default repo
>
> --
> 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: monkey patches to a method that exists in a plugin

2009-01-08 Thread Frederick Cheung


On 8 Jan 2009, at 16:37, Tom M wrote:

>
> Say I have a plugin like so:
>
> class Plugin
>  def do_something
> do_thing :one
> do_something_else
> do_thing :two
>  end
> end
>
> If I want to wrap the call to do_something_else in a begin/rescue
> block, then it would seem that I need to either hack the plugin in
> vendor/ or put a patch in lib/ that copies a portion of do_something.
> Either way, it seems I lose on maintainability.
>
>
The mighty alias_method_chain (which is really just 2 calls to  
alias_method) can work here


class Plugin
   def do_something_else_with_rescue
 begin
   do_something_else_without_rescue
 rescue ...
 end
   end
   alias_method_chain :do_something_else, :rescue
end


> Is there a convention/method for monkey patching existing methods in
> plugins in these situations?
>
> Thanks,
> Tom Macklin
> >


--~--~-~--~~~---~--~~
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 message

2009-01-08 Thread Shandy Nantz

Rob Biedenharn wrote:
>  If you have 'defaults' instead of :defaults, then
> just change it to a symbol and it will do the right thing.

That was the issue, I had "defaults" instead of :defaults.

Thanks Rob,

-S
-- 
Posted via http://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: How do I solve/debug "gem update" problem?

2009-01-08 Thread Martin Hawkins

I've had problems with upgrading gem in the past but they have
involved gem itself and not running it once installed.
Have a look at http://rubyforge.org/forum/forum.php?forum_id=28071 and
try re-installing.

Does 'gem env' give you anything out of the ordinary?
Martin

On Jan 8, 4:12 pm, LRaiz  wrote:
> Here is the output of "gem list --local"
>
> *** LOCAL GEMS ***
>
> actionmailer (2.0.2)
> actionpack (2.0.2)
> activerecord (2.0.2)
> activeresource (2.0.2)
> activesupport (2.0.2)
> capistrano (2.1.0)
> cgi_multipart_eof_fix (2.5.0)
> cmdparse (2.0.2)
> fxri (0.3.6)
> fxruby (1.6.12)
> gem_plugin (0.2.3)
> highline (1.4.0)
> hpricot (0.6)
> log4r (1.0.5)
> mongrel (1.1.2)
> mysql (2.7.3)
> needle (1.3.0)
> net-sftp (1.1.0)
> net-ssh (1.1.2)
> rails (2.0.2)
> rake (0.8.3)
> rubygems-update (1.3.1)
> sources (0.0.1)
> sqlite3-ruby (1.2.1)
> win32-api (1.0.4)
> win32-clipboard (0.4.3)
> win32-dir (0.3.2)
> win32-eventlog (0.4.6)
> win32-file (0.5.4)
> win32-file-stat (1.2.7)
> win32-process (0.5.3)
> win32-sapi (0.1.4)
> win32-sound (0.4.1)
> windows-api (0.2.0)
> windows-pr (0.7.2)
>
> On Jan 8, 11:08 am, Martin Hawkins  wrote:
>
> > What does 'gem list --local' return?
> > I presume you are doing this with administrative rights?
> > Martin
>
> > On Jan 8, 2:59 pm, LRaiz  wrote:
>
> > > I used InstantRails 2.0 to install RoR on Win XP SP3. It brought rails
> > > 2.0.2 and I am having problems updating to rails 2.2.2
>
> > > After initial installation I run “gem update—system” w/o a problem.
> > > However the subsequent “gem update rails” results in
>
> > > ERROR: While executing gem … (Gem::InstallError) rails requires
> > > activesupport (= 2.2.2, runtime)
>
> > > Trying to manually update activesupport by “gem update activesupport”
> > > results in
>
> > > ERROR: While executing gem … (Gem::GemNotFoundException) could not
> > > find gem activesupport locally or in a repository
>
> > > Other variations (“gem install rails—version 2.2.2”, "gem install
> > > activesupport", etc.) produce same errors.
>
> > > A few more data points that may be helpful
> > > “gem -v” returns 1.3.1.
> > > "gem sources" outputs “http://gems.rubyforge.org/”and
> > > "gem list—remote" output does include “activesupport (2.2.2)”
>
> > > Any suggestions on how to resolve or at least debug the issue? I am a
> > > relative novice and am lost.
--~--~-~--~~~---~--~~
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: Slightly Off Topic: Rails/SVN/Capistrano...plus Git?

2009-01-08 Thread NAYAK
As you can see most of the projects (rails, plugins, etc) have moved from
SVN to GIT recently, so using GIT during start itself would be helpful to
you

NAYAK

On Thu, Jan 8, 2009 at 10:03 PM, Bobnation  wrote:

>
> For a sole developer setup where you don't have legacy repos hanging
> around, I would really recommend git. I have been using it exclusively
> for the past year and really like the Git + GitHub combination.
>
> On Jan 8, 10:10 am, Jeff Pritchard 
> wrote:
> > Mukund wrote:
> > > git-svn might be worth a look.   But to be honest, I find it a
> > > headache to keep things in sync between two version control systems
> > > when different people update each system.
> >
> > > On Jan 8, 3:09 am, Jeff Pritchard 
> >
> > I guess that was a critical piece of info I left out.  This is for
> > projects where I'm the sole developer.
> >
> > thanks,
> > jp
> > --
> > 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: Problems with SQL Server 2008 and migrations using activerecord-odbc-adapter gem

2009-01-08 Thread Ben

Once I figured out how to use it, it usefully tells you its only
supported for SQL Server 2000 and 2005 databases.

rake db:migrate
rake aborted!
Currently, only 2000 and 2005 are supported.

So it looks like I'm on my own to try and fix activerecord-odbc-
adapter joy!

Unless any else knows of yet another adapter...?

Thanks :)
--~--~-~--~~~---~--~~
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: There is already an object named 'schema_migrations' in the database

2009-01-08 Thread Hassan Schroeder

On Thu, Jan 8, 2009 at 8:36 AM, Martin Hawkins  wrote:

> No, I didn't edit an existing migration - I created a new one for the
> rename.

It sounds like your second migration is trying to create the schema table
which already exists.

Maybe you could post your migrations, or at least the failing one?

> I understand what you are saying about dropping the table (not the
> entire db surely :-0).

Yes, the whole DB -- if you're wanting to fix a bad migration and run
it all from the beginning. That's not a bad thing early in a project.

-- 
Hassan Schroeder  hassan.schroe...@gmail.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] monkey patches to a method that exists in a plugin

2009-01-08 Thread Tom M

Say I have a plugin like so:

class Plugin
  def do_something
 do_thing :one
 do_something_else
 do_thing :two
  end
end

If I want to wrap the call to do_something_else in a begin/rescue
block, then it would seem that I need to either hack the plugin in
vendor/ or put a patch in lib/ that copies a portion of do_something.
Either way, it seems I lose on maintainability.


Is there a convention/method for monkey patching existing methods in
plugins in these situations?

Thanks,
Tom Macklin
--~--~-~--~~~---~--~~
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: There is already an object named 'schema_migrations' in the database

2009-01-08 Thread Martin Hawkins

Hassan,
Thanks for the reply.
No, I didn't edit an existing migration - I created a new one for the
rename.

I understand what you are saying about dropping the table (not the
entire db surely :-0). While that would work, I wouldn't get to
understand what the problem is!!

Martin

On Jan 8, 4:18 pm, "Hassan Schroeder" 
wrote:
> On Thu, Jan 8, 2009 at 8:03 AM, Martin Hawkins  
> wrote:
>
> > I've created a table in a SQL Server database using a migration,
> > successfully.
> > I've tried to change the name of a column in the table and got the
> > error message above when running 'rake db:migrate'.
>
> It sounds like you edited an existing migration -- if so, don't :-)
>
> Create a new migration to change the column, or drop the entire DB
> and start from scratch.
>
> HTH,
> --
> Hassan Schroeder  hassan.schroe...@gmail.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: Which "acts_as_taggable" plugin is the best?

2009-01-08 Thread Bobnation

I just used acts_as_taggable_on and am very happy with it.

On Jan 8, 3:36 am, Difei Zhao 
wrote:
> Hi all,
>
>   I want to implement tagging for my resources, but I found lots
> "acts_as_taggable" available: "acts_as_tabble", "acts_as_taggable_on",
> "acts_as_taggable_on_steroid", etc. Some of them are not in active
> development, and I do not know which one is more popular. So, any
> suggestions? Thanks in advance!
>
> Difei.
> --
> 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: Slightly Off Topic: Rails/SVN/Capistrano...plus Git?

2009-01-08 Thread Bobnation

For a sole developer setup where you don't have legacy repos hanging
around, I would really recommend git. I have been using it exclusively
for the past year and really like the Git + GitHub combination.

On Jan 8, 10:10 am, Jeff Pritchard 
wrote:
> Mukund wrote:
> > git-svn might be worth a look.   But to be honest, I find it a
> > headache to keep things in sync between two version control systems
> > when different people update each system.
>
> > On Jan 8, 3:09 am, Jeff Pritchard 
>
> I guess that was a critical piece of info I left out.  This is for
> projects where I'm the sole developer.
>
> thanks,
> jp
> --
> 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: gems:unpack dosn't deploy hpricot

2009-01-08 Thread morgler

I have the exact same problem. It does not only appear with hpricot,
but with all gems containing "mswin32" in the version string. is there
an "official" fix for this?

Cheers,

Matthias

On 1 Jan., 22:03, Mikael Rudberg 
wrote:
> I found a workaround sort of. I changed the regexp in the
> vendor_gem_source_index.rb
>
> from
>     def version_for_dir(d)
>       matches = /-([^-]+)$/.match(d)
>       matches.to_a.each { | x | puts "Match {#{x}}" }
>       Gem::Version.new(matches[1]) if matches
>     end
>
> to
>     def version_for_dir(d)
>       matches = /-(\d+\.\d+\.\d+)/.match(d)
>       matches.to_a.each { | x | puts "Match {#{x}}" }
>       Gem::Version.new(matches[1]) if matches
>     end
>
> Seems to load the gems fine now. However having very limited skill in
> crafting regexp I don't know if this will work in all cases so if anyone
> have a better one i'm all ears :)
>
> --
> 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: There is already an object named 'schema_migrations' in the database

2009-01-08 Thread Hassan Schroeder

On Thu, Jan 8, 2009 at 8:03 AM, Martin Hawkins  wrote:
>
> I've created a table in a SQL Server database using a migration,
> successfully.
> I've tried to change the name of a column in the table and got the
> error message above when running 'rake db:migrate'.

It sounds like you edited an existing migration -- if so, don't :-)

Create a new migration to change the column, or drop the entire DB
and start from scratch.

HTH,
-- 
Hassan Schroeder  hassan.schroe...@gmail.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: How do I solve/debug "gem update" problem?

2009-01-08 Thread LRaiz

Here is the output of "gem list --local"

*** LOCAL GEMS ***

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
capistrano (2.1.0)
cgi_multipart_eof_fix (2.5.0)
cmdparse (2.0.2)
fxri (0.3.6)
fxruby (1.6.12)
gem_plugin (0.2.3)
highline (1.4.0)
hpricot (0.6)
log4r (1.0.5)
mongrel (1.1.2)
mysql (2.7.3)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.2)
rails (2.0.2)
rake (0.8.3)
rubygems-update (1.3.1)
sources (0.0.1)
sqlite3-ruby (1.2.1)
win32-api (1.0.4)
win32-clipboard (0.4.3)
win32-dir (0.3.2)
win32-eventlog (0.4.6)
win32-file (0.5.4)
win32-file-stat (1.2.7)
win32-process (0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.0)
windows-pr (0.7.2)

On Jan 8, 11:08 am, Martin Hawkins  wrote:
> What does 'gem list --local' return?
> I presume you are doing this with administrative rights?
> Martin
>
> On Jan 8, 2:59 pm, LRaiz  wrote:
>
> > I used InstantRails 2.0 to install RoR on Win XP SP3. It brought rails
> > 2.0.2 and I am having problems updating to rails 2.2.2
>
> > After initial installation I run “gem update—system” w/o a problem.
> > However the subsequent “gem update rails” results in
>
> > ERROR: While executing gem … (Gem::InstallError) rails requires
> > activesupport (= 2.2.2, runtime)
>
> > Trying to manually update activesupport by “gem update activesupport”
> > results in
>
> > ERROR: While executing gem … (Gem::GemNotFoundException) could not
> > find gem activesupport locally or in a repository
>
> > Other variations (“gem install rails—version 2.2.2”, "gem install
> > activesupport", etc.) produce same errors.
>
> > A few more data points that may be helpful
> > “gem -v” returns 1.3.1.
> > "gem sources" outputs “http://gems.rubyforge.org/”and
> > "gem list—remote" output does include “activesupport (2.2.2)”
>
> > Any suggestions on how to resolve or at least debug the issue? I am a
> > relative novice and am lost.
--~--~-~--~~~---~--~~
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: Slightly Off Topic: Rails/SVN/Capistrano...plus Git?

2009-01-08 Thread Jeff Pritchard

Mukund wrote:
> git-svn might be worth a look.   But to be honest, I find it a
> headache to keep things in sync between two version control systems
> when different people update each system.
> 
> On Jan 8, 3:09�am, Jeff Pritchard 

I guess that was a critical piece of info I left out.  This is for 
projects where I'm the sole developer.

thanks,
jp
-- 
Posted via http://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] Trying to sort results of one-to-many relationship find

2009-01-08 Thread Corey Murphy

Assuming I have two models:

Order "belongs_to :payee"
Payee "has_many :orders"

In the orders table, I store the payee_id.

If I want to pull all orders and display the list alphabetically by the
payees last name, what would be the best way to do it?

Would I need to setup a true "join" table and then run my find on it?  I
can't do this through the view using a sort plugin since that simply
changes the finders SQL and doesn't include the association logic needed
here.

Since I'm accessing the payee's name through the association
"order.payee.last_name" what is the best way to accomplish what I need
or do I need to write some convoluted method that breaks down the
recordset and orders it manually?
-- 
Posted via http://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: How do I solve/debug "gem update" problem?

2009-01-08 Thread Martin Hawkins

What does 'gem list --local' return?
I presume you are doing this with administrative rights?
Martin

On Jan 8, 2:59 pm, LRaiz  wrote:
> I used InstantRails 2.0 to install RoR on Win XP SP3. It brought rails
> 2.0.2 and I am having problems updating to rails 2.2.2
>
> After initial installation I run “gem update—system” w/o a problem.
> However the subsequent “gem update rails” results in
>
> ERROR: While executing gem … (Gem::InstallError) rails requires
> activesupport (= 2.2.2, runtime)
>
> Trying to manually update activesupport by “gem update activesupport”
> results in
>
> ERROR: While executing gem … (Gem::GemNotFoundException) could not
> find gem activesupport locally or in a repository
>
> Other variations (“gem install rails—version 2.2.2”, "gem install
> activesupport", etc.) produce same errors.
>
> A few more data points that may be helpful
> “gem -v” returns 1.3.1.
> "gem sources" outputs “http://gems.rubyforge.org/”and
> "gem list—remote" output does include “activesupport (2.2.2)”
>
> Any suggestions on how to resolve or at least debug the issue? I am a
> relative novice and am lost.
--~--~-~--~~~---~--~~
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] There is already an object named 'schema_migrations' in the database

2009-01-08 Thread Martin Hawkins

I've created a table in a SQL Server database using a migration,
successfully.
I've tried to change the name of a column in the table and got the
error message above when running 'rake db:migrate'.
Previously I have developed using MySQL and Sqlite and migrations have
worked successfully. This is an error I have not seen before.
Has anybody seen this and worked around it?

thnx
Martin
--~--~-~--~~~---~--~~
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: partials and comments and other fun things!

2009-01-08 Thread Franz Strebel

On Thu, Jan 8, 2009 at 4:16 PM, Roger Muthton
 wrote:
>  map.resources :articles do |articles|
>articles.resources :messages
>  end

and comments belong_to :messages right?  if so, add it in the routes

  map.resources :articles do |articles|
articles.resources :messages do |messages|
  messages.resources :comments
end
  end

It is better practice to have a CommentsController to operate on your
comments instead
of using the Messages controller.  I highly suggest that you then use
this tutorial as your
starting point to move forward:

http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial

Good luck.

Franz

--~--~-~--~~~---~--~~
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] Great Opportunity in NYC great Package

2009-01-08 Thread Smiley

Our client is a leading NYC-based publisher of web and mobile games,
and personalization applications.  They are seeking a Senior Server
Engineer with Ruby on Rails experience.  The Senior Server Engineer
works with the company's server engineering team.

The ideal candidate will have a passion for creating reliable and
elegant software quickly, using agile methodologies, and be
comfortable pushing and expanding the Rails framework. You should have
also have strong knowledge of Meta-Programming in Ruby on Rails.

Please let me know if you would like to learn more about this
opportunity or if you know someone who may be qualified.  The client
is offering an attractive salary package with benefits.  I’d
appreciate the opportunity to speak with you in more detail about
their company and the specifics of the role. If you have a referral
please send me there contact info and we do pay a referral fee!

Thanks and take care,
Liz Smiley
Recruiter
GameRecruiter.com, Inc.
866-358-GAME - Ext: 113
www.GameRecruiter.com
http://www.linkedin.com/in/lizsmiley
--~--~-~--~~~---~--~~
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: Dumb problem using BackgroundRb

2009-01-08 Thread huard.el...@gmail.com

hi,

the invocation in your controller should go
Middleman.worker(:my_worker).my_method(:arguments)
see documentation: http://backgroundrb.rubyforge.org/

btw I'm not using backgroundrb anymore, i got fed up with unclear
error messages and relative instability.  I'm now using workling-
starling for any new projects.

Elise

On Jan 8, 3:22 pm, Federico Brubacher  wrote:
>  i'm trying to use BackgroundRb but when I do    worker =
> MiddleMan(:tag_sending_worker) in my controller i get "undefined method
> `MiddleMan' for # , but when i do it from
> the console it works fine.
>
> Of course i tried restarting my mongrel and restarting the backgroundrb
> process but no luck , any ideas o this ? It iis a weird problem , I
> don't know why it does the lookup in my Controller class only :(
>
> Thanks a lot in advance
> --
> 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: Versionning system

2009-01-08 Thread Fernando Perez

pepe wrote:
> Hi all.
> 
> I want to apologize, I guess this is not the best place to post this
> but I'm interested to know what RoR developers think.
> 
> What would be a good open source versionning system for somebody that
> has never used one?
> 
> Thanks a lot.
> 
> Pepe

We use Mercurial because back in time the support of Git on Windows was 
bad. On Mac and GNU/Linux, Mercurial and Git are both excellent choices, 
so you won't be wrong. Don't use SVN, it's out of the game for new 
commers.


--
Video training with screencasts at http://www.digiprof.fr


-- 
Posted via http://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: Installing and using restful_auth

2009-01-08 Thread Fernando Perez

Joshua Partogi wrote:
> Dear all,
> 
> I've saw a plugin called restful_auth several times in rails
> community, but I couldn't find any resources on how to use it. Does
> anyone know how to install and use it? Help really appreciated.
> 
> Best regards,

In google type: "restful_authentication github"


--
Video training with screencasts at http://www.digiprof.fr
-- 
Posted via http://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
-~--~~~~--~~--~--~---



  1   2   >