[Rails] Re: RE: Ruby on Rails Training

2010-03-19 Thread dare ruby
Jamal Soueidan wrote:
 Don't forget
 
 http://railsenvy.com/
 http://railsenvy.com/
 http://railsenvy.com/
 http://railsenvy.com/

mail me at 9994604873 or

contact me at 9994604873
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Some logic problem

2010-03-19 Thread Hemant Bhargava
Hello champs,

I am in dilemma here. I have structure like this:-

   EmployeeA
   |
  EmployeeBEmployeeC EmployeeD
  |  |
  EmployeeE  EmployeeH
  |
  EmployeeF

Currently if i login with EmployeeA account, It shows me its direct
reports. Like wise if i'll login with EmployeeD then it'll show me only
EmployeeH. If i'll login with EmployeeB account then it'll only show me
EmployeeE.

But i want it like this:-

If i'll login with EmployeeA, it should show me all.
If i'll login with EmployeeB, it should show me E  F.


Currently i am trying it like this:-

def get_all_reports(employee)
  direct_reports   = employee.managed_employees
@all_reports  += direct_reports
direct_reports.each do |report|
  get_all_reports(report)
end
@all_reports
end


My logic is fine, i think but do not know where i am doing mistake ..
The error coming out is stack level too deep..

I hope you people got me right and help me for sure..
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: free sms gateway in india

2010-03-19 Thread dare ruby
bramu...@gmail.com wrote:
 I tried with it but no luck its not working. Any one worked on the sms
 service in india??
 
 On May 13, 11:23�pm, Marnen Laibow-Koser rails-mailing-l...@andreas-

hi ramu, if you found the solution. could you please me to do the same.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Any help on SMS and payment gateway in India

2010-03-19 Thread dare ruby
bramu...@gmail.com wrote:
 are you able to find out the free sms gateway in india??
 
 On Dec 28 2007, 6:24�pm, Atul Gupta rails-mailing-l...@andreas-s.net

Dear atul and Ramu,

could able to find the solution for sms and payment gateway.

If so please help me to do the same or else we work together to acheive 
it.

Regards,
Jose 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Some logic problem

2010-03-19 Thread Josh Cheek
On Fri, Mar 19, 2010 at 12:03 AM, Hemant Bhargava li...@ruby-forum.comwrote:

 Hello champs,

 I am in dilemma here. I have structure like this:-

   EmployeeA
   |
  EmployeeBEmployeeC EmployeeD
  |  |
  EmployeeE  EmployeeH
  |
  EmployeeF

 Currently if i login with EmployeeA account, It shows me its direct
 reports. Like wise if i'll login with EmployeeD then it'll show me only
 EmployeeH. If i'll login with EmployeeB account then it'll only show me
 EmployeeE.

 But i want it like this:-

 If i'll login with EmployeeA, it should show me all.
 If i'll login with EmployeeB, it should show me E  F.


 Currently i am trying it like this:-

 def get_all_reports(employee)
  direct_reports   = employee.managed_employees
@all_reports  += direct_reports
direct_reports.each do |report|
  get_all_reports(report)
end
@all_reports
 end


 My logic is fine, i think but do not know where i am doing mistake ..
 The error coming out is stack level too deep..

 I hope you people got me right and help me for sure..
 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.


Perhaps you have a loop.

EmployeeX manages EmployeeY and EmployeeY manages EmployeeX

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



Re: [Rails] migration

2010-03-19 Thread David Chua
Care to post your migration script?

I suspect you might be creating a table instead of doing a 'add_column

David

On Mar 19, 2010 12:58 PM, Rajkumar Surabhi li...@ruby-forum.com wrote:

Hi all,

I have migrated with some tables in my application. After some days i
need to add few more tables to database. The initial tables in database
have some data. when i try to migrate the database for second time with
rake db:migrate it is saying the alredy table exist table name and
rake is aborted. i dont want to loose the old data and i want to add new
tables to alredy exiested database

how to do this. Please help me.


Regards,
Rajkumar.
--
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-t...@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

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



[Rails] Re: Some logic problem

2010-03-19 Thread Hemant Bhargava
Hi josh,

Thanks for a quickie, But how to get rid of this loop ..

Josh Cheek wrote:

 Perhaps you have a loop.
 
 EmployeeX manages EmployeeY and EmployeeY manages EmployeeX

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: RJS error: TypeError: element is null

2010-03-19 Thread Salil Gaikwad
Hi All,

I find it out why it happens because I didn't close div above the 
chat_area properly. the only thing i did isclose the div and it works 
like a magic, neways thanks to all

Reagrds,

Salil Gaikwad


-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Facebook style photo uploader

2010-03-19 Thread Kevin Elliott
Darren,

You should take a look at swfupload. It is a combination of javascript and
Flash so that you can upload in the background, report on the progress, etc.

-Kevin

On Thu, Mar 18, 2010 at 1:00 PM, Ruby on Rails: Talk
dazzaroo...@gmail.comwrote:

 Hi

 Does anyone know of a plugin or something similar which would add the
 Facebook style photo uploader (or something which will provide the
 same function)?

 Thanks in advance.

 Darren

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




-- 
Kevin Elliott
ke...@phunc.com | http://kevinelliott.net | http://twitter.com/kevinelliott

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



[Rails] Re: Rail Quickstart Guide: Always receiving template missing errors.

2010-03-19 Thread DmitryPush
Are you sure you don't have a typo, and name of your template looks
exactly like that app/views/posts/index.html.erb ?
if it's not could you provide here your posts controller, routs and
index view

On Mar 19, 3:14 am, Stone vtgbe...@gmail.com wrote:
 Hello,

 Upon going through the rails quickstart 
 guide:http://guides.rubyonrails.org/getting_started.html; also this guide
 here:http://fuelyourcoding.com/creating-your-first-ruby-on-rails-applicati...
 - I always get Missing Template errors.

 Specifically:
 Template is missing
 Missing template posts/index.erb in view path app/views

 Currently the file index.html.erb lives in app/views/posts/ - why is
 the error message looking for a .erb file when there is a .html.erb
 file in the folder that was created by a scaffold command? Renaming
 the file to .erb does not solve the problem.

 Here's my setup info from localhost:3000
 Ruby version    1.8.7 (universal-darwin10.0)
 RubyGems version        1.3.6
 Rack version    1.0
 Rails version   2.3.5
 Active Record version   2.3.5
 Active Resource version 2.3.5
 Action Mailer version   2.3.5
 Active Support version  2.3.5
 Application root        /Users/vtgbeats/[ Projects ]/[ Rails Apps ]/slambook
 Environment     development
 Database adapter        sqlite3
 Database schema version 20100318235949

 The routes.rb file is in default state.

 I've successfully created small RORs apps before and now I can't even
 render a view, please help. Thanks everyone,
 Stone

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



Re: [Rails] migration

2010-03-19 Thread kannav rajeev
No he is making add coulmn in the Existing one migration file . i think so

On Fri, Mar 19, 2010 at 12:01 PM, David Chua zhc...@gmail.com wrote:

 Care to post your migration script?

 I suspect you might be creating a table instead of doing a 'add_column

 David

 On Mar 19, 2010 12:58 PM, Rajkumar Surabhi li...@ruby-forum.com wrote:

 Hi all,

 I have migrated with some tables in my application. After some days i
 need to add few more tables to database. The initial tables in database
 have some data. when i try to migrate the database for second time with
 rake db:migrate it is saying the alredy table exist table name and
 rake is aborted. i dont want to loose the old data and i want to add new
 tables to alredy exiested database

 how to do this. Please help me.


 Regards,
 Rajkumar.
 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.

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




-- 
Thanks:
Rajeev sharma

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



[Rails] how to preserve the value from the other action controller

2010-03-19 Thread Yudi Soesanto
Hi,

Anyone knows how to preserve the value from the previous action controller?

For example,
- I have 2 controllers: foo_one and foo_two.
- on action foo_one, I have variable @my_value
- How I can keep the value of @my_value so I can use it on the second
controller foo_two


def foo_one
  @my_value = params[:preserve_value]
end

def foo_two
  puts @preserve_value
end


I don't want to use session or global variable. any suggestion?

Yudi Soesanto

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



[Rails] Re: Facebook style photo uploader

2010-03-19 Thread Marcin Seroczynski
Or You could simply take a look at ready to use projects from github
like:
http://github.com/bbenezech/papermill
http://github.com/jbasdf/uploader

Which need only some stylings in CSS to have same lookfeel like
Facebook.

-Martin

On 19 Mar, 08:28, Kevin Elliott ke...@phunc.com wrote:
 Darren,

 You should take a look at swfupload. It is a combination of javascript and
 Flash so that you can upload in the background, report on the progress, etc.

 -Kevin

 On Thu, Mar 18, 2010 at 1:00 PM, Ruby on Rails: Talk
 dazzaroo...@gmail.comwrote:



  Hi

  Does anyone know of a plugin or something similar which would add the
  Facebook style photo uploader (or something which will provide the
  same function)?

  Thanks in advance.

  Darren

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

 --
 Kevin Elliott
 ke...@phunc.com |http://kevinelliott.net|http://twitter.com/kevinelliott

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



[Rails] how to add current time as default value

2010-03-19 Thread Rajkumar Surabhi
hi all,

by using timestamps we can create created_at and updated_on columns to
our tables. But i dont wnat the columns in my table and i want to add my
own column which datatype is timestamp and that must take
current_timestamp or now as default value.


how to do it


re
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Rails + Mysql

2010-03-19 Thread Yudi Soesanto
Jose,

What rails version and mysql version are you using?
Do this:
*rails -v*
*mysql --version*

I have the same issue as your after I upgraded to rails 2.2.2 and finally, I
got it work
What I did, I reinstall mysql and it worked ok now.

Yudi Soesanto


2010/3/18 José Luis Romero tangu...@gmail.com

 On Mar 18, 12:36 am, Conrad Taylor conra...@gmail.com wrote:
  José, can you verify that MySQL is running by doing the following:
 
  $ mysql -uusername

 Yes it's running...

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



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



[Rails] Re: Facebook style photo uploader

2010-03-19 Thread DmitryPush
also you can take a look on Uploadify it's not like in Facebook but
it's pretty simple to install and use.
demo:
http://www.uploadify.com/demo/
Rails and uplodify:
http://casperfabricius.com/site/2009/03/26/uploading-multiple-files-with-progress-indicator-using-jquery-flash-and-rails/
http://drawohara.com/post/182116634/rails-uploadify-the-easy-way

On Mar 19, 11:12 am, Marcin Seroczynski sere...@gmail.com wrote:
 Or You could simply take a look at ready to use projects from github
 like:http://github.com/bbenezech/papermillhttp://github.com/jbasdf/uploader

 Which need only some stylings in CSS to have same lookfeel like
 Facebook.

 -Martin

 On 19 Mar, 08:28, Kevin Elliott ke...@phunc.com wrote:

  Darren,

  You should take a look at swfupload. It is a combination of javascript and
  Flash so that you can upload in the background, report on the progress, etc.

  -Kevin

  On Thu, Mar 18, 2010 at 1:00 PM, Ruby on Rails: Talk
  dazzaroo...@gmail.comwrote:

   Hi

   Does anyone know of a plugin or something similar which would add the
   Facebook style photo uploader (or something which will provide the
   same function)?

   Thanks in advance.

   Darren

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

  --
  Kevin Elliott
  ke...@phunc.com |http://kevinelliott.net|http://twitter.com/kevinelliott

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



Re: [Rails] undefined method error despite the fact it doesn't exist

2010-03-19 Thread Colin Law
On 18 March 2010 23:43, John Merlino li...@ruby-forum.com wrote:


 Hey all,

 I'm getting a strange, unexplainable error. It returns undefined method
 `render_index_row_action_pprove'. I performed a search on my entire
 application and no such method exists. There is a
 render_index_row_action_approve but not a
 render_index_row_action_pprove.

 NoMethodError in Student_requests#index

 Showing app/views/resources/index.html.haml where line #20 raised:

 undefined method `render_index_row_action_pprove' for
 #ActionView::Base:0x105b3a780

 Extracted source (around line #20):

 17:           = render_index_row_index index
 18:           - resources_index_row(rsrc).each do |row|
 19:             = row
 20:           = render_index_row_actions(rsrc,
 resources_index_row_actions(rsrc), options)
 21:   - options[:with_limit_selector] = false
 22:   = render_index_bottom_pagination_bar options

What does the trace show?

Colin


 Is this a rails glitch, perhaps it is reading the method name wrong? Is
 there anyway to fix this?
 Thanks for any response.
 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



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



Re: [Rails] getting data from a through table

2010-03-19 Thread Michael Pavling
On 19 March 2010 03:49, dan mr.dan.ma...@gmail.com wrote:
 now imagine that attribute_objects also contains a rating
 so when i say, object.attributes, id like to get the rating too
 that doesnt seem to be possible with the has_many relationship
 if i could force the join on the object attributes to bring the
 attribute_objects fields also...maybe

If you want to access properties of AttributeObjects [1], you can
iterate the collection of them, not the collection of attributes.
So instead of:

@object.attributes.each do |attribute|
  attribute.name 
end

you do this:
@object.attribute_objects.each do |attribute_object|
  attribute_object.attribute.name 
  attribute_object.rating 
end

 i think i have to write custom sql for this

You can if you want... but you don't *have* to.
You can possibly use the :finder_sql option of the association to
specify your own conditions for populating the collection (I've been
fiddling with it here for 10mins, and not got it working... post up
some working code if it does it for you :-)
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html


[1] All your class names are plural; they should really be singular...

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



[Rails] Re: Send Java script variable to a controller

2010-03-19 Thread DmitryPush
Here is non ajax method(but ajax pretty the same):
 var f = document.createElement('form');
 f.style.display = 'none';
 this.parentNode.appendChild(f);
 f.method = 'POST'; #or get
 f.action = this.href;
 var m = document.createElement('input');
 m.setAttribute('type', 'hidden');
 m.setAttribute('name', '_method');
 //m.setAttribute('value', 'delete'); #or put it depends of your needs
 f.appendChild(m);
//Now we can send your variables:
 var s = document.createElement('input');
 s.setAttribute('type', 'hidden');
 s.setAttribute('name', 'my_var');
 s.setAttribute('value', 'my_var_value');
 f.appendChild(s);
 f.submit();

On Mar 18, 10:48 pm, Mohammed Alenazi vb4...@gmail.com wrote:
 I am trying to build an application that has google maps. Inside the
 script there are two java script variables. I want to send those two
 variables using a java function. What is the best why to do that.
 Could someone give me a simple example on that.

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



[Rails] how to specify relationship between these models

2010-03-19 Thread Tom Mac
Hi
   I have a user model which I used as authlogic. What I need to
implement is I have to add staff also to the system. And I designed
tables like

users
-
name
email
phone  etc


staffs
--
city
state
user_id
   My question is is this the right approach? And if yes what
would be the relation from users to staffs? I think we can say

staff belongs_to user
But what is the reverse?

Thanks in advance
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Some logic problem

2010-03-19 Thread Colin Law
On 19 March 2010 06:39, Hemant Bhargava li...@ruby-forum.com wrote:
 Hi josh,

 Thanks for a quickie, But how to get rid of this loop ..

 Josh Cheek wrote:

 Perhaps you have a loop.

 EmployeeX manages EmployeeY and EmployeeY manages EmployeeX

Remove it from the database and put in validations to stop it happening again.
The infinite recursion could also be caused by an employee managing himself.

Colin

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



Re: [Rails] Re: RJS error: TypeError: element is null

2010-03-19 Thread Colin Law
On 19 March 2010 07:04, Salil Gaikwad li...@ruby-forum.com wrote:
 Hi All,

 I find it out why it happens because I didn't close div above the
 chat_area properly. the only thing i did isclose the div and it works
 like a magic, neways thanks to all

I suggest installing the html validator add-in to Firefox and that
will check the html of your pages as you develop them.  This would
have shown your missing /div immediately.

Alternatively you can paste the html of the page into the w3c html
validator for checking but this is much less convenient.

Colin


 Reagrds,

 Salil Gaikwad


 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to 
 rubyonrails-talk+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/rubyonrails-talk?hl=en.



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



[Rails] Re: how to specify relationship between these models

2010-03-19 Thread Veera Sundaravel
Let say

you are having staff, directors and managers as part of your system, and 
their details will be in users table so let say we can build inheritance 
based relationship like below:

Class User   ActiveRecord::Base
end

Class Staff  User
end

Class Director  User
end

Class Manager  User
end

users table:
id
type
name
email
phone
city
state etc

Now just you can create staff, directors as follows

staff = Staff.create(:name=Tom Mac, :email=tom@xyz.com)

So it will create one record in users table and mark the column type 
with Staff. Hope it will solve your issue.

Regards.
T.Veeraa
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Some logic problem

2010-03-19 Thread Hemant Bhargava
Thanks colin.

Resolved it as well. Cheers .. !!


Colin Law wrote:

 Remove it from the database and put in validations to stop it happening 
 again.
 The infinite recursion could also be caused by an employee managing 
 himself.
 
 Colin

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: how to add current time as default value

2010-03-19 Thread Loganathan Ganesan
Rajkumar Surabhi wrote:
 hi all,
 
 by using timestamps we can create created_at and updated_on columns to
 our tables. But i dont wnat the columns in my table and i want to add my
 own column which datatype is timestamp and that must take
 current_timestamp or now as default value.
 
 
 how to do it
 
 
 re

Since we cannot specify the now() function in the :default option in the 
migration file, we can achieve this requirement using the following:

# Sample code
class Samples  ActiveRecord::Migration
  def self.up
create_table :system_settings do |t|
  t.text  :value
  t.string  :type
  t.timestamp :created_time
end
  execute ALTER TABLE system_settings ALTER created_time SET 
DEFAULT now()
  end

  def self.down
  end
end



-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] TEKsystems - Ruby on Rails Job Opportunities

2010-03-19 Thread kannav rajeev
hi sir i am interested in this job *And*  skills i have

RoR one year experience
rails 2.3.5
mysql 5.41.XX-dbms
Apache-web server
windows
Tortoise-SVN


Topics Resolved On the  Current Project :
*
 migration , sphinx , MVC ,  OOP


and more on more bugs removal and enhancements


*reply will provide *pleasure.
*
-- 
Thanks:
Rajeev sharma

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



Re: [Rails] Re: how to add current time as default value

2010-03-19 Thread kannav rajeev
Time.now

On Fri, Mar 19, 2010 at 2:44 PM, Loganathan Ganesan li...@ruby-forum.comwrote:

 Rajkumar Surabhi wrote:
  hi all,
 
  by using timestamps we can create created_at and updated_on columns to
  our tables. But i dont wnat the columns in my table and i want to add my
  own column which datatype is timestamp and that must take
  current_timestamp or now as default value.
 
 
  how to do it
 
 
  re

 Since we cannot specify the now() function in the :default option in the
 migration file, we can achieve this requirement using the following:

 # Sample code
 class Samples  ActiveRecord::Migration
  def self.up
create_table :system_settings do |t|
  t.text  :value
  t.string  :type
  t.timestamp :created_time
end
  execute ALTER TABLE system_settings ALTER created_time SET
 DEFAULT now()
  end

  def self.down
  end
 end



 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 
Thanks:
Rajeev sharma

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



Re: [Rails] how to preserve the value from the other action controller

2010-03-19 Thread Andy Jeffries
On 19 March 2010 08:12, Yudi Soesanto soesa...@gmail.com wrote:

 Hi,

 Anyone knows how to preserve the value from the previous action controller?

 For example,
 - I have 2 controllers: foo_one and foo_two.
 - on action foo_one, I have variable @my_value
 - How I can keep the value of @my_value so I can use it on the second
 controller foo_two

 def foo_one
   @my_value = params[:preserve_value]
 end

 def foo_two
   puts @preserve_value
 end


 I don't want to use session or global variable. any suggestion?


Assuming foo_one calls foo_too (so it's in the same request - hence your
global variable mention), then you could define an attr_accessor on
foo_two's controller and set it from there.

But, if it's not being executed in the same request, session (be it Rails
session, database or memcached) is the only way (or flash so it's
automatically removed after the next request).

Cheers,


Andy

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



[Rails] Speed up loading rails and running specs on MacBook Pro

2010-03-19 Thread Andi Schacke
Hi all,

some time ago I found out that loading the rails environment and
running my specs was much much faster on my iMac than on my MacBook
Pro (of course the hardware does explain a bit of that difference). I
had compiled my ruby1.8.7 on my MacBook Pro with --enable-shared --
enable-pthread option (as recommended in various tutorials). So I just
recompiled ruby1.8.7 without those options and after that the rails
environment and the specs did actually run much faster:

specs before:
Finished in 76.090626 seconds
2560 examples, 0 failures

specs after:
Finished in 24.645957 seconds
2560 examples, 0 failures

You know what this means in terms of productivity when doing TDD.

Just wanted to know if there's anyone with similar experiences.

Andi

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



Re: [Rails] how to preserve the value from the other action controller

2010-03-19 Thread Yudi Soesanto
Thanks for your reply.
I will do research on memcached

Yudi Soesanto


On Fri, Mar 19, 2010 at 5:36 AM, Andy Jeffries andyjeffr...@gmail.comwrote:

 On 19 March 2010 08:12, Yudi Soesanto soesa...@gmail.com wrote:

 Hi,

 Anyone knows how to preserve the value from the previous action
 controller?

 For example,
 - I have 2 controllers: foo_one and foo_two.
 - on action foo_one, I have variable @my_value
 - How I can keep the value of @my_value so I can use it on the second
 controller foo_two

 def foo_one
   @my_value = params[:preserve_value]
 end

 def foo_two
   puts @preserve_value
 end


 I don't want to use session or global variable. any suggestion?


 Assuming foo_one calls foo_too (so it's in the same request - hence your
 global variable mention), then you could define an attr_accessor on
 foo_two's controller and set it from there.

 But, if it's not being executed in the same request, session (be it Rails
 session, database or memcached) is the only way (or flash so it's
 automatically removed after the next request).

 Cheers,


 Andy

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


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



[Rails] Plugins questions

2010-03-19 Thread Yudi Soesanto
Hi,

I want to create a ruby on rails application that has user login and user
role.
What is a good plugin to use?

Thanks for your response in advance.

Yudi Soesanto

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



[Rails] Passing parameters to a view and render in inline iframe on the same page

2010-03-19 Thread shiran
Hi,

I'm developing a rails app and need to do the following.

My main page (main.html.erb) has a small form and a submit button.
Also it has an inline iframe.

When click the submit button I need to pass some parameters to another
content page (content.html.erb) to create dynamic contents and load
the content page inside main page's inline iframe.

(What a user sees is only the main page and iframe content changes on
submit button click)

How can I do with this Rails? I tried several ways and sometimes even
my browser crashed. Thanks for your comments in advance.

Shiran

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



Re: [Rails] Plugins questions

2010-03-19 Thread mahesh s
hi yudi

acl9 plug-in will help you for role based user authentication

git url for the plug-in http://github.com/be9/acl9

thanks
Mahesh.s


On Fri, Mar 19, 2010 at 3:41 PM, Yudi Soesanto soesa...@gmail.com wrote:

 Hi,

 I want to create a ruby on rails application that has user login and user
 role.
 What is a good plugin to use?

 Thanks for your response in advance.

 Yudi Soesanto

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


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



[Rails] Call helper function in test file

2010-03-19 Thread Hemant Bhargava
Do anybody know how to call helper function in test files?

I mean i have written a function in application_helper.rb and i want to
call it in one of my test files.. test/integration/abc.rb ..

Have any idea ?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Plugins questions

2010-03-19 Thread Yudi Soesanto
Thanks for your reply

I read from http://github.com/be9/acl9#readme and it said that Acl9 is a
authorization solution, so you will need to implement authentication by
other means.

I need authentication plugins too. So what is the better one?

Thanks,
Yudi Soesanto


On Fri, Mar 19, 2010 at 6:21 AM, mahesh s mahesh...@gmail.com wrote:

 hi yudi

 acl9 plug-in will help you for role based user authentication

 git url for the plug-in http://github.com/be9/acl9

 thanks
 Mahesh.s


 On Fri, Mar 19, 2010 at 3:41 PM, Yudi Soesanto soesa...@gmail.com wrote:

 Hi,

 I want to create a ruby on rails application that has user login and user
 role.
 What is a good plugin to use?

 Thanks for your response in advance.

 Yudi Soesanto

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


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


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



[Rails] undefined method move_higher

2010-03-19 Thread rani
hi
 i installed acts_as_list plugin into my application but i am getting
the error when i am trying to access the methods as
move_to_bottom,move_higher,move_lower etc.
how can i solve this issue

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



Re: [Rails] Plugins questions

2010-03-19 Thread mahesh s
Hi Yudi

Have you tried with restful authentication

if not try with that
http://agilewebdevelopment.com/plugins/restful_authentication
giturl: http://github.com/technoweenie/restful-authentication

Thanks
Mahesh.s
On Fri, Mar 19, 2010 at 4:11 PM, Yudi Soesanto soesa...@gmail.com wrote:

 Thanks for your reply

 I read from http://github.com/be9/acl9#readme and it said that Acl9 is a
 authorization solution, so you will need to implement authentication by
 other means.

 I need authentication plugins too. So what is the better one?

 Thanks,
 Yudi Soesanto



 On Fri, Mar 19, 2010 at 6:21 AM, mahesh s mahesh...@gmail.com wrote:

 hi yudi

 acl9 plug-in will help you for role based user authentication

 git url for the plug-in http://github.com/be9/acl9

 thanks
 Mahesh.s


 On Fri, Mar 19, 2010 at 3:41 PM, Yudi Soesanto soesa...@gmail.comwrote:

  Hi,

 I want to create a ruby on rails application that has user login and user
 role.
 What is a good plugin to use?

 Thanks for your response in advance.

 Yudi Soesanto

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


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


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


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



Re: [Rails] Plugins questions

2010-03-19 Thread nagarani gajjala
hi
thanks for the reply
i already did with restful routing
i am new to rails development it is giving the same error for me
can you give any more advice



On Fri, Mar 19, 2010 at 4:20 PM, mahesh s mahesh...@gmail.com wrote:

 Hi Yudi

 Have you tried with restful authentication

 if not try with that
 http://agilewebdevelopment.com/plugins/restful_authentication
 giturl: http://github.com/technoweenie/restful-authentication

 Thanks
 Mahesh.s
 On Fri, Mar 19, 2010 at 4:11 PM, Yudi Soesanto soesa...@gmail.com wrote:

 Thanks for your reply

 I read from http://github.com/be9/acl9#readme and it said that Acl9 is a
 authorization solution, so you will need to implement authentication by
 other means.

 I need authentication plugins too. So what is the better one?

 Thanks,
 Yudi Soesanto



 On Fri, Mar 19, 2010 at 6:21 AM, mahesh s mahesh...@gmail.com wrote:

 hi yudi

 acl9 plug-in will help you for role based user authentication

 git url for the plug-in http://github.com/be9/acl9

 thanks
 Mahesh.s


 On Fri, Mar 19, 2010 at 3:41 PM, Yudi Soesanto soesa...@gmail.comwrote:

  Hi,

 I want to create a ruby on rails application that has user login and
 user role.
 What is a good plugin to use?

 Thanks for your response in advance.

 Yudi Soesanto

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


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


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


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


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



Re: [Rails] Plugins questions

2010-03-19 Thread Yudi Soesanto
Thanks mahesh.
I will try using restful.

Thanks,
Yudi Soesanto


On Fri, Mar 19, 2010 at 7:01 AM, nagarani gajjala 
gajjala.nagar...@gmail.com wrote:

 hi
 thanks for the reply
 i already did with restful routing
 i am new to rails development it is giving the same error for me
 can you give any more advice




 On Fri, Mar 19, 2010 at 4:20 PM, mahesh s mahesh...@gmail.com wrote:

 Hi Yudi

 Have you tried with restful authentication

 if not try with that
 http://agilewebdevelopment.com/plugins/restful_authentication
 giturl: http://github.com/technoweenie/restful-authentication

 Thanks
 Mahesh.s
 On Fri, Mar 19, 2010 at 4:11 PM, Yudi Soesanto soesa...@gmail.comwrote:

 Thanks for your reply

 I read from http://github.com/be9/acl9#readme and it said that Acl9 is a
 authorization solution, so you will need to implement authentication by
 other means.

 I need authentication plugins too. So what is the better one?

 Thanks,
 Yudi Soesanto



 On Fri, Mar 19, 2010 at 6:21 AM, mahesh s mahesh...@gmail.com wrote:

 hi yudi

 acl9 plug-in will help you for role based user authentication

 git url for the plug-in http://github.com/be9/acl9

 thanks
 Mahesh.s


 On Fri, Mar 19, 2010 at 3:41 PM, Yudi Soesanto soesa...@gmail.comwrote:

  Hi,

 I want to create a ruby on rails application that has user login and
 user role.
 What is a good plugin to use?

 Thanks for your response in advance.

 Yudi Soesanto

 --
 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.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.


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


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


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


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


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



[Rails] Re: how to specify relationship between these models

2010-03-19 Thread Tom Mac
Hi
 Thanks for your reply. This I have already thought of. But one 
thing I can't understand is why everything is stored in a single table 
say users here? Can we store each items for say staff,director etc  to 
there own tables? Or Am I wrong?

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] undefined method move_higher

2010-03-19 Thread Bala
have you restarted your server?

On Fri, Mar 19, 2010 at 4:15 PM, rani gajjala.nagar...@gmail.com wrote:

 hi
  i installed acts_as_list plugin into my application but i am getting
 the error when i am trying to access the methods as
 move_to_bottom,move_higher,move_lower etc.
 how can i solve this issue

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



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



Re: [Rails] Re: how to specify relationship between these models

2010-03-19 Thread Michael Pavling
On 19 March 2010 11:43, Tom Mac li...@ruby-forum.com wrote:
 why everything is stored in a single table

That's called Single Table Inheritance (STI)

 Can we store each items for say staff,director etc  to
 there own tables? Or Am I wrong?

You're not wrong; you can do it with different tables if you want.

Data modelling is done however is best for you. Sometimes you might
start with STI, refactor to associations, and then refactor back to
STI as your project requirements evolve.
Problems may occur when, for instance, your Managers also need to have
elements of the properties of Staff - you can't inherit from two
base-classes, so you have to start looking at mixing-in modules
instead, or of some other method of structuring your data to make it
make sense. Also, what happens if you have someone who's a staff
member of two offices (if that's possible for your organisation)? Can
they have different roles in the different places? etc...

Personally, I tend to keep users as a table for
authentication-related info, and in my people table (I'd tend to
avoid STI for people) I keep personal info, link to a user record, and
assign a role which is used for handling permissions. I'd rather
have lots of associations for data, because that's more flexible than
one wide flat table (the likes of which STI generally leads to...)

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



Re: [Rails] Re: Re: render a Google Chart to a file

2010-03-19 Thread Rob Biedenharn


On Mar 18, 2010, at 9:00 PM, Adam Ziemba wrote:


Colin Law wrote:

   open(http://chart.apis.google.com/chart#{CGI.escape('? 
cht=bvgchbh=achd=s:vttustychs=500x300chxt=x,ychxl=0:|Sun|Mon| 
Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12')})

do |chart|
 File.open('chart.png', 'w') {|f| f.write chart.read }
   end


I definitely understand the why you would want to escape the URI, but
I'm not convinced that this approach will never work.

The URL with the escaped characters causes Google to reject it as
invalid parameters, which is why you got all that HTML and Javascript.
E.g. if you use your browser to open the result of the above URI with
escaped characters:

http://chart.apis.google.com/chart%3Fcht%3Dbvg%26chbh%3Da%26chd%3Ds%3Avttusty%26chs%3D500x300%26chxt%3Dx%2Cy%26chxl%3D0%3A%7CSun%7CMon%7CTue%7CWed%7CThu%7CFri%7CSat%7C1%3A%7C0%7C2%7C4%7C6%7C8%7C10%7C12

You are redirected to the Google chart API. Retaining the original
characters with:

http://chart.apis.google.com/chart?cht=bvgchbh=achd=s:vttustychs=500x300chxt=x,ychxl=0 
:|Sun|Mon|Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12


you'll get a PNG image and nothing else.


Okay, so Google doesn't want the escaped characters, and the URI::open
method doesn't want the plain characters... or does it? Is there no  
way

around this? The thing is the characters used in the URL above are
valid, or so I thought. I pass these kind of characters as parameters
from controller to view all throughout my application, with full  
browser

compatibility.

I tried using backslashes for all the characters, e.g. \ instead of
 and the URI open method still rejects it.

I've seen some people successfully get images to save to the file  
system

using URI, but I'm assuming all their code is outdated as I could not
get it to work. Also, the image URL they were using actually pointed  
to

a PNG image, with a PNG extension, whereas the Google Chart URL will
return a PNG image.


I appreciate all the help!


You just need a URI that's technically valid, not just one that  
browsers understand. URI.parse and thus open-uri is rather more strict  
than the other tools suggested.


Here's an irb session that shows the right way to get a valid URI for  
the chart you want.


$ irb -ruri -ropen-uri -rcgi
irb orig = 'http://chart.apis.google.com/chart?cht=bvgchbh=achd=s:vttustychs=500x300chxt=x,ychxl=0 
:|Sun|Mon|Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12'
= http://chart.apis.google.com/chart?cht=bvgchbh=achd=s:vttustychs=500x300chxt=x,ychxl=0 
:|Sun|Mon|Tue|Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12

irb md = %r{(https?:)//((?i:[-a-z0-9.]+))(/[^?]+)\??(.*)}.match(orig)
= #MatchData:0x391070
irb scheme, host, path, query_string = md.captures
= [http:, chart.apis.google.com, /chart,  
cht=bvgchbh=achd=s:vttustychs=500x300chxt=x,ychxl=0:|Sun|Mon|Tue| 
Wed|Thu|Fri|Sat|1:|0|2|4|6|8|10|12]

irb query_string.split('').map{|pair| pair.split('=')}
= [[cht, bvg], [chbh, a], [chd, s:vttusty], [chs,  
500x300], [chxt, x,y], [chxl, 0:|Sun|Mon|Tue|Wed|Thu|Fri|Sat| 
1:|0|2|4|6|8|10|12]]

irb u = URI.parse #{scheme}//#{host}
= #URI::HTTP:0x37cf44 URL:http://chart.apis.google.com
irb u.path = path
= /chart
irb u.query = query_string.split('').map{|pair|  
pair.split('=')}.map{|n,v| #{n}=#{CGI.escape(v)}}.join('')
= cht=bvgchbh=achd=s%3Avttustychs=500x300chxt=x%2Cychxl=0%3A 
%7CSun%7CMon%7CTue%7CWed%7CThu%7CFri%7CSat%7C1%3A 
%7C0%7C2%7C4%7C6%7C8%7C10%7C12

irb open(u.to_s) do |chart|
? File.open('chart.png', 'w') {|f| f.write chart.read }
irb   end
= 5445
irb File.exist?('chart.png')
= true

Note that if you are building up the URI yourself, you could just  
create it with valid escaping on the query string rather than pulling  
it apart and escaping it as you put it back together.


-Rob

Rob Biedenharn  http://agileconsultingllc.com
r...@agileconsultingllc.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] undefined method move_higher

2010-03-19 Thread nagarani gajjala
yes but no use


On Fri, Mar 19, 2010 at 5:27 PM, Bala bala.mutha...@gmail.com wrote:

 have you restarted your server?


 On Fri, Mar 19, 2010 at 4:15 PM, rani gajjala.nagar...@gmail.com wrote:

 hi
  i installed acts_as_list plugin into my application but i am getting
 the error when i am trying to access the methods as
 move_to_bottom,move_higher,move_lower etc.
 how can i solve this issue

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


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


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



[Rails] Re: Re: how to specify relationship between these models

2010-03-19 Thread Ar Chron
Michael Pavling wrote:
 
 Personally, I tend to keep users as a table for
 authentication-related info, and in my people table (I'd tend to
 avoid STI for people) I keep personal info, link to a user record, and
 assign a role which is used for handling permissions. I'd rather
 have lots of associations for data, because that's more flexible than
 one wide flat table (the likes of which STI generally leads to...)

+! for Michael's view.

User, Manager, Staff, Guest, whatever - they're all users of your 
system. The core definition of a user, and all those attributes can go 
into a base Users table.

If there are unique attributes for some other 'refinements' of User, I 
tend to push those attributes out to a related table for the type, 
allowing a single User entity to be more than one flavor of user. The 
Guest, being a generic User, doesn't have any relationships.

Just one of many possible solutions, but this type of User modeling has 
survived many projects.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] how to specify relationship between these models

2010-03-19 Thread Andy Jeffries

   My question is is this the right approach? And if yes what
 would be the relation from users to staffs? I think we can say

 staff belongs_to user
But what is the reverse?


user has_one staff

Cheers,


Andy

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



[Rails] Recognize path inside a helper

2010-03-19 Thread anler
Hi Folks, I need to get a hash of params from an url path inside a
helper.
The way I've been doing this was through recognize_path in RouteSet
but now throw me an Exception: MethodNotAllowed(I think beacuse the
path is an admin path?)
There is another way?

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: calling a method from a different class's view

2010-03-19 Thread Adam Stegman
On Mar 18, 5:32 pm, Frederick Cheung frederick.che...@gmail.com
wrote:
 A more railsy way of doing
 it would be for player2 to be an association and to define a full name
 method on Player ie

 def full_name
  firstName + lastName
 end

 and then your view would look like %= h @game.player2.full_name %

 It's also convention that attribute names be underscored (ie
 first_name rather than firstName)

The other convention I think is important here is that your getters
do not start with get like they do in Java. You generally just put
the attribute name. Because Ruby doesn't require parentheses after
methods, you can just say player.full_name instead of
player.getFullName() like you would in Java. It's a more concise and
clear grammar.

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



[Rails] Re: Problem about each in rails

2010-03-19 Thread Adam Stegman
Or more concisely (because it's fun):
%=h @posts.map(:name).to_sentence %
which will make it Tom, Dick, and Harry.

On Mar 18, 12:46 pm, tomkurt tom.maeckelber...@gmail.com wrote:
 If you want the names seperated by comma, try this:

 %=h @posts.map{|p| p.name}.join(', ') %

 On 18 mrt, 17:48, Michael Pavling pavl...@gmail.com wrote:



  On 18 March 2010 16:33, Grick Zh li...@ruby-forum.com wrote:

   %=h @posts.each {|p| p.name} %

   why this code return serial strings like #Post:0x3a893e8 ?

  Because you're outputting the return value of the whole loop, not the
  output of each block.
  If you run that command in your console, you will see it return an
  array of Posts; and that's what you're trying to render.

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



[Rails] Re: MailChimp API recommendations?

2010-03-19 Thread Florent2
On 18 mar, 07:31, Hassan Schroeder hassan.schroe...@gmail.com wrote:
 This page - http://www.mailchimp.com/api/downloads/ - lists five
 gems/plugins for interacting with the MailChimp service, and for all
 I know there are others.

 Anyone have a personal recommendation? Based on any of stability,
 ease of integration, completeness, whatever...

I've been using Hominid for a while (http://github.com/bgetting/
hominid) without problems, it is up-to-date with MailChimp API last
version, and development is active

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



[Rails] Modern tagging plugin

2010-03-19 Thread Andy Jeffries
What's the current recommendation for ActiveRecord model tagging gems?

Is acts_at_taggable still state of the art (I haven't needed to this for a
long time).

Cheers,


Andy

-- 
Andy Jeffries
http://andyjeffries.co.uk/  #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840

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



Re: [Rails] Plugins questions

2010-03-19 Thread Colin Law
On 19 March 2010 10:50, mahesh s mahesh...@gmail.com wrote:
 Hi Yudi

 Have you tried with restful authentication

I believe authlogic is generally considered the better solution currently.

Colin


 if not try with that
 http://agilewebdevelopment.com/plugins/restful_authentication
 giturl: http://github.com/technoweenie/restful-authentication

 Thanks
 Mahesh.s
 On Fri, Mar 19, 2010 at 4:11 PM, Yudi Soesanto soesa...@gmail.com wrote:

 Thanks for your reply
 I read from http://github.com/be9/acl9#readme and it said that Acl9 is a
 authorization solution, so you will need to implement authentication by
 other means.
 I need authentication plugins too. So what is the better one?
 Thanks,
 Yudi Soesanto


 On Fri, Mar 19, 2010 at 6:21 AM, mahesh s mahesh...@gmail.com wrote:

 hi yudi

 acl9 plug-in will help you for role based user authentication

 git url for the plug-in http://github.com/be9/acl9

 thanks
 Mahesh.s


 On Fri, Mar 19, 2010 at 3:41 PM, Yudi Soesanto soesa...@gmail.com
 wrote:

 Hi,
 I want to create a ruby on rails application that has user login and
 user role.
 What is a good plugin to use?
 Thanks for your response in advance.
 Yudi Soesanto

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

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

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

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


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



[Rails] Re: Ruby 1.9 loading rails is slow

2010-03-19 Thread ChrisT
Rails 3.0.0.beta
And as far as loading rails, I mean anything involving the 'rails'
command. rails console, rails server, rails generate - all 30+
seconds.
Anything involve the rake tasks rails ships with: rake db:migrate,
rake test:units - 30+ seconds.
I honestly haven't even gotten into actually running the server yet -
I've been writing models and test units, but I did test on just
webrick and response time - 30+ seconds.
This is on Windows XP, Ubuntu 9.10 or Ubuntu 9.04 (both ubuntu were on
VirtualBox with XP as the host). I've tried Ruby 1.9.1 and 1.8.7.
1.8.7 just made things vastly worse - 2+ minutes to start some things.

On Mar 18, 1:19 pm, Conrad Taylor conra...@gmail.com wrote:
 On Wed, Mar 10, 2010 at 2:44 PM, Andrius Chamentauskas
 sinsil...@gmail.comwrote:

  Hello all,

  I've recently started a project and I wanted to give ruby 1.9 + rails
  a chance. Well everything works great, so far haven't encountered any
  gem that didn't work (so anyone out there you should give it a try).
  There's only one minor glitch: on ruby 1.8.7 loading rails environment
  takes 1-2 secs, on 1.9.1 it takes ~10 secs. Maybe anyone had similar
  problem? I'm on ubuntu 9.10 and I compiled ruby from source (as I've
  noticed it works ~20% faster than apt version).

 What do you mean when you say loading Rails?  Command-line using webrick or
 thin?  Rails console?  Passenger?  Also, what version of Rails are you
 using?

 -Conrad



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

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



[Rails] Re: Rails development processes running very slow

2010-03-19 Thread Aldric Giacomoni
ChrisT wrote:
 
 My Gemfile:
  source 'http://gemcutter.org'
  source 'http://gems.github.com'
 gem gemcutter, 0.4.1
 
 # Rails3 beta
 gem rails, 3.0.0.beta
 
 # ActiveRecord requires a database adapter.
 gem ruby-mysql
 
 # Gems required for the AftershockHarness
 gem watir, 1.6.5
 gem firewatir, 1.6.5
 

Okay.. Did you do 'bundler lock' ?
(I am shooting blind here, I'm confused by the problem, but sometimes 
it's like playing broadsides.. start shooting and it starts making 
sense!).

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: undefined method error despite the fact it doesn't exist

2010-03-19 Thread John Merlino
Billee D. wrote:
 Hi John,
 I would check your source code in app/views/resources/index.html.haml
 (or a view helper for that view) for a typo since it's looking for a
 method named something similar to what you have (e.g change
 render_index_row_action_pprove to render_index_row_action_approve)
 
 HTH



I run the command find . -print | awk '{print \$0\}' | grep -v 
\.svn | xargs grep -i render_index_row_action_pprove

and this is what I get:

trunk/log/development.log:ActionView::TemplateError (undefined method 
`render_index_row_action_pprove' for #ActionView::Base:0x10c5ca938) on 
line #20 of app/views/resources/index.html.haml:

So the only place the method appears is in the development log. When 
someone else downloaded a local copy from the repository, they got no 
such error. So either a modification needs to be made in the development 
log or there's nothing else it appears I can do. Thanks for the 
response.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: undefined method error despite the fact it doesn't exist

2010-03-19 Thread Aldric Giacomoni
John Merlino wrote:
 
 and this is what I get:
 
 trunk/log/development.log:ActionView::TemplateError (undefined method 
 `render_index_row_action_pprove' for #ActionView::Base:0x10c5ca938) on 
 line #20 of app/views/resources/index.html.haml:
 

So, what's on line #20 of app/views/resources/index.html.haml ?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] PAM Authentication

2010-03-19 Thread tommy xiao
http://andrem.wordpress.com/2008/08/10/pam-ruby-rpam/

2010/3/19 Evaldo Kalbermatter li...@ruby-forum.com

 Hello everyone! I'm trying to use PAM in my application and found the
 gem of Authlogic and rpam. I could not install either the lack of
 information. Someone has managed to do it? Google's everywhere and found
 nothing. If you can help me I will be very grateful. Have a nice day.
 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 
tommy xiao
E-mail: xiaods(AT)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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problem about each in rails

2010-03-19 Thread Grick Zh
Michael Pavling wrote:
 On 18 March 2010 16:33, Grick Zh li...@ruby-forum.com wrote:
 %=h @posts.each {|p| p.name} %

 why this code return serial strings like #Post:0x3a893e8 ?
 
 Because you're outputting the return value of the whole loop, not the
 output of each block.
 If you run that command in your console, you will see it return an
 array of Posts; and that's what you're trying to render.

I got it,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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: undefined method error despite the fact it doesn't exist

2010-03-19 Thread Colin Law
On 19 March 2010 14:43, John Merlino li...@ruby-forum.com wrote:
 Billee D. wrote:
 Hi John,
 I would check your source code in app/views/resources/index.html.haml
 (or a view helper for that view) for a typo since it's looking for a
 method named something similar to what you have (e.g change
 render_index_row_action_pprove to render_index_row_action_approve)

 HTH



 I run the command find . -print | awk '{print \$0\}' | grep -v
 \.svn | xargs grep -i render_index_row_action_pprove

 and this is what I get:

 trunk/log/development.log:ActionView::TemplateError (undefined method
 `render_index_row_action_pprove' for #ActionView::Base:0x10c5ca938) on
 line #20 of app/views/resources/index.html.haml:

 So the only place the method appears is in the development log. When
 someone else downloaded a local copy from the repository, they got no
 such error. So either a modification needs to be made in the development
 log or there's nothing else it appears I can do. Thanks for the

Usually when I get an error shown in a haml file then somewhere (in
log or server window maybe) there will be a full trace which may
identify a line in a helper causing the problem.  I wonder if it some
unprintable character is causing the problem so your search does not
find it.

I presume you have checked that you have no locally modified files.
Also check that you have not got any extra files (backup files for
example) in views/resources or helper folders.  Rails has been known
to pick up backup files instead of the correct file.

What happens if you check out a new local copy from the repository?

Colin

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



[Rails] Re: Problem about each in rails

2010-03-19 Thread Grick Zh
Adam Stegman wrote:
 Or more concisely (because it's fun):
 %=h @posts.map(:name).to_sentence %
 which will make it Tom, Dick, and Harry.

I'm newbie,can't understand (:name),but i know this code is skillful.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problem about each in rails

2010-03-19 Thread Aldric Giacomoni
Grick Zh wrote:
 Adam Stegman wrote:
 Or more concisely (because it's fun):
 %=h @posts.map(:name).to_sentence %
 which will make it Tom, Dick, and Harry.
 

1) @posts.map
This will return a new enumerable, replacing each element of @posts with 
whatever the block says
2) :name
Shortcut to indicate a block and a method. In this case, the method is 
:name (post.name)

Other example: [1,2,3,4].inject(:+) # Sum every element of the array. 
Will of course fail if an element does not understand +.

3) to_sentence
We now have an array with names. to_sentence is, I believe, an 
activesupport method which joins the array into a string with commas, 
and adds and  between the second to last and last item.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Ruby on Rails tutorials for beginners are available here

2010-03-19 Thread pankaj
Hello Everyone,
 I have started my blog at http://railsguru.org.
 Besides other stuff on Rails, the main focus of the site will be to
help beginners to learn Ruby and Rails and build the fundamentals.

Regards,
Pankaj Bhageria,
Tech Lead,  Sumeru Software Solutions.
http://www.railsguru.org
http://www.sumeru.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] selective migrations possible?

2010-03-19 Thread Grary
Hi,

I prefer to keep one migration per model, but lately I'm adding data
that's expensive to drop every time I change my models.

How do I db:drop and db:migrate only selected tables/files? Basically,
I want to ignore certain tables and migrations altogether during
certain development phases.

Thanks,

Grar

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



[Rails] Re: Deprecations

2010-03-19 Thread Benoit Caccinolo
Thanks for the link. A good use of ack-grep on the rails gems:
rails-2.0.5
actionmailer-2.0.5
actionpack-2.0.5
activerecord-2.0.5
activeresource-2.0.5
activesupport-2.0.5

gave me what I was looking for.

B.

On Mar 10, 10:21 pm, Taywin tboon...@gmu.edu wrote:
 Not sure if you are looking for. Maybe the link below would be a bit
 of help.

 http://mentalized.net/journal/2007/03/13/rails_20_deprecations/

 On Mar 9, 3:42 am, Benoit Caccinolo benoit.caccin...@gmail.com
 wrote:

  Hi all,

  Is there a way to have a list of all deprecated methods or classes in
  each new versions of Rails? I know that a warning is logged sometimes,
  but I would like a proper list to analyze the deprecated parts of my
  code before running it.

  Thanks,
  Benoit Caccinolo

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



[Rails] Re: selective migrations possible?

2010-03-19 Thread Ar Chron
Grary wrote:
 Hi,
 
 I prefer to keep one migration per model, but lately I'm adding data
 that's expensive to drop every time I change my models.

So don't do that.  You've chosen to fight a (very) hard battle if that's 
the manner in which you are trying to use migrations.

Down the road, when you want to add a column to a table that has 100,000 
rows of data, you're going through a backup and restore for that table 
just so you can have a single migration file per table???

If it really is just a preference, as opposed to a hard-driven 
requirement, then embrace the multiple migrations convention.

 
 How do I db:drop and db:migrate only selected tables/files? Basically,
 I want to ignore certain tables and migrations altogether during
 certain development phases.
 

The weasely approach would be to leave all the migration files in place, 
and edit the contents of the migration files before you do any 
migrations, up or down.  If you don't want to perform a step, comment 
out all the business logic inside that migration file, leaving just a 
self.up (or self.down) that does nothing.  Sounds like a royal PITA to 
me.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: selective migrations possible?

2010-03-19 Thread Grary
OK.

Also, I was just thinking: if I create models and then, without a
migration, create corresponding tables, I have sidestepped the
problem, such as it is.

Anyway, I've registered your skepticism.

Thanks,

Grar

On Mar 19, 12:40 pm, Ar Chron li...@ruby-forum.com wrote:
 Grary wrote:
  Hi,

  I prefer to keep one migration per model, but lately I'm adding data
  that's expensive to drop every time I change my models.

 So don't do that.  You've chosen to fight a (very) hard battle if that's
 the manner in which you are trying to use migrations.

 Down the road, when you want to add a column to a table that has 100,000
 rows of data, you're going through a backup and restore for that table
 just so you can have a single migration file per table???

 If it really is just a preference, as opposed to a hard-driven
 requirement, then embrace the multiple migrations convention.



  How do I db:drop and db:migrate only selected tables/files? Basically,
  I want to ignore certain tables and migrations altogether during
  certain development phases.

 The weasely approach would be to leave all the migration files in place,
 and edit the contents of the migration files before you do any
 migrations, up or down.  If you don't want to perform a step, comment
 out all the business logic inside that migration file, leaving just a
 self.up (or self.down) that does nothing.  Sounds like a royal PITA to
 me.

 --
 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: selective migrations possible?

2010-03-19 Thread Grary
I've registered your skepticism.

Yes, I can't see that the benefit of satisfying my preference here
outweighs the burden.

That said, I still think it's a drag to sift through multiple
migration files.

Thanks,

Grar

On Mar 19, 12:40 pm, Ar Chron li...@ruby-forum.com wrote:
 Grary wrote:
  Hi,

  I prefer to keep one migration per model, but lately I'm adding data
  that's expensive to drop every time I change my models.

 So don't do that.  You've chosen to fight a (very) hard battle if that's
 the manner in which you are trying to use migrations.

 Down the road, when you want to add a column to a table that has 100,000
 rows of data, you're going through a backup and restore for that table
 just so you can have a single migration file per table???

 If it really is just a preference, as opposed to a hard-driven
 requirement, then embrace the multiple migrations convention.



  How do I db:drop and db:migrate only selected tables/files? Basically,
  I want to ignore certain tables and migrations altogether during
  certain development phases.

 The weasely approach would be to leave all the migration files in place,
 and edit the contents of the migration files before you do any
 migrations, up or down.  If you don't want to perform a step, comment
 out all the business logic inside that migration file, leaving just a
 self.up (or self.down) that does nothing.  Sounds like a royal PITA to
 me.

 --
 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] selective migrations possible?

2010-03-19 Thread Colin Law
On 19 March 2010 16:07, Grary grary.sti...@gmail.com wrote:
 Hi,

 I prefer to keep one migration per model, but lately I'm adding data
 that's expensive to drop every time I change my models.

It is considered a bad idea to seed data using migrations, if that is
what you are doing.  Google for rails migration seed for many
discussions on this issue, including on this list.  Perhaps this is
your fundamental problem.

Colin


 How do I db:drop and db:migrate only selected tables/files? Basically,
 I want to ignore certain tables and migrations altogether during
 certain development phases.

 Thanks,

 Grar

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



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



[Rails] Re: selective migrations possible?

2010-03-19 Thread Grary
Yes, I've certainly given the role of seed data due consideration in
another context, but it's not relevant in the case at hand, I don't
think. In that case at hand, the large data set I seek to include in
my development is used for autocompletion and by business logic on the
model side.

Thanks,

Grar

On Mar 19, 1:50 pm, Colin Law clan...@googlemail.com wrote:
 On 19 March 2010 16:07, Grary grary.sti...@gmail.com wrote:

  Hi,

  I prefer to keep one migration per model, but lately I'm adding data
  that's expensive to drop every time I change my models.

 It is considered a bad idea to seed data using migrations, if that is
 what you are doing.  Google for rails migration seed for many
 discussions on this issue, including on this list.  Perhaps this is
 your fundamental problem.

 Colin



  How do I db:drop and db:migrate only selected tables/files? Basically,
  I want to ignore certain tables and migrations altogether during
  certain development phases.

  Thanks,

  Grar

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

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



[Rails] auto_complete plugin on rails 2.3.5

2010-03-19 Thread Guido
Hi, this is my first post.

I have run:

$ ruby script/plugin -v install auto_complete

but the result is:

Plugin not found: [auto_complete]
#Errno::ENOENT: No such file or directory - /dev/null

I have also try to run:

$ ruby script/plugin -v list

and the result is:

Discovering plugins in http://dev.rubyonrails.com/svn/rails/plugins/
/CHANGELOG
/account_location/
/acts_as_list/
/acts_as_nested_set/
/acts_as_tree/
/atom_feed_helper/
/auto_complete/
/continuous_builder/
[...]

So, the auto_complete is there but it won't install.


Someone can help me?

Thanks.

Guido



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



[Rails] Regarding template installation and working.

2010-03-19 Thread Kamalesh Kumar
Hi All,

I have recently started working on Ruby on Rails and I am amazed with
the features it gives. I want to know how are templates installed on
Rails for web applications that we develop and also where are the
templates available.

Please help me out.

Regards,
Kamalesh

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



[Rails] How to save rails generated pages to a file on the server

2010-03-19 Thread Fritz Trapper
My show view of a data form is finished and now I want to give a
possibility to download this view as a pdf file.

I would like to use HTMLDOC to convert the html text to pdf. My idea:
save the html text to a temporary folder and run HTMLDOC.

But how can I save the html text to a file?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rails development processes running very slow

2010-03-19 Thread ChrisT
Either way it's slow. with the bundle locked or not.

On Mar 19, 8:27 am, Aldric Giacomoni li...@ruby-forum.com wrote:
 ChrisT wrote:

  My Gemfile:
   source 'http://gemcutter.org'
   source 'http://gems.github.com'
  gem gemcutter, 0.4.1

  # Rails3 beta
  gem rails, 3.0.0.beta

  # ActiveRecord requires a database adapter.
  gem ruby-mysql

  # Gems required for the AftershockHarness
  gem watir, 1.6.5
  gem firewatir, 1.6.5

 Okay.. Did you do 'bundler lock' ?
 (I am shooting blind here, I'm confused by the problem, but sometimes
 it's like playing broadsides.. start shooting and it starts making
 sense!).

 --
 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] How to save rails generated pages to a file on the server

2010-03-19 Thread Philip Hallstrom


On Mar 19, 2010, at 11:43 AM, Fritz Trapper wrote:


My show view of a data form is finished and now I want to give a
possibility to download this view as a pdf file.

I would like to use HTMLDOC to convert the html text to pdf. My idea:
save the html text to a temporary folder and run HTMLDOC.

But how can I save the html text to a file?


render_to_string

http://api.rubyonrails.org/classes/ActionController/Base.html#M000659

That puts it into a local variable anyway... if you can then pass that  
to htmldoc you're on your way.  Not sure how this might affect any  
paths to CSS/images for HTMLDOC though.



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



[Rails] Re: How to save rails generated pages to a file on the server

2010-03-19 Thread Fritz Trapper
Philip Hallstrom wrote:
 render_to_string
 
 http://api.rubyonrails.org/classes/ActionController/Base.html#M000659
 
 That puts it into a local variable anyway... if you can then pass that
 to htmldoc you're on your way.  Not sure how this might affect any
 paths to CSS/images for HTMLDOC though.

Thanks. CSS is no problem with HTMLDOC - it doesn't support it ;-)

Maybe, I need to find some alternative for HTMLDOC. My problem is, that 
I have a table with variable number of columns.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: How to save rails generated pages to a file on the server

2010-03-19 Thread Philip Hallstrom

render_to_string

http://api.rubyonrails.org/classes/ActionController/Base.html#M000659

That puts it into a local variable anyway... if you can then pass  
that

to htmldoc you're on your way.  Not sure how this might affect any
paths to CSS/images for HTMLDOC though.


Thanks. CSS is no problem with HTMLDOC - it doesn't support it ;-)

Maybe, I need to find some alternative for HTMLDOC. My problem is,  
that

I have a table with variable number of columns.


Prawn.  http://railscasts.com/episodes/153-pdfs-with-prawn

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



[Rails] Re: selective migrations possible?

2010-03-19 Thread Jeff Lewis
Hi Grar,

If you really want to call a single migration, you could do something
like:

$ ./script/console
...
 require #{RAILS_ROOT}/db/migrate/100_create_foos.rb
= [CreateFoos]

 CreateFoos.down
==  CreateFoos: reverting =
-- drop_table(:foos)
...

 ActiveRecord::Base.connection.tables.include?('foos')
= false

 CreateFoos.up
==  CreateFoos: migrating =
-- create_table(:foos)
...

 ActiveRecord::Base.connection.tables.include?('foos')
= true

And/or roll such calls into a runnable script and run it via runner:

$ cat ./script/migrate_foo.runnable
require #{RAILS_ROOT}/db/migrate/100_create_foos.rb
CreateFoos.down
CreateFoos.up

$ ./script/runner ./script/migrate_foo.runnable
...

Personally, I like to keep my migrations intact as well, one per
persistable model ob, unless I'm working on a project with a team that
doesn't.  This way it's easy for devs to see exactly what's defined at
that time in the db for a given model ob, without having to weed
through all the various modifying migrations related to some model ob,
or looking for such info in the development_structure.sql if
available, or having to fire up the console or an underlying db qry
tool to see that model ob's current db schema.

For all my projects, I usually dev a runnable re-init script that
contains all of the work (that I would typically call by hand)
required to put the env in the current valid working state: run
migrations, load any init data as required for the env, perform any
post-init processing of data, run tests, etc.

Whenever a new migration is added or an existing one is modified or
init data is added/modified, I just make one call to re-init the dev
env.  Note that the same holds true for pulling and re-init'ing some
version from svn/git/

When it comes to upgrading the production env for a new release that
requires db-related changes, I dev a runnable script per prod env
upgrade that performs the necessary work to upgrade the prod env to be
in line with that particular release: run pre-upgrade tests to see if
upgrade can/should be performed, run specific migrations and/or db
schema mods as applicable, load any data and/or perform any data
updates, run post-upgrade tests, etc.

Whenever a prod env upgrade needs to be performed, I dump the prod env
db as a pre-upgrade backup, run the upgrade script to pre-test the
prod env, upgrade the prod env, and post-test the prod env, and when
all is good, dump the db again as a post-upgrade backup.  (I usually
test each upgrade scripts against a similar version/state of the dev
env prior to performing the upgrade on the prod env, and once the
script's working as intended, then I just re-init the current dev
env.)  Having such prod env upgrade scripts (and related db dumps)
makes it equally easy to revert back to a specific state of the prod
env as well.

Jeff

On Mar 19, 11:22 am, Grary grary.sti...@gmail.com wrote:
 Yes, I've certainly given the role of seed data due consideration in
 another context, but it's not relevant in the case at hand, I don't
 think. In that case at hand, the large data set I seek to include in
 my development is used for autocompletion and by business logic on the
 model side.

 Thanks,

 Grar

 On Mar 19, 1:50 pm, Colin Law clan...@googlemail.com wrote:



  On 19 March 2010 16:07, Grary grary.sti...@gmail.com wrote:

   Hi,

   I prefer to keep one migration per model, but lately I'm adding data
   that's expensive to drop every time I change my models.

  It is considered a bad idea to seed data using migrations, if that is
  what you are doing.  Google for rails migration seed for many
  discussions on this issue, including on this list.  Perhaps this is
  your fundamental problem.

  Colin

   How do I db:drop and db:migrate only selected tables/files? Basically,
   I want to ignore certain tables and migrations altogether during
   certain development phases.

   Thanks,

   Grar

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

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



[Rails] How can I consume SOAP Web Service?

2010-03-19 Thread Jorge alejandro Mendoza torres
Please, I need to know the way to consume SOAP Web Service. I've seen
some examples but I don't understand how I can do it.

From the client side, I need to save the information into database.

Please, somebody answer.

I need your help.

Thanks and greetings.

Jorge Mendoza
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] convert app to production

2010-03-19 Thread John Wu
Hi,

How to change rails 2.3.5 app to production? I couldn't find
ENV[RAILS_ENV] under config/environment.rb

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How to save rails generated pages to a file on the server

2010-03-19 Thread Jeff Lewis
You might want to check out:

http://code.google.com/p/wkhtmltopdf/
http://www.princexml.com/

wkhtmltopdf is free.  prince will cost you.  prince has better css
print-related implementation coverage at this time, but wkhtmltopdf
can be a very good alternative depending on the needs of your project.

Jeff

On Mar 19, 12:54 pm, Fritz Trapper li...@ruby-forum.com wrote:
 Philip Hallstrom wrote:
  render_to_string

 http://api.rubyonrails.org/classes/ActionController/Base.html#M000659

  That puts it into a local variable anyway... if you can then pass that
  to htmldoc you're on your way.  Not sure how this might affect any
  paths to CSS/images for HTMLDOC though.

 Thanks. CSS is no problem with HTMLDOC - it doesn't support it ;-)

 Maybe, I need to find some alternative for HTMLDOC. My problem is, that
 I have a table with variable number of columns.
 --
 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: getting data from a through table

2010-03-19 Thread dan
thanks for the suggestions

attributes is a self inherited table
so i need to get them i order of top level and down
this is part of my current solution

has_many :objects_attributes do
def top_level
  all(:joins = :attribute, :conditions = attributes.parent_id
is null)
end

def children(id)
  all(:joins = :attribute, :conditions = [attributes.parent_id
= ?, id])
end
end

this allows me to access all fields in order desired
thanks for your help

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



[Rails] Re: Re: How to save rails generated pages to a file on the server

2010-03-19 Thread Fritz Trapper
Prawn seems to need a fixed number of columns in tables, so I'll take a 
look on wkhtmltopdf.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How can I consume SOAP Web Service?

2010-03-19 Thread Robert Walker
Jorge alejandro Mendoza torres wrote:
 Please, I need to know the way to consume SOAP Web Service. I've seen
 some examples but I don't understand how I can do it.
 

This is the only project I'm aware of still supporting SOAP in Rails:

http://github.com/datanoise/actionwebservice

I don't have any idea if it's all still working in the latest version of 
Rails, and I don't know if it's being moved forward to Rails 3.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Ruby on Rails tutorials for beginners are available here

2010-03-19 Thread Massimiliano Bertinetti
Good work!

Thanks!

Max-B

Il giorno ven, 19/03/2010 alle 08.52 -0700, pankaj ha scritto:
 Hello Everyone,
  I have started my blog at http://railsguru.org.
  Besides other stuff on Rails, the main focus of the site will be to
 help beginners to learn Ruby and Rails and build the fundamentals.
 
 Regards,
 Pankaj Bhageria,
 Tech Lead,  Sumeru Software Solutions.
 http://www.railsguru.org
 http://www.sumeru.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How can I consume SOAP Web Service?

2010-03-19 Thread Frederick Cheung


On Mar 19, 8:59 pm, Robert Walker li...@ruby-forum.com wrote:
 Jorge alejandro Mendoza torres wrote:

  Please, I need to know the way to consume SOAP Web Service. I've seen
  some examples but I don't understand how I can do it.

 This is the only project I'm aware of still supporting SOAP in Rails:

 http://github.com/datanoise/actionwebservice

 I don't have any idea if it's all still working in the latest version of
 Rails, and I don't know if it's being moved forward to Rails 3.

If you're just making soap requests you don't need actionwebservice -
I've used the soap libraries that ship as part of the ruby standard
libraries

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How to save rails generated pages to a file on the server

2010-03-19 Thread Jeff Lewis
Since I started using tools (like prince/wkhtmltopdf) to generate pdfs
from html/css for web app projects that need to gen pdfs, I've never
gone back to using low-level pdf-gen'ing libs/tools (like prawn).
Just requires so much less work.

By the way, you may also want to look into using http://www.accesspdf.com/pdftk/
in combination with wkhtmltopdf(/prince) in case you need to do any
post-processing of your gen'd pdfs (adding additional watermarks,
splitting out pdf pages, combining pdfs, ).

Jeff

On Mar 19, 1:45 pm, Fritz Trapper li...@ruby-forum.com wrote:
 Prawn seems to need a fixed number of columns in tables, so I'll take a
 look on wkhtmltopdf.
 --
 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: convert app to production

2010-03-19 Thread Robert Walker
John Wu wrote:
 How to change rails 2.3.5 app to production? I couldn't find
 ENV[RAILS_ENV] under config/environment.rb

That's been gone from config/environment.rb for quite a while now. It 
was never really the proper way to setup the environment anyway AFAIK.

What you'll want to do is setup your production server to default to 
production mode.

For information on how to do this using Phusion Passenger see:
http://www.modrails.com/documentation/Users%20guide%20Apache.html#rails_env

If you just want to run in production mode on your local box you can 
start script/server in production mode with:

./script/server -e production

See...
./script/server --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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: How can I consume SOAP Web Service?

2010-03-19 Thread Robert Walker
Frederick Cheung wrote:
 On Mar 19, 8:59�pm, Robert Walker li...@ruby-forum.com wrote:
 Rails, and I don't know if it's being moved forward to Rails 3.
 If you're just making soap requests you don't need actionwebservice -
 I've used the soap libraries that ship as part of the ruby standard
 libraries

Excellent point. 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] I18n and Rails 2.3.5

2010-03-19 Thread Rodrigo Felix
Has anybody faced any problem to use i18n on Rails 2.3.5? Sometimes when I
call the *t* function, it works fine, but for some keys, it does not work
and I have no clue why it is going on.

I do have a .yml with correct keys and values. For example, in this (
http://dev.promine.com.br/promine) page, i18n is working properly, but in
this (http://dev.promine.com.br/servicos) one, it isn't? Any suggestion
about what is happening? Thanks in advance.

*Rodrigo Felix*

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



[Rails] Preparing an Asynchronous Response with ActionController

2010-03-19 Thread Tom Shealy
Hello,

I was wondering if there's an easy way to make ActionController render a
response in an asynchronous background process.

I have a large object graph which takes over a minute to serialize in
amf:

render :amf = myData

I'd like to render() the amf serialization in a workling process and
store the results in memcache key'd by original msg-id so the client can
get the serialized result in a subsequent request.

Is there a simple way to perform the render() operation outside the
context of the controller?  Something like:

 MyController.new.render({:amf=myData})

(of course, render() is a protected method, so I can't do that.  And I'm
also not sure where to obtain the serialized result since render() is
void).


Thanks,

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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: no such file to load -- sqlite3 Rails

2010-03-19 Thread Rafael Giacon
Robert Huberdeau wrote:
 Ehtsham Abbas wrote:
 M. Figueiroa wrote:
 In my case I just downloaded the sqllite3.dll from the 
 http://www.sqlite.org/download.html (This is a DLL of the SQLite library 
 without the TCL bindings. The only external dependency is MSVCRT.DLL.) 
 and then copied it to the Windows\System32 folder. It worked.
 
 
 MY PROBLEM HAS BEEN RESOLVED ITS WORKING NOW im so very thankful to 
 you Figueiro
 
 For some reason this doesn't work for me. I moved the dll file into my 
 Windows\System32 folder and I get the same error.




try downloading the precompiled files from:
 http://www.sqlite.org/download.html

in windows you will need the
sqlite3.def, sqlite3.dll, sqlite3.exe.
 Save this files to the Ruby/bin directory,
then use the 'gem install sqlite3-ruby'
(you may get some definition error messages about the documentation but 
it shoud work anyways)
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: selective migrations possible?

2010-03-19 Thread Grary
Thanks Jeff. That's a lot to digest, but I will and likely try it,
too.

Grar

On Mar 19, 4:03 pm, Jeff Lewis jeff.bu...@gmail.com wrote:
 Hi Grar,

 If you really want to call a single migration, you could do something
 like:

 $ ./script/console
 ... require #{RAILS_ROOT}/db/migrate/100_create_foos.rb

 = [CreateFoos]

  CreateFoos.down

 ==  CreateFoos: reverting =
 -- drop_table(:foos)
 ...

  ActiveRecord::Base.connection.tables.include?('foos')

 = false

  CreateFoos.up

 ==  CreateFoos: migrating =
 -- create_table(:foos)
 ...

  ActiveRecord::Base.connection.tables.include?('foos')

 = true

 And/or roll such calls into a runnable script and run it via runner:

 $ cat ./script/migrate_foo.runnable
 require #{RAILS_ROOT}/db/migrate/100_create_foos.rb
 CreateFoos.down
 CreateFoos.up

 $ ./script/runner ./script/migrate_foo.runnable
 ...

 Personally, I like to keep my migrations intact as well, one per
 persistable model ob, unless I'm working on a project with a team that
 doesn't.  This way it's easy for devs to see exactly what's defined at
 that time in the db for a given model ob, without having to weed
 through all the various modifying migrations related to some model ob,
 or looking for such info in the development_structure.sql if
 available, or having to fire up the console or an underlying db qry
 tool to see that model ob's current db schema.

 For all my projects, I usually dev a runnable re-init script that
 contains all of the work (that I would typically call by hand)
 required to put the env in the current valid working state: run
 migrations, load any init data as required for the env, perform any
 post-init processing of data, run tests, etc.

 Whenever a new migration is added or an existing one is modified or
 init data is added/modified, I just make one call to re-init the dev
 env.  Note that the same holds true for pulling and re-init'ing some
 version from svn/git/

 When it comes to upgrading the production env for a new release that
 requires db-related changes, I dev a runnable script per prod env
 upgrade that performs the necessary work to upgrade the prod env to be
 in line with that particular release: run pre-upgrade tests to see if
 upgrade can/should be performed, run specific migrations and/or db
 schema mods as applicable, load any data and/or perform any data
 updates, run post-upgrade tests, etc.

 Whenever a prod env upgrade needs to be performed, I dump the prod env
 db as a pre-upgrade backup, run the upgrade script to pre-test the
 prod env, upgrade the prod env, and post-test the prod env, and when
 all is good, dump the db again as a post-upgrade backup.  (I usually
 test each upgrade scripts against a similar version/state of the dev
 env prior to performing the upgrade on the prod env, and once the
 script's working as intended, then I just re-init the current dev
 env.)  Having such prod env upgrade scripts (and related db dumps)
 makes it equally easy to revert back to a specific state of the prod
 env as well.

 Jeff

 On Mar 19, 11:22 am, Grary grary.sti...@gmail.com wrote:

  Yes, I've certainly given the role of seed data due consideration in
  another context, but it's not relevant in the case at hand, I don't
  think. In that case at hand, the large data set I seek to include in
  my development is used for autocompletion and by business logic on the
  model side.

  Thanks,

  Grar

  On Mar 19, 1:50 pm, Colin Law clan...@googlemail.com wrote:

   On 19 March 2010 16:07, Grary grary.sti...@gmail.com wrote:

Hi,

I prefer to keep one migration per model, but lately I'm adding data
that's expensive to drop every time I change my models.

   It is considered a bad idea to seed data using migrations, if that is
   what you are doing.  Google for rails migration seed for many
   discussions on this issue, including on this list.  Perhaps this is
   your fundamental problem.

   Colin

How do I db:drop and db:migrate only selected tables/files? Basically,
I want to ignore certain tables and migrations altogether during
certain development phases.

Thanks,

Grar

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

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



[Rails] Envoi de SMS

2010-03-19 Thread Fernando Perez
Bonjour,

Quelqu'un envoie des sms à partir de son application? Vous avez des
fournisseurs à conseiller. Le plus simple c'est d'envoyer à partir d'un
email puis le fournisseur transforme ça en sms.

Niveau tarif ça va du simple au triple apparement.

Merci pour vos suggestions
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rail Quickstart Guide: Always receiving template missing errors.

2010-03-19 Thread Stone
Thanks for your time. I'm almost sure there is no typo on my part. I'm
actually starting to think there's something wrong with the
environment as I have created small ror apps before without any issues
and am somewhat experiences w/ rails. Having gone through the rails
quickstart guide again, I have the same issue w/ home controller.

home_controller.rb --
class HomeController  ApplicationController
  def index
  end
end

routes.rb -
ActionController::Routing::Routes.draw do |map|
  # The priority is based upon order of creation: first created -
highest priority.
  map.connect 'home/index', :controller = 'home', :action = 'index'

  # Sample of regular route:
  #   map.connect 'products/:id', :controller = 'catalog', :action =
'view'
  # Keep in mind you can assign values other than :controller
and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller =
'catalog', :action = 'purchase'
  # This route can be invoked with purchase_url(:id = product.id)

  # Sample resource route (maps HTTP verbs to controller actions
automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member = { :short = :get, :toggle
= :post }, :collection = { :sold = :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many =
[ :comments, :sales ], :has_one = :seller

  # Sample resource route with more complex sub-resources
  #   map.resources :products do |products|
  # products.resources :comments
  # products.resources :sales, :collection = { :recent = :get }
  #   end

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  # # Directs /admin/products/* to Admin::ProductsController (app/
controllers/admin/products_controller.rb)
  # admin.resources :products
  #   end

  # You can have the root of your site routed with map.root -- just
remember to delete public/index.html.
  # map.root :controller = welcome

  # See how all your routes lay out with rake routes

  # Install the default routes as the lowest priority.
  # Note: These default routes make all actions in every controller
accessible via GET requests. You should
  # consider removing or commenting them out if you're using named
routes and resources.
  map.root :controller = home
end


index.html.erb -
h1Home#index/h1
pFind me in app/views/home/index.html.erb/p

Again, I am following the rails quickstart guide for 2.3 verbatim and
still receiving this error:
Processing HomeController#index (for 127.0.0.1 at 2010-03-19
15:42:14) [GET]
ActionView::MissingTemplate (Missing template home/index.erb in view
path app/views):
Rendering rescues/layout (internal_server_error)

Any help greatly appreciated
Thanks,
Stone





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



[Rails] Re: Envoi de SMS

2010-03-19 Thread Fernando Perez
Fernando Perez wrote:
 Bonjour,
 
 Quelqu'un envoie des sms à partir de son application? Vous avez des
 fournisseurs à conseiller. Le plus simple c'est d'envoyer à partir d'un
 email puis le fournisseur transforme ça en sms.
 
 Niveau tarif ça va du simple au triple apparement.
 
 Merci pour vos suggestions
My bad, this message was intended to the french list.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: selective migrations possible?

2010-03-19 Thread Fernando Perez

 I prefer to keep one migration per model
It's a bad an unmaintainable idea. I did that when I was a beginner in 
RoR.

Simply create migrations to add/remove columns to existing tables. When 
you have too many migration files, simply remove them. The whole schema 
is saved in schema.rb
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: auto_complete plugin on rails 2.3.5

2010-03-19 Thread Fernando Perez

 Someone can help me?
Just grab it from github and drop it in vendor/plugins, there is no 
special install step to run.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rails + Mysql

2010-03-19 Thread José Luis Romero
*mysql --version
mysql  Ver 14.14 Distrib 5.1.44, for redhat-linux-gnu (i386) using
readline 5.1

*rails -v
Rails 2.3.5


On Mar 19, 4:19 am, Yudi Soesanto soesa...@gmail.com wrote:
 Jose,

 What rails version and mysql version are you using?
 Do this:
 *rails -v*
 *mysql --version*

 I have the same issue as your after I upgraded to rails 2.2.2 and finally, I
 got it work
 What I did, I reinstall mysql and it worked ok now.

 Yudi Soesanto

 2010/3/18 José Luis Romero tangu...@gmail.com

  On Mar 18, 12:36 am, Conrad Taylor conra...@gmail.com wrote:
   José, can you verify that MySQL is running by doing the following:

   $ mysql -uusername

  Yes it's running...

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

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



[Rails] current_user Authlogic Service.rb

2010-03-19 Thread Liquid Fury
Hi,

I am using Authlogic  Weborb to remote from as3.

Is it possible to access current_user, which is defined in a helper
method in the application controller, in a Service class.

Thank you in advance,

John.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Rails + Mysql

2010-03-19 Thread Yudi Soesanto
Jose,

Uninstall gem mysql first (*sudo gem uninstall mysql*) and then install it
again with this command:

$ sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

*for reference:*
Check on this link http://wiki.rubyonrails.org/database-support/mysql, maybe
it can help.

If it still doesn't work, try to reinstall mysql server.

Good luck,

Yudi Soesanto


2010/3/20 José Luis Romero tangu...@gmail.com

 *mysql --version
 mysql  Ver 14.14 Distrib 5.1.44, for redhat-linux-gnu (i386) using
 readline 5.1

 *rails -v
 Rails 2.3.5


 On Mar 19, 4:19 am, Yudi Soesanto soesa...@gmail.com wrote:
  Jose,
 
  What rails version and mysql version are you using?
  Do this:
  *rails -v*
  *mysql --version*
 
  I have the same issue as your after I upgraded to rails 2.2.2 and
 finally, I
  got it work
  What I did, I reinstall mysql and it worked ok now.
 
  Yudi Soesanto
 
  2010/3/18 José Luis Romero tangu...@gmail.com
 
   On Mar 18, 12:36 am, Conrad Taylor conra...@gmail.com wrote:
José, can you verify that MySQL is running by doing the following:
 
$ mysql -uusername
 
   Yes it's running...
 
   --
   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.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 rubyonrails-talk%2bunsubscr...@googlegroups.comrubyonrails-talk%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/rubyonrails-talk?hl=en.

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



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



  1   2   >