[Rails] Re: Problem with Rails 3 rails server -d

2010-11-15 Thread Marcin Seroczynski
Wouldn't it be easier to move this to config/initializers/
your_file.rb ?

Therefore Your file would be automatically loaded every time when You
fire up an rails server.

On 14 Lis, 21:07, mr mathias.rich...@gmail.com wrote:
 In my app controller I require a file named configuration.rb in the
 config directory like so

 require config/configuration

 This has been working perfectly fine in Rails 2 in all environments
 including prod. Having migrated to Rails 3 this works in all
 environments if I run rails server without the daemon option. If I
 run the server with the daemon option (-d), I get the following error:

 no such file to load -- config/configuration

 I have tried various things including  changing the require to:

 require Rails.root.join(config/configuration)

 But that only changes the error message to:

 Missing helper file helpers/config/configuration.rb

 Any help would be appreciated.

 Thanks

 Mathias

-- 
You received 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] Rails string formatting

2010-11-15 Thread Alex P
Hi,

I have a helper that include JS file contents into my view (for per-
view JS injections).

For some reason   (render :file = inject/#{filename}.js) %
[ foo ]
combined with string formatting, assuming there's a replacement
pattern %s in {filename}.js, replaces all double quotes that were met
in {filename}.js to quot;

It doesn't escape single quotes, and doesn't even escape double quotes
when using no replacement pattern.

I'm also using haml concat, but I just covered it with a spec, and
everything looks nice, so it's apparently not a haml bug:
assert_equal(foo \foobar\ bar\n, render(- haml_concat('foo \\
\%s\\\ bar' % [ \foobar\ ])))

And it's not pure Ruby issue, which I checked too.

Is there some mechanism in Rails that may force symbols to be HTML-
encoded in case of replacement? It may also be a bug.
Thank you!

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-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] Gems in ~/.gem vs in the Library

2010-11-15 Thread Wojtek Galaj
Hello all,

I am completely new to Ruby on Rails.

When i install gems some of them
get installed to ~/.gem folder as apparently the other location is not
writable.

What is the best way to go about this: chmod the folder in Library,
let gems go to ~/.gem, sudo install gems always? What do you guys use?

Thanks in advance,
Wojtek

-- 
You received 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] Question re assert_equal

2010-11-15 Thread 24z
In Agile Web Development with Rails, the following statement is given:

assert_equal has already been taken, product.errors[:title].join(';
')

My question is: Why is the join(...) needed and what exactly does it
do here?

If it does what I assume, join an array of strings and use ;  as the
separator, then I wonder how the assert_equal statement could ever
evaluate to true as the first parameter is a static string without ;


Can you shed some light for me?

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-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] Authlogic and rails 3 : NameError in User sessionsController#new

2010-11-15 Thread Romain Biard
Hi everybody,

I've installed Authlogic on Rails 3 following the Railscast (http://
railscasts.com/episodes/160-authlogic), and the resources I was able
to find on the web, but I'm facing a problem.

Once I've generated the user_sessions controller and mapped the login
and logout routes, I get an error if I try to load the login page :
uninitialized constant UserSessionsController::UserSession
app/controllers/user_sessions_controller.rb:11:in `new'

The user_sessions model is really simple :
class UserSession  Authlogic::Session::Base
end

But it looks like this class declaration is not considered by Rails...

Does anyone have an idea ?

Thx by advance for your help.
Romain

-- 
You received 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] No route matches controller - scaffold generated code

2010-11-15 Thread bobtr
I am new to RoR, but I have been struggling with a mysterious error
for days.  I am using a standard installation approach on a clean
ubuntu system

I created a very simple application, just reading from a mysql table
called dogs.  The application was totally generated with scaffold.

rails server -p 3001   #Starts server

When I run, I get the error No route matches controller
   http://localhost:3001/dogs

If I remove all the link_to cells, the application runs and returns
data.

If I put back just one line td%= link_to 'Show', dog %/td,

 I still get the error complaining about the  :action=destroy
route.


== scaffold ==

rails g scaffold dog dog_id:integer color:string gender:string
dog_name:string --skip-migration


===Generated Source Code=

% @dogs.each do |dog| %
  tr
td%= dog.dog_id %/td
td%= dog.color %/td
td%= dog.gender %/td
td%= dog.dog_name %/td
td%= link_to 'Show', dog %/td
td%= link_to 'Edit', edit_dog_path(dog) %/td
td%= link_to 'Destroy', dog, :confirm = 'Are you
sure?', :method = :delete %/td
  /tr
% end %

= ERROR ===
## No route matches controller 
Showing /home/ruby/hub2/app/views/dogs/index.html.erb where line #20
raised:
No route matches {:controller=dogs, :action=destroy, :id=#Dog
dog_id: 1, color: Golden, gender: Female, dog_name: Daisy}

Extracted source (around line #20):

17: td%= dog.color %/td
18: td%= dog.gender %/td
19: td%= dog.dog_name %/td
20: td%= link_to 'Show', dog %/td
21: td%= link_to 'Edit', edit_dog_path(dog) %/td
22: td%= link_to 'Destroy', dog, :confirm = 'Are you
sure?', :method = :delete %/td
23:   /tr

== routes.rb   ==
Hub2::Application.routes.draw do
  resources :dogs
end


= rake routes 
r...@ubu-bob:/home/ruby/hub2# rake routes
(in /home/ruby/hub2)
dogs GET/dogs(.:format)
{:controller=dogs, :action=index}
dogs POST   /dogs(.:format)
{:controller=dogs, :action=create}
 new_dog GET/dogs/new(.:format)
{:controller=dogs, :action=new}
edit_dog GET/dogs/:id/edit(.:format)
{:controller=dogs, :action=edit}
 dog GET/dogs/:id(.:format)
{:controller=dogs, :action=show}
 dog PUT/dogs/:id(.:format)
{:controller=dogs, :action=update}
 dog DELETE /dogs/:id(.:format)
{:controller=dogs, :action=destroy}


=== Installation ===
 I followed these instructions on a brand new and fully updated
version of ubuntu 10.04

 
http://castilho.biz/blog/2010/05/08/how-to-install-ruby-on-rails-on-ubuntu-10-04-lucid-lynx/
 How to install Ruby on Rails on Ubuntu 10.04 Lucid Lynx
Follow these steps to have a fresh installation of Ruby on Rails
in Ubuntu 10.04:

  sudo su
  apt-get -y install build-essential
  apt-get -y install ruby rdoc libopenssl-ruby
  wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
  tar zxvf rubygems-1.3.7.tgz
  cd rubygems-1.3.7
  ruby setup.rb
  ln -s /usr/bin/gem1.8 /usr/local/bin/gem
  gem install rails  ;# (takes awhile with no output.. )

#Installing MySQL gem:

  apt-get -y install ruby-dev libmysql-ruby libmysqlclient-dev
  gem install mysql

==

-- 
You received 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: Question re assert_equal

2010-11-15 Thread Frederick Cheung


On Nov 14, 9:48 pm, 24z r...@grandcentrix.com wrote:
 In Agile Web Development with Rails, the following statement is given:

 assert_equal has already been taken, product.errors[:title].join(';
 ')

 My question is: Why is the join(...) needed and what exactly does it
 do here?

 If it does what I assume, join an array of strings and use ;  as the
 separator, then I wonder how the assert_equal statement could ever
 evaluate to true as the first parameter is a static string without ;
 

 Can you shed some light for me?

If there is only supposed to be one error on title  (ie the
errors[:title] contains a single string) then join will just return
that string. Hard to say without knowing the wider context, but this
seems a fairly succinct way of saying that there should only be one
error for the title attribute and that it should be the one that comes
from the uniqueness validation.

Fred

-- 
You received 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 an exe to Rails app

2010-11-15 Thread Frederick Cheung


On Nov 15, 2:50 am, David Kahn d...@structuralartistry.com wrote:
 I have been hacking around with this for a bit but want to see if there is
 an easy way:

 I am using Heroku and I have the wkhtmltopdf static binary in:
 rails_root/vendor/wkhtmltopdf

 I am not using any plug ins for wkhtmltopdf, just the executable, on purpose
 and want to keep it this way.

 My code wants to execute wkhtmltopdf:

     # tell wkhtmltopdf to convert html file to pdf
     %x[wkhtmltopdf-amd64 #{html_path} #{new_pdf_path}]

 But it is not found... is there a way I can tell my rails app to look in
 vendor/wkhtmltopdf for the exe?

Easiest thing is probably to construct the full path to your binary
rather than relying on what may or may not be in $PATH

Fred

-- 
You received 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: Urgent + Validations

2010-11-15 Thread Frederick Cheung


On Nov 15, 5:12 am, Hemant Bhargava li...@ruby-forum.com wrote:
 Hello,

 I am saving/updating same object on different pages with some
 validations. On first page, I save my object and on 2nd, 3rd, 4th pages
 i update the same object. So at first page i am using
 validates_inclusion_of :in = [] etc, and in second page(updating), i am
 using validates_presence_of :abc, :on = [:update]. But while i update
 on 3rd page also, i need some validations but i can not find out which
 function should i use.
 If i use validates_presence_of .. then this validations is reflecting on
 save page, And if i use validates_presence_of :on = [:update] then that
 is reflecting on update page. so i am in a bit of dilemma that what
 should i use.

The :if options to the various validations allows you to specify your
own logic as to which validations should run given the state of the
object.

Fred

 Thanks in advance.

 --
 Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-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] Using geokit-rails3 and getting Unknown key(s): bounds

2010-11-15 Thread Fredrik TiC Jansson
Hello posted this question in the Geokit group but there seems to be
very little activity in that forum som i will try here instead.

No on to my little problem

class IntrestPoint  ActiveRecord::Base
  acts_as_mappable :default_units = :kilometers,
   :lat_column_name = :lattitude,
   :lng_column_name = :longitude,
   :auto_geocode = {:field = :address, :error =
'could not geocode adress'}
end

i have set up a class like this, now if i enter an adress in my rails
app it gets
correctly geocoded into long and lat so far so god.

But when i try to query for  a certain bounds like this

def get_intrest_points_within_bounds
 @sw_point__=params[:sw_point]
 @ne_point_ =params[:ne_point]
 @intrest_point =
IntrestPoint.find(:all,:bounds=[:sw_point_,:ne_point_])
 respond_to do |format|
   format.html
   format.xml {render :xml = @intrest_point}
   format.json {render :json = @intrest_point}
 end
end

all i get is an ActionController Exeption Unknown key(s): bounds
all my parameters in the url seem to be fine

{get_intrest_points_within_bounds=get_intrest_points_within_bounds,
 ne_point=59.759162,
16.777496,
 sw_point=59.470199,
16.338043}

the same goes for :within so im guessing something is not included the
way it should be which brings me to my next question i have seen some
tutorials state that you should have the line include Geokit::Mappable
but where do i put this line ? or is it something that is deprecated
since rails3 ?( my best guess is that the include should be in my
IntrestPoint model but act_as_mappable and reverse geocoding seems to
work even if i dont put include anywhere)

totally new to the web world here so mabey i am missing something
really simple (i am a c/c++ programmer mainly with some obj-c latley)

-- 
You received 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 get lightbox on mouse over of the link in rails

2010-11-15 Thread Aruna Chinnamuthu
Hi ,

 i am very new to ROR


How to a mouse over light box thing in this link_to .

I tried by getting a lightbox on Click of a button by

 %= pop_up @blog %

 where i added a action in blogs controller
def pop_up
  render :partial = 'shared/pop_up', :layout = false, :locals =
{:node = @blog}
end

and a action pop_up in aplication_helper

and kept a pop_up file under shared folder.

The above thing works fine on click of the button


How to get the same lightbox thing on mouse over of the link
 %= link_to User, @blog.user %

-- 
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] Filter records by dates occurring this year

2010-11-15 Thread Erol Fornoles
On Mon, Nov 15, 2010 at 11:35 AM, KT mal...@gmail.com wrote:

 Hi all...

 I'm trying to create a named_scope for people who were born this
 year.  I have an application helper method defining current_year.

 So far, I have this, but it's not filtering correctly.  I think I need
 a BETWEEN, maybe?  I know this is something easy I'm just not
 seeing... any help is appreciated!

 class Person  ActiveRecord::Base
 :named_scope  :born_this_year, :conditions = {:dob = :current_year}
 end


Assuming your :dob is a date

Try :conditions = ['dob BETWEEN ? AND ?', Date.today.beginning_of_year,
Date.today.end_of_year]

-- 
Erol M. Fornoles
http://github.com/Erol
http://twitter.com/erolfornoles
http://ph.linkedin.com/in/erolfornoles

-- 
You received 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] Filter records by dates occurring this year

2010-11-15 Thread Erol Fornoles
On Mon, Nov 15, 2010 at 6:24 PM, Erol Fornoles erol.forno...@gmail.comwrote:

 Assuming your :dob is a date

 Try :conditions = ['dob BETWEEN ? AND ?', Date.today.beginning_of_year,
 Date.today.end_of_year]


Wait let me correct that, but first, is :current_year a field or column in
your table or a parameter that was meant to be passed to the named_scope?

-- 
Erol M. Fornoles
http://github.com/Erol
http://twitter.com/erolfornoles
http://ph.linkedin.com/in/erolfornoles

-- 
You received 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] SQLServer 2008 and Windows XP

2010-11-15 Thread Magnus D.
I'm trying to connct to an MSSQLserver 2008 on a WinXP box.

$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]

$ rails --version
Rails 3.0.1

$ gem list --local

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.1, 3.0.0)
actionpack (3.0.1, 3.0.0)
activemodel (3.0.1, 3.0.0)
activerecord (3.0.1)
activerecord-sqlserver-adapter (3.0.5)
activeresource (3.0.1, 3.0.0)
activesupport (3.0.1, 3.0.0, 1.4.4)
arel (2.0.2, 1.0.1)
builder (2.1.2)
bundler (1.0.3)
cgi_multipart_eof_fix (2.5.0)
dbi (0.4.5)
deprecated (3.0.0, 2.0.1)
erubis (2.6.6)
fastthread (1.0.1 i386-mswin32)
gem_plugin (0.2.3)
i18n (0.4.2, 0.4.1)
linecache (0.43 mswin32)
mail (2.2.9, 2.2.7)
mime-types (1.16)
mongrel (1.1.5 x86-mingw32)
mongrel_service (0.4.beta3)
mysql (2.8.1 x86-mingw32, 2.7.3 mswin32)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.1)
railties (3.0.1, 3.0.0)
rake (0.8.7)
rdiscount (1.6.5)
ruby-debug-base (0.10.3 mswin32)
ruby-debug-ide (0.4.5)
ruby-odbc (0.2)
sqlite3-ruby (1.3.2 x86-mingw32, 1.3.1 x86-mingw32)
thor (0.14.4, 0.14.3)
treetop (1.4.8)
tzinfo (0.3.23)


database.yml
development:
  adapter: sqlserver
  database: m_development
  dsn: M2
  mode: odbc
  username: user
  password: Secret
  encoding: utf8


Every time I run rails generate scaffold Something, I get an error like
this one:

$ rails generate scaffold Test
  invoke  active_record
c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in
`establish_connection': Please install
the sqlserver adapter: `gem install activerecord-sqlserver-adapter` (no
such file to load --
active_record/connection_adapters/sqlserver_adapter) (RuntimeError)
from
c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in
`establish_connection'
from
c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in
`establish_connection'

If I look in connection_specification.rb around line 71 I see this:

begin
require
active_record/connection_adapters/#{spec[:adapter]}_adapter
  rescue LoadError
raise Please install the #{spec[:adapter]} adapter: `gem
install activerecord-#{spec[:adapter]}-adapter` (#{$!})
  end

Some debugging tells me that spec[:adapter] contains the sqlserver
from the database.yml file. But I have, as you can see from the list of
installed gems, already installed the SQLServer Adapter, so why can't it
be found?

I have tried to run gem install activerecord-sqlserver-adapter more than
once, but that doesn't help, and I can find the gem in WindowsExplorer
in
C:\Ruby\lib\ruby\gems\1.8\gems\activerecord-sqlserver-adapter-3.0.5\lib\active_record\connection_adapters

Is it a problem with GEM_HOME or do I use a wrong version of rails?


Thanks

Magnus

-- 
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] Authlogic and rails 3 : NameError in User sessionsController#new

2010-11-15 Thread Fidel Viegas
On 11/15/10, Romain Biard romain.bi...@gmail.com wrote:
 Hi everybody,

 I've installed Authlogic on Rails 3 following the Railscast (http://
 railscasts.com/episodes/160-authlogic), and the resources I was able
 to find on the web, but I'm facing a problem.

 Once I've generated the user_sessions controller and mapped the login
 and logout routes, I get an error if I try to load the login page :
 uninitialized constant UserSessionsController::UserSession
 app/controllers/user_sessions_controller.rb:11:in `new'

 The user_sessions model is really simple :
 class UserSession  Authlogic::Session::Base
 end

 But it looks like this class declaration is not considered by Rails...

 Does anyone have an idea ?

 Thx by advance for your help.
 Romain


Hi Romain,

Have a look at this link http://www.dixis.com/?p=352 on how to setup
authlogic with rails 3. I have had a similar problem, and after
following that tutorial, I managed to resolve my problem.

I do get a few deprecation warnings, but overall it has been working ok.

Hope that helps.

Regards,

Fidel.

-- 
You received 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 with Rails 3 rails server -d

2010-11-15 Thread mr
Thanks for your answer. The option of moving this source file
somewhere Rails 3 will find it is kind of a last resort for me.

What gets me with this issue is that without the daemon option this
works (the required file is found) whereas with the daemon option it
doesn't work...

On 15 Nov., 09:11, Marcin Seroczynski sere...@gmail.com wrote:
 Wouldn't it be easier to move this to config/initializers/
 your_file.rb ?

 Therefore Your file would be automatically loaded every time when You
 fire up an rails server.

 On 14 Lis, 21:07, mr mathias.rich...@gmail.com wrote:

  In my app controller I require a file named configuration.rb in the
  config directory like so

  require config/configuration

  This has been working perfectly fine in Rails 2 in all environments
  including prod. Having migrated to Rails 3 this works in all
  environments if I run rails server without the daemon option. If I
  run the server with the daemon option (-d), I get the following error:

  no such file to load -- config/configuration

  I have tried various things including  changing the require to:

  require Rails.root.join(config/configuration)

  But that only changes the error message to:

  Missing helper file helpers/config/configuration.rb

  Any help would be appreciated.

  Thanks

  Mathias

-- 
You received 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] Webrick Configuration

2010-11-15 Thread PalaniKannan K
Hi

I am using webrick server for my application in ~/sample. For every boot of
computer, i need to start the webrick server in ~/sample. Kindly anyone help
me to start up the webrick server at the initial boot of computer with
specified port as automated startup.

-- 
With Regards,
Palani Kannan. K,

-- 
You received 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] Installing rmagick gem with RVM

2010-11-15 Thread Dries Steenhouwer
Hello,

I start using RVM for using Rails 3 and Rails 2 for some applications.
At the moment I can't install the rmagick gem in the new Ruby
environment.

I use Mac OSX and I installed already imagemagick via ports and this was
working before using RVM, I succeed also to install the rmagick gem
before installing RVM.

Here is the output of the install command :

http://pastie.org/1299253

Can somebody help me further with this problem?

Greets,
Dries

-- 
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] Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread rails.n...@gmail.com
Hey there

I find it frustrating that my rails helps do not reload in development
mode

Any changes I make to a model are immediately reflected, but helper
changes require a server restart

Does anyone know a work around?

cheers

-- 
You received 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] Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread radhames brito
Helper definition is loaded on application load, but the evaluation is done
on every request , which are you talking about ?

-- 
You received 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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread rails.n...@gmail.com

If I define helpy in my application_helper.rb file:

def helpy
  return something
end

... and then change the return value between page refreshes, it is not
updated I just get the original method definition loaded when
webrick server started




On Nov 15, 11:00 pm, radhames brito rbri...@gmail.com wrote:
 Helper definition is loaded on application load, but the evaluation is done
 on every request , which are you talking about ?

-- 
You received 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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread rails.n...@gmail.com
Thanks for replying, btw

Is there a hack I can do to cause it to reload the definition on every
request?

-- 
You received 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: Authlogic and rails 3 : NameError in User sessionsController#new

2010-11-15 Thread Frederick Cheung


On Nov 14, 11:13 pm, Romain Biard romain.bi...@gmail.com wrote:
 Hi everybody,

 I've installed Authlogic on Rails 3 following the Railscast (http://
 railscasts.com/episodes/160-authlogic), and the resources I was able
 to find on the web, but I'm facing a problem.

 Once I've generated the user_sessions controller and mapped the login
 and logout routes, I get an error if I try to load the login page :
 uninitialized constant UserSessionsController::UserSession
 app/controllers/user_sessions_controller.rb:11:in `new'

 The user_sessions model is really simple :
 class UserSession  Authlogic::Session::Base
 end

 But it looks like this class declaration is not considered by Rails...

Where is that file? is it in user_session.rb somewhere on the loadpath
(not user_sessions.rb)

Fred

 Does anyone have an idea ?

 Thx by advance for your help.
 Romain

-- 
You received 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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread Frederick Cheung


On Nov 15, 12:07 pm, rails.n...@gmail.com rails.n...@gmail.com
wrote:
 If I define helpy in my application_helper.rb file:

 def helpy
   return something
 end

 ... and then change the return value between page refreshes, it is not
 updated I just get the original method definition loaded when
 webrick server started


i've never noticed that before. What version of rails are you running?
Are you explicitly requiring any of your helper files?

fred
 On Nov 15, 11:00 pm, radhames brito rbri...@gmail.com wrote:



  Helper definition is loaded on application load, but the evaluation is done
  on every request , which are you talking about ?

-- 
You received 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: Authlogic and rails 3 : NameError in User sessionsController#new

2010-11-15 Thread Romain Biard
Thx Fidel,

I'll have a look at this tutorial.

Romain

On 15 nov, 11:39, Fidel Viegas fidel.vie...@gmail.com wrote:
 On 11/15/10, Romain Biard romain.bi...@gmail.com wrote:









  Hi everybody,

  I've installed Authlogic on Rails 3 following the Railscast (http://
  railscasts.com/episodes/160-authlogic), and the resources I was able
  to find on the web, but I'm facing a problem.

  Once I've generated the user_sessions controller and mapped the login
  and logout routes, I get an error if I try to load the login page :
  uninitialized constant UserSessionsController::UserSession
  app/controllers/user_sessions_controller.rb:11:in `new'

  The user_sessions model is really simple :
  class UserSession  Authlogic::Session::Base
  end

  But it looks like this class declaration is not considered by Rails...

  Does anyone have an idea ?

  Thx by advance for your help.
  Romain

 Hi Romain,

 Have a look at this linkhttp://www.dixis.com/?p=352on how to setup
 authlogic with rails 3. I have had a similar problem, and after
 following that tutorial, I managed to resolve my problem.

 I do get a few deprecation warnings, but overall it has been working ok.

 Hope that helps.

 Regards,

 Fidel.

-- 
You received 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: Authlogic and rails 3 : NameError in User sessionsController#new

2010-11-15 Thread Romain Biard
Yes it is, but in my setup it is user_sessions.rb with an s. It
seems to me (but I'm a RoR newbie) that controller files should have
an s...
Can you tell me more on that ?
Thx
Romain

On 15 nov, 13:18, Frederick Cheung frederick.che...@gmail.com wrote:
 On Nov 14, 11:13 pm, Romain Biard romain.bi...@gmail.com wrote:







  Hi everybody,

  I've installed Authlogic on Rails 3 following the Railscast (http://
  railscasts.com/episodes/160-authlogic), and the resources I was able
  to find on the web, but I'm facing a problem.

  Once I've generated the user_sessions controller and mapped the login
  and logout routes, I get an error if I try to load the login page :
  uninitialized constant UserSessionsController::UserSession
  app/controllers/user_sessions_controller.rb:11:in `new'

  The user_sessions model is really simple :
  class UserSession  Authlogic::Session::Base
  end

  But it looks like this class declaration is not considered by Rails...

 Where is that file? is it in user_session.rb somewhere on the loadpath
 (not user_sessions.rb)

 Fred







  Does anyone have an idea ?

  Thx by advance for your help.
  Romain

-- 
You received 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: Urgent + Validations

2010-11-15 Thread Hemant Bhargava
Hello Fred,

Thanks for a quickie. But did'nt quite get it. Is it something like 
this?

validates_presence_of :abc_column, :on = :update, :if = some_method ..
and then this method should be defined somewhere.

def some_method
  if particular_param_is_present
return true
  end
  return false
end

Fred, am i doing correct here.

I have tried it this way, but this validation is still coming in all 
pages. I mean other pages also where i am updating.

Frederick Cheung wrote in post #961482:
 The :if options to the various validations allows you to specify your
 own logic as to which validations should run given the state of the
 object.

 Fred

-- 
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: Filter records by dates occurring this year

2010-11-15 Thread Marnen Laibow-Koser
Erol Fornoles wrote in post #961514:
 On Mon, Nov 15, 2010 at 11:35 AM, KT mal...@gmail.com wrote:

 :named_scope  :born_this_year, :conditions = {:dob = :current_year}
 end


 Assuming your :dob is a date

 Try :conditions = ['dob BETWEEN ? AND ?', Date.today.beginning_of_year,
 Date.today.end_of_year]

Even better:

:conditions = ['year(dob) = ?', Date.today.year]


 --
 Erol M. Fornoles

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread Marnen Laibow-Koser
Radhames Brito wrote in post #961537:
 Helper definition is loaded on application load, but the evaluation is
 done
 on every request , which are you talking about ?

Um...no.  In development mode, the helper classes *should* be reloaded 
with every request.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 an exe to Rails app

2010-11-15 Thread Marnen Laibow-Koser
David Kahn wrote in post #961433:
 I have been hacking around with this for a bit but want to see if there
 is
 an easy way:

 I am using Heroku and I have the wkhtmltopdf static binary in:
 rails_root/vendor/wkhtmltopdf

 I am not using any plug ins for wkhtmltopdf, just the executable, on
 purpose
 and want to keep it this way.

Why?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Authlogic and rails 3 : NameError in User sessionsController#new

2010-11-15 Thread Marnen Laibow-Koser
Romain B. wrote in post #961546:
 Yes it is, but in my setup it is user_sessions.rb with an s. It
 seems to me (but I'm a RoR newbie) that controller files should have
 an s...

They should.  But this is a model, not a controller.

 Can you tell me more on that ?
 Thx
 Romain

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Question re assert_equal

2010-11-15 Thread Marnen Laibow-Koser
24z wrote in post #961471:
 In Agile Web Development with Rails, the following statement is given:

 assert_equal has already been taken, product.errors[:title].join(';
 ')

 My question is: Why is the join(...) needed and what exactly does it
 do here?

 If it does what I assume, join an array of strings and use ;  as the
 separator, then I wonder how the assert_equal statement could ever
 evaluate to true as the first parameter is a static string without ;
 


That seems like a strangely written assertion.  Obviously, the only way 
it could return true is if product.errors[:title] has only one element.

 Can you shed some light for me?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] rake path seems wrong

2010-11-15 Thread Sam Ginko
I'm trying to test rake to make sure it works but I'm getting the
following error


/usr/local/bin/rake:19:in `load': no such file to load --
/Users/mauro/.gem/ruby/1.8/gems/rake-0.8.7/bin/rake (LoadError)
  from /usr/local/bin/rake:19

rake is installed in /usr/local/bin/rake

not sure why the path is screwed up. How do I fix this???

-- 
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 string formatting

2010-11-15 Thread Marnen Laibow-Koser
Alex P wrote in post #961467:
 Hi,

 I have a helper that include JS file contents into my view (for per-
 view JS injections).

Don't ever do that!  JS does not belong in your HTML.


 For some reason   (render :file = inject/#{filename}.js) %
 [ foo ]
 combined with string formatting, assuming there's a replacement
 pattern %s in {filename}.js, replaces all double quotes that were met
 in {filename}.js to quot;

 It doesn't escape single quotes, and doesn't even escape double quotes
 when using no replacement pattern.

That is correct HTML escaping.

[...]
 Is there some mechanism in Rails that may force symbols to be HTML-
 encoded in case of replacement? It may also be a bug.
 Thank you!

Rails 3 HTML-escapes strings by default.  You can turn it off, or 
declare a particular string as safe, but in this case the better 
solution would be to fix your design problem: put your JS and HTML in 
separate files.

Best
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 with Rails 3 rails server -d

2010-11-15 Thread Marnen Laibow-Koser
Please quote when replying.

mr wrote in post #961520:
 Thanks for your answer. The option of moving this source file
 somewhere Rails 3 will find it is kind of a last resort for me.

In this case, it's not a last resort.  Config files (if they're 
automatically loaded) normally go in config/initializers; if you put it 
elsewhere, that was probably a mistake.  So fix the mistake.


 What gets me with this issue is that without the daemon option this
 works (the required file is found) whereas with the daemon option it
 doesn't work...

That is strange.  Is $: the same in both cases?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Gems in ~/.gem vs in the Library

2010-11-15 Thread Marnen Laibow-Koser
Wojtek Galaj wrote in post #961468:
 Hello all,

 I am completely new to Ruby on Rails.

 When i install gems some of them
 get installed to ~/.gem folder as apparently the other location is not
 writable.

 What is the best way to go about this: chmod the folder in Library,
 let gems go to ~/.gem, sudo install gems always? What do you guys use?

Use sudo always, unless you're using RVM or you've changed your GEM_HOME 
permissions as Homrebrew recommends.


 Thanks in advance,
 Wojtek

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] Ultrasphinx help

2010-11-15 Thread Manish Nautiyal
I switch from ferret to ultrasphinx.

In my table user I have following fields

id, firstname, lastname, login, password, created_at, updated_at

is_indexed :fields = [{:field = :login},{:field = :firstname},{:field
= :lastname}]


Now what I want is to search with a character
like if you write 'm' then search m in login field where ever it find
'm'.

In ferret it works.

-- 
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: ActiveRecord query

2010-11-15 Thread Ich
Don't work for me.
A last I use

   arreglo= Array.new
arreglo=solicituds.all(:select =
convenio_id).map(:convenio_id)
arreglo-1
Convenio.where([id NOT IN (?),arreglo])
I'm not happy but works.


On 12 nov, 09:27, Tim Shaffer timshaf...@me.com wrote:
 On Nov 12, 6:59 am, Ich aconsuegra2...@gmail.com wrote:

  I want all the convenios that don't have been requested by a
  particular user.

 This is not tested, but I think something like this should get you
 what you want. May need to tweak it a little bit.

 Convenio.joins(:solicituds).where(solicituds.usuario_id  ?, 1234)

-- 
You received 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: ActiveRecord query

2010-11-15 Thread Marnen Laibow-Koser
Please quote when replying.

Ich wrote in post #961576:
 Don't work for me.

Are you using Rails 2 or 3?  The syntax that you're responding to was 
for Rails 3 (or Rails 2 + Arel).

 A last I use

arreglo= Array.new
 arreglo=solicituds.all(:select =
 convenio_id).map(:convenio_id)
 arreglo-1
 Convenio.where([id NOT IN (?),arreglo])
 I'm not happy but works.

That's not even good SQL.  I think you want something like this SQL:

SELECT * FROM convenios c
LEFT JOIN solicituds s ON (s.convenio_id = c.id AND s.usuario_id = 
:user_id)
WHERE s.id IS NULL

That gets everything in one query, and will be pretty easy to translate 
into AR find arguments, so you won't need find_by_sql here.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] How to send XML Data to Database in Rails

2010-11-15 Thread Matt Royer
I have attached a ruby program built to get the xml data out of files
and display the text back to me on the screen. This program was built
from a few different sources, as I'm still new with the Ruby language.
But I have monkeyed around with it enough and have got it working how I
want it.

What I'm trying to do is get this information into a database so I can
search it using a web interface (through Rails of course).

Here is a sample of the data that is spit out to the screen when I run
the program:



//dc5/IP Office Calls/38/73/387398.xml
starttime2009-05-05 15:28:47:000 -0600/starttime

endtime2009-05-05 15:32:50:000 -0600/endtime

calldirectionIncoming/calldirection

filename387398.wav/filename

recordingowner5297/recordingowner

party id=1
number555791/number
name/
/party

party id=2
number5297/number
nameFredJones/name
/party



What is the best way to go about getting this info loaded into a
database? Should I created the table and fields first and then put all
of the info in a yaml file and seed the database (I might have some
questions on how to do that)? New xml files are getting dumped to these
folders all the time, so I'm looking for a nice way to get this info
into the database without too much hassle.

I'm not sure how to make this data available to rails. Any help on this
--gems that could do it, articles describing what I need (I've googled
this subject extensively), or any hints, tips, etc... -- would be
GREATLY appreciated.

Thanks in advance,

--Matt Royer

Attachments:
http://www.ruby-forum.com/attachment/5391/noko-ono.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: How to send XML Data to Database in Rails

2010-11-15 Thread Marnen Laibow-Koser
Matt Royer wrote in post #961585:
 I have attached a ruby program built to get the xml data out of files
 and display the text back to me on the screen. This program was built
 from a few different sources, as I'm still new with the Ruby language.
 But I have monkeyed around with it enough and have got it working how I
 want it.

 What I'm trying to do is get this information into a database so I can
 search it using a web interface (through Rails of course).

 Here is a sample of the data that is spit out to the screen when I run
 the program:

 

 //dc5/IP Office Calls/38/73/387398.xml
 starttime2009-05-05 15:28:47:000 -0600/starttime

 endtime2009-05-05 15:32:50:000 -0600/endtime

 calldirectionIncoming/calldirection

 filename387398.wav/filename

 recordingowner5297/recordingowner

 party id=1
 number555791/number
 name/
 /party

 party id=2
 number5297/number
 nameFredJones/name
 /party

 

 What is the best way to go about getting this info loaded into a
 database? Should I created the table and fields first and then put all
 of the info in a yaml file and seed the database (I might have some
 questions on how to do that)? New xml files are getting dumped to these
 folders all the time, so I'm looking for a nice way to get this info
 into the database without too much hassle.

Then you don't want to seed the database -- seeding is only for 
relatively static data (such as state and country names) that needs to 
be loaded before you ever run the application.  It sounds to me like you 
simply want to read the XML files and build INSERT queries.  And unless 
I'm badly mistaken, you already know how to do that.

You may need a cron job or some such to parse new files as they come in.


 I'm not sure how to make this data available to rails.

What's the problem, exactly?  There's nothing here that you don't know.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: using DB2 with Rails 3

2010-11-15 Thread pepe
This is from 2007 but it might get you started:

http://www.ibm.com/developerworks/data/library/techarticle/dm-0705chun/

On Nov 10, 11:44 am, Conor Nugent li...@ruby-forum.com wrote:
 I have developed a rails 3 app and for various reasons I have been
 compelled to try using DB2 as the underlying database system. Does
 anyone have much experience of using DB2 with rails 3? Any good pointers
 on resources? I have just been using  postgres to date

 --
 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 send XML Data to Database in Rails

2010-11-15 Thread Marnen Laibow-Koser
Matt Royer wrote in post #961585:
 I have attached a ruby program built to get the xml data out of files
 and display the text back to me on the screen. This program was built
 from a few different sources, as I'm still new with the Ruby language.
 But I have monkeyed around with it enough and have got it working how I
 want it.

 What I'm trying to do is get this information into a database so I can
 search it using a web interface (through Rails of course).
[...]

Another idea: if this is to be read-only, you could use the XML files 
themselves as the DB, either through ActiveModel or (probably better) 
something like eXistDB.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 count a group of data

2010-11-15 Thread pepe
  +1

 Does that mean that you agree that Michael should slap himself on the
 forehead? :)
 Or  possibly :(  if the reader is Michael.

 Colin

First option. :D It also increases the count of slapped foreheads. ;)

I haven't tested what Marnen suggested yet, though. I'm sure it will
work but I just have to see for myself.

-- 
You received 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 send XML Data to Database in Rails

2010-11-15 Thread Matt Royer
Marnen Laibow-Koser wrote in post #961588:
 Then you don't want to seed the database -- seeding is only for
 relatively static data (such as state and country names) that needs to
 be loaded before you ever run the application.  It sounds to me like you
 simply want to read the XML files and build INSERT queries.  And unless
 I'm badly mistaken, you already know how to do that.

Hi Marnen. Thank you for the quick reply. Honestly, I've never worked 
with xml files like this. I grabbed the code for the ruby program from a 
lot of different sources and kind of crammed it all together to see what 
would work best. I messed up a few times and destroyed some xml files in 
to process (thank goodness for backups!). I can output all the xml at 
text to the screen... But that's about the extent of my abilities. I'm 
not sure how to turn them into objects to insert into a database.

 You may need a cron job or some such to parse new files as they come in.

Thanks for the tip! I'll look into doing that.

 What's the problem, exactly?  There's nothing here that you don't know.

Thanks for the confidence, but I don't have the same confidence in 
myself. There's a lot I don't know about Ruby and Rails, and I'm still 
trying to learn. I can create a database in Rails. I know how to do 
that. But I don't know how to get this text from the xml files turned 
into objects to send to the database. Any help on how to do that would 
be awesome.

Thanks again Marnen!

--Matt Royer

-- 
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 send XML Data to Database in Rails

2010-11-15 Thread Peter Hickman
Solr is another option, this will make it searchable and you will be
able to retrieve the source xml.

It's not really an XML database but if your data is essentially not
relational then it will do a great job. You could of course put the
relational aspects in a database but keep the body of the data in
solr.

-- 
You received 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 send XML Data to Database in Rails

2010-11-15 Thread Matt Royer
Marnen Laibow-Koser wrote in post #961590:
 Another idea: if this is to be read-only, you could use the XML files
 themselves as the DB, either through ActiveModel or (probably better)
 something like eXistDB.

That would be awesome! Any links on where to go to figure out how to do 
that? I'll look into eXistDB.

Thanks again Marnen!

-- 
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: How to send XML Data to Database in Rails

2010-11-15 Thread Matt Royer
Peter Hickman wrote in post #961594:
 Solr is another option, this will make it searchable and you will be
 able to retrieve the source xml.

 It's not really an XML database but if your data is essentially not
 relational then it will do a great job. You could of course put the
 relational aspects in a database but keep the body of the data in
 solr.

Sweet! That's what I need. I need it searchable. This is for work. It's 
nothing time-sensitive, so I have some time to work on it. But I figured 
I would get cracking on some type of solution.

All of the ideas so far have been great. I'll post back with any more 
issues, and if people could keep the suggestions flowing, I would be 
forever grateful!

Thanks,

--Matt Royer

-- 
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 send XML Data to Database in Rails

2010-11-15 Thread Marnen Laibow-Koser
Matt Royer wrote in post #961592:
[...]
 What's the problem, exactly?  There's nothing here that you don't know.

 Thanks for the confidence, but I don't have the same confidence in
 myself. There's a lot I don't know about Ruby and Rails, and I'm still
 trying to learn. I can create a database in Rails. I know how to do
 that. But I don't know how to get this text from the xml files turned
 into objects to send to the database. Any help on how to do that would
 be awesome.

What do you really need help with here?  You know how to parse the XML 
files to retrieve the data.  You know how to insert records into a DB. 
Now you just need to connect the two.

Stop convincing yourself you're missing something, write some tests, and 
start coding. :)


 Thanks again Marnen!

 --Matt Royer

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread radhames brito
On Mon, Nov 15, 2010 at 10:27 AM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:

 Radhames Brito wrote in post #961537:
  Helper definition is loaded on application load, but the evaluation is
  done
  on every request , which are you talking about ?

 Um...no.  In development mode, the helper classes *should* be reloaded
 with every request.

 Best,
 --


well, they dont, at least not on my apps, they get evaluated in every
request, but the definition does not change. I have test it on rails 2 , but
not rails 3, many times and they dont get reloaded in development.

-- 
You received 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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread radhames brito
On Mon, Nov 15, 2010 at 8:38 AM, radhames brito rbri...@gmail.com wrote:

 Thats because the return value is part of the helper definition and the
 definition is set when the app is loaded, normally one would evaluate the
 result and this would be updated on every request, thats why your problem
 seems strange, but is not strange is the default behavior, so what do you do
 ? I have to go to work now so i cant fully explain but  you have to return a
 lambda method if you want your result to be dynamic.


 I'll show a common example with the model on rails 2

  name_scope :recent ,:conditions={ :create_at = 2.months.ago}

  ^^ the 2 month ago is set on app load and not changed as  long as you dont
 restart the app, so a year from now will have the same value

 name_scope :recent ,lambda {:conditions={ :create_at = 2.months.ago} }

 ^^ here the 2.month.ago is reevaluated on every call to the method


I want to clarify the highlighted part

What i understand is that rails.nerd has the return value in the helper
method's definition, kind of like in this case the above is 2.month.ago
example.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread Marnen Laibow-Koser
Radhames Brito wrote in post #961601:
 On Mon, Nov 15, 2010 at 10:27 AM, Marnen Laibow-Koser
 li...@ruby-forum.comwrote:

Please quote when replying.



 well, they dont, at least not on my apps, they get evaluated in every
 request, but the definition does not change. I have test it on rails 2 ,
 but
 not rails 3, many times and they dont get reloaded in development.

I've never used Rails 3.  With Rails 2 for me, helpers certainly do seem 
to get reloaded.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] Webrick Configuration

2010-11-15 Thread Hassan Schroeder
On Mon, Nov 15, 2010 at 2:48 AM, PalaniKannan K kpalanikan...@gmail.com wrote:

 I am using webrick server for my application in ~/sample. For every boot of
 computer, i need to start the webrick server in ~/sample. Kindly anyone help
 me to start up the webrick server at the initial boot of computer with
 specified port as automated startup.

If you're on a *nix platform, look at the startup scripts in /etc/init.d or
equivalent and make one for webrick. Recent Macs use `launchd`
with files named *.plist and again you can find plenty of examples to
use as a basis for your own script.

If you're  on Windows, I have no idea :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-- 
You received 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] Webrick Configuration

2010-11-15 Thread PalaniKannan K
Hi Hassan
I am using linux only. I tried to create script on /etc/init.d. But, it
doesnt start the webrick server within my project data @ ~/sample. If u know
the script for initiating webrick from the /etc/init.d to my project data @
~/sample during starting of OS kindly help me.

--
With Regards,
Palani Kannan. K

-- 
You received 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 route matches controller - scaffold generated code

2010-11-15 Thread chris
On Nov 14, 6:38 pm, bobtr bobt...@gmail.com wrote:
 rails g scaffold dog dog_id:integer color:string gender:string
 dog_name:string --skip-migration

Since you put --skip-migration, could you post table structure?  Maybe
missing an ID or some other field?  Reserved word bug?  Sometimes I've
had to restart ruby server when working with routes.rb, but shouldn't
be necessary with a fresh scaffold.  Problem does seem related to
routes.rb, I bet using:action controller and id in link_to() would work

-- 
You received 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 route matches controller - scaffold generated code

2010-11-15 Thread Marnen Laibow-Koser
chris wrote in post #961631:
 On Nov 14, 6:38pm, bobtr bobt...@gmail.com wrote:
 rails g scaffold dog dog_id:integer color:string gender:string
 dog_name:string --skip-migration

 Since you put --skip-migration, could you post table structure?
[...]

More to the point, why did you skip the migration?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Gems in ~/.gem vs in the Library

2010-11-15 Thread chris
On Nov 14, 4:12 pm, Wojtek Galaj wojtek.ga...@gmail.com wrote:
 What is the best way to go about this: chmod the folder in Library,
 let gems go to ~/.gem, sudo install gems always? What do you guys use?

I use sudo for system lib, but also vendor everything when deployed.
IMO gems in system lib should be treated like system software, could
be used by other programs in OS or other users.  If you have another
local user they could overwrite the gem and cause problems for
everyone.

Unfortunately that also means system lib is volatile and could be
'helpfully upgraded' at any moment by admins.  I sure hope Gemfile is
gem config tool that actually works...

-- 
You received 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] Webrick Configuration

2010-11-15 Thread Hassan Schroeder
On Mon, Nov 15, 2010 at 10:33 AM, PalaniKannan K
kpalanikan...@gmail.com wrote:
 I am using linux only. I tried to create script on /etc/init.d. But, it
 doesnt start the webrick server within my project data @ ~/sample. If u know
 the script for initiating webrick from the /etc/init.d to my project data @
 ~/sample during starting of OS kindly help me.

I don't use webrick, but init scripts are pretty trivial. Post what you
tried and explain how it failed.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-- 
You received 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] (Jobs) RoR Developer in Silicon Valley

2010-11-15 Thread Josh Powell
Rocket Fuel, Inc. is seeking an experienced Web Application Developer
to join our growing team at our headquarters in Redwood Shores, CA.
You will be responsible for implementing rich internet applications
that help us manage and visualize the substantial real-time data
generated by our proprietary online advertising platform.

3 years of Ruby on Rails, Python / Django, or PHP web framework
experience required.  The application is written in Ruby 1.8.7 and
Rails 2.3.8 (with ambitions of upgrading to Rails 3) but we are
willing to train talented developers.  We're also looking for someone
with experience with HTML, CSS, Javascript, MySQL, and one javascript
library (jQuery, Prototype, or ExtJS preferred).

Enough experience with Photoshop to take a mock up, and cut it up to
make a page is a plus, as is experience with bug tracking and version
control systems.

Click a href=http://hire.jobvite.com/j/?cj=oiGtVfw6s=rubyonrails-
talkhere/a for full job description.
Click a href=http://hire.jobvite.com/j/?aj=oiGtVfw6s=rubyonrails-
talkhere/a to apply.

-- 
You received 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 route matches controller - scaffold generated code

2010-11-15 Thread Bob T.
Here is the table definition from the generated schema.rb

  create_table dogs, :primary_key = dog_id, :force = true do |t|
t.string color,:limit = 20
t.string gender,   :limit = 20
t.string dog_name, :limit = 20
  end


I used skip-migration because the table already exists in mysql.
When I move from learning mode to development mode, I will need to write 
code against existing databases, so I can't maintain the database source 
code in ruby.

-- 
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 route matches controller - scaffold generated code

2010-11-15 Thread Bob T.
chris wrote in post #961631:
 routes.rb, I bet using:action controller and id in link_to() would work

If you would kindly give me an exact syntax, I'd be like to try it.

I would, however, like to understand why the generated code does not 
work.

-- 
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 route matches controller - scaffold generated code

2010-11-15 Thread Marnen Laibow-Koser
Bob T. wrote in post #961643:
 Here is the table definition from the generated schema.rb

   create_table dogs, :primary_key = dog_id, :force = true do |t|
 t.string color,:limit = 20
 t.string gender,   :limit = 20
 t.string dog_name, :limit = 20
   end


 I used skip-migration because the table already exists in mysql.
 When I move from learning mode to development mode, I will need to write
 code against existing databases, so I can't maintain the database source
 code in ruby.

That's not quite true.  You need to learn about rake db:schema:dump.

Anyway, you should be using migrations wherever possible, especially as 
you learn.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] Javascript refresh...?

2010-11-15 Thread Pete
Hi

I am trying to refresh the contents of a page after selecting certain
options on a drop-down list.

I have created the drop down as such:

%= select_tag itemSelect, options_for_select(['All', 'Latest'],
'All'),  { :onchange = remote_function(
 :with = 'Form.Element.serialize(this)',
 :url = {:action = 'finishedItems'})} %

This passes back the correct value to the controller, and I use this
to change values in a named_scope to generate the relevant content in
the rest of the page.

However I am unsure of how to refresh this content, without completely
reloading the page,

Is this where render_partial comes in useful?

P.S - I am not gathering any id's from the database directly in the
select, it is just a local function for refreshing data on the page.

-- 
You received 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: SQLServer 2008 and Windows XP

2010-11-15 Thread Fredrik TiC Jansson
I had similar problems on windows server 2003 try the steps in the
link below and it should work ( i use mongrel as my webserver)

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/90bac21d2f5d2616/908fbcaed47c5259#908fbcaed47c5259



On 15 Nov, 11:32, Magnus D. li...@ruby-forum.com wrote:
 I'm trying to connct to an MSSQLserver 2008 on a WinXP box.

 $ ruby -v
 ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]

 $ rails --version
 Rails 3.0.1

 $ gem list --local

 *** LOCAL GEMS ***

 abstract (1.0.0)
 actionmailer (3.0.1, 3.0.0)
 actionpack (3.0.1, 3.0.0)
 activemodel (3.0.1, 3.0.0)
 activerecord (3.0.1)
 activerecord-sqlserver-adapter (3.0.5)
 activeresource (3.0.1, 3.0.0)
 activesupport (3.0.1, 3.0.0, 1.4.4)
 arel (2.0.2, 1.0.1)
 builder (2.1.2)
 bundler (1.0.3)
 cgi_multipart_eof_fix (2.5.0)
 dbi (0.4.5)
 deprecated (3.0.0, 2.0.1)
 erubis (2.6.6)
 fastthread (1.0.1 i386-mswin32)
 gem_plugin (0.2.3)
 i18n (0.4.2, 0.4.1)
 linecache (0.43 mswin32)
 mail (2.2.9, 2.2.7)
 mime-types (1.16)
 mongrel (1.1.5 x86-mingw32)
 mongrel_service (0.4.beta3)
 mysql (2.8.1 x86-mingw32, 2.7.3 mswin32)
 polyglot (0.3.1)
 rack (1.2.1)
 rack-mount (0.6.13)
 rack-test (0.5.6)
 rails (3.0.1)
 railties (3.0.1, 3.0.0)
 rake (0.8.7)
 rdiscount (1.6.5)
 ruby-debug-base (0.10.3 mswin32)
 ruby-debug-ide (0.4.5)
 ruby-odbc (0.2)
 sqlite3-ruby (1.3.2 x86-mingw32, 1.3.1 x86-mingw32)
 thor (0.14.4, 0.14.3)
 treetop (1.4.8)
 tzinfo (0.3.23)

 database.yml
 development:
   adapter: sqlserver
   database: m_development
   dsn: M2
   mode: odbc
   username: user
   password: Secret
   encoding: utf8

 Every time I run rails generate scaffold Something, I get an error like
 this one:

 $ rails generate scaffold Test
       invoke  active_record
 c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in
 `establish_connection': Please install
 the sqlserver adapter: `gem install activerecord-sqlserver-adapter` (no
 such file to load --
 active_record/connection_adapters/sqlserver_adapter) (RuntimeError)
         from
 c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in
 `establish_connection'
         from
 c:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in
 `establish_connection'

 If I look in connection_specification.rb around line 71 I see this:

         begin
             require
 active_record/connection_adapters/#{spec[:adapter]}_adapter
           rescue LoadError
             raise Please install the #{spec[:adapter]} adapter: `gem
 install activerecord-#{spec[:adapter]}-adapter` (#{$!})
           end

 Some debugging tells me that spec[:adapter] contains the sqlserver
 from the database.yml file. But I have, as you can see from the list of
 installed gems, already installed the SQLServer Adapter, so why can't it
 be found?

 I have tried to run gem install activerecord-sqlserver-adapter more than
 once, but that doesn't help, and I can find the gem in WindowsExplorer
 in
 C:\Ruby\lib\ruby\gems\1.8\gems\activerecord-sqlserver-adapter-3.0.5\lib\active_record\connection_adapters

 Is it a problem with GEM_HOME or do I use a wrong version of rails?

 Thanks

 Magnus

 --
 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] Hardcoded breakpoints in firebug

2010-11-15 Thread Fritz Trapper
How to hardcode a breakpoint for firebug into js code?

The debugger statement known from venkman seems to be ignored.

-- 
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 route matches controller - scaffold generated code

2010-11-15 Thread chris
That's the problem:

On Nov 15, 2:20 pm, Bob T. li...@ruby-forum.com wrote:
   create_table dogs, :primary_key = dog_id, :force = true do |t|

I got a similar error under 2.3.8 with your schema.  AR expects ID to
be called 'id', you can override it in the model or this would work:

  create_table :dogs' do |t|
t.string color,:limit = 20
t.string gender,   :limit = 20
t.string dog_name, :limit = 20
  end

I would also recommend using migrations.  Sometimes it feels like
adding a layer of abstraction for it's own sake, but in the long run
it is a great idea.

-- 
You received 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: Argument error in controller # show

2010-11-15 Thread Dennis Pat
i have fix the code and now i have can't find the items in my table 
error.QuantumDB doesnt show any data in my table although using phpadmin 
i can  see them properly.The error says it can't convert the timestamp 
so i'm guessing either i must correct the jdbc connector or the ruby 
parameters for the timestamp.Searching for solution ...

-- 
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: No route matches controller - scaffold generated code

2010-11-15 Thread Colin Law
On 15 November 2010 19:20, Bob T. li...@ruby-forum.com wrote:
 Here is the table definition from the generated schema.rb

  create_table dogs, :primary_key = dog_id, :force = true do |t|
    t.string color,    :limit = 20
    t.string gender,   :limit = 20
    t.string dog_name, :limit = 20
  end


 I used skip-migration because the table already exists in mysql.
 When I move from learning mode to development mode, I will need to write
 code against existing databases, so I can't maintain the database source
 code in ruby.

Did you put
set_primary_key dog_id
in the the dog model?

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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread rails.n...@gmail.com
I just tested this in a new, fresh Rails project and the results are
different

Changes to a helper are immediately reflected

Turns out, Inherited Resources gem effects this behaviour... and
locks in your helpers when the server starts

-- 
You received 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] Rails 3 - Handle Incoming Messages (Allowing Users to reply to email notifications)

2010-11-15 Thread CuriousNewbie
Hello,

Right now my app sends out email notifications. I'd like to allow the
user to reply directly to the email, which then gets ingested by my
app and inserted into the database.

Are there any Rails gems, services, tutorials that can point me in the
right direction.

Also, probably need to make the reply-to email have a UID, replyto--
u...@domain.com, so I don't have to rely on the from (sender).

What do you think?

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.



Re: [Rails] Rails 3 - Handle Incoming Messages (Allowing Users to reply to email notifications)

2010-11-15 Thread Brian Troutwine
Have you seen this: http://guides.rubyonrails.org/action_mailer_basics.html

On Mon, Nov 15, 2010 at 4:40 PM, CuriousNewbie bhellm...@gmail.com wrote:
 Hello,

 Right now my app sends out email notifications. I'd like to allow the
 user to reply directly to the email, which then gets ingested by my
 app and inserted into the database.

 Are there any Rails gems, services, tutorials that can point me in the
 right direction.

 Also, probably need to make the reply-to email have a UID, replyto--
 u...@domain.com, so I don't have to rely on the from (sender).

 What do you think?

 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.



-- 
You received 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 route matches controller - scaffold generated code

2010-11-15 Thread Marnen Laibow-Koser
Bob T. wrote in post #961668:
 Marnen Laibow-Koser wrote in post #961663:

 I used skip-migration because the table already exists in mysql.
 When I move from learning mode to development mode, I will need to write
 code against existing databases, so I can't maintain the database source
 code in ruby.

 That's not quite true.  You need to learn about rake db:schema:dump.

 Let me rephrase ..  I don't want to depend on ruby for schema
 definition, even if it can do it.

Why not?  IMHO you are making a huge mistake.  The advantages of having 
Rails manage your DB schema are many -- the app knows what it wants in 
the DB; you can have your DB schema in version control with your source 
code; changes to the schema are no longer difficult.


 Anyway, I did the migrate separately, like this:
   rake db:migrate

 It brought all the table definitions over from my mysql database.

How could it do that?  rake db:migrate only executes your migration 
files.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 3 - Handle Incoming Messages (Allowing Users to reply to email notifications)

2010-11-15 Thread Marnen Laibow-Koser
CuriousNewbie wrote in post #961680:
 Thanks Brian. I have. That URL covers sending emails really well. But
 reeving,

Not possible with Rails alone AFAIK (at least not easily so).

 creating UUID in the reply address,

The reply address is just a string. You can do all the usual string 
operations on it.

 and handling scalability
 on Heroku are topics it lacks.

What about scalability?

 Given this is a real trendy thing to do
 these days, I was hoping to leverage someone's thoughts on the
 process.

Leverage someone's thoughts?  What?



 Thoughts?

Well, you'll need Procmail or something to retrieve the mail and send it 
to your Rails app. Then you can have Rails take it from there...

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 3 - Handle Incoming Messages (Allowing Users to reply to email notifications)

2010-11-15 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote in post #961688:
 CuriousNewbie wrote in post #961680:
 Thanks Brian. I have. That URL covers sending emails really well. But
 reeving,

 Not possible with Rails alone AFAIK (at least not easily so).


Or maybe it is now.  Anyway, http://lmgtfy.com?q=rails+receive+email 
appears to yield lots of useful resources.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] XML.Builder

2010-11-15 Thread David Zhu
Hey guys,

I have a quick question about xml.builder rendering in Rails. I'm
pretty sure I am just getting the builder syntax wrong.

The problem is that I can't get it to display things that I want
rendered out. By looking at the logs it seems like Rails has found
everything, but my syntax for displaying is wrong, so it displays
nothing.

I would like to display for example,

post.title
post.author
post.body

That's all wrapped in a for loop, that should display all the posts. I
did a respond to xml in the controller, and I defined all my variables
correctly. However, I'm getting a blank screen.

What's the equivalent of %= % in xml.builder syntax?

Thank you

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-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] model relationship fails?

2010-11-15 Thread arga aridarma
dear all, 
This may sound stupid, but I'm confused in creating the model relationship.

I set these 4 models:

ComUser  ActiveRecord::Base
   belongs_to :DefKelamin
   belongs_to :DefUserRole
   belongs_to :DefJabatan
Migration:
create_table :com_users do |t|
t.timestamps
t.references :def_jabatan, :null = false
t.integer :def_kelamin_id, :null = false
t.references :def_user_role, :null = false
t.column :username,'varchar(20)', :null = false
t.column :password,'varchar(20)', :null = false
end

DefJabatan  ActiveRecord::Base
   has_one:ComUser
Migration:
create_table :def_jabatans do |t|
t.timestamps
t.column :jabatan,'varchar(20)', :null = false
end

DefUserRole
   has_one:ComUser
Migration:
create_table :def_user_roles do |t|
t.timestamps
t.column :role,'varchar(20)', :null = false
t.string :description, :null = false
t.string :icon
end

DefKelamin  ActiveRecord::Base
has_one :ComUser
Migration:
create_table :def_kelamins do |t|
t.timestamps
t.column :kelamin,'varchar(10)', :null = false
end

In the controller, I put a simple query:
@users = ComUser.find(:first)

and in the view, i simply put a object debug:
%=debug(@users)%

and I get this:

--- !ruby/object:ComUser 
attributes: 
  def_jabatan_id: 1
  created_at: 2010-11-16 04:31:35
  def_user_role_id: 1
  gsm: -
  updated_at: 2010-11-16 04:31:35
  alamat: -
  username: admin
  id: 1
  def_kelamin_id: 1
  password: admin
  online_status: 2
attributes_cache: {}
I'm getting a feeling that I didn't set the relationship right, because i don't 
see any attributes from the model started with Def-something that i create 
above..
Am I missing something here? I've been staying wake all night to sort this 
thing 
out, with no success.
I even tries to alter the table by implicitly put a foreign key in the table 
for 
ComUser model using sql statements, and the debug result is still the same.
How can i make this relationship work?

Thanks 

Regards,
Arga



-- 
You received 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: Render partial generate unwanted spaces

2010-11-15 Thread bravehoptoad

 Are you saying that the html, viewed via View  Page Source or similar
 in your browser is identical in the two cases, but it shows
 differently in the browser?  I don't think this is possible, all the
 browser can see is the html (and scripts and css which we assume are
 identical) so it cannot tell whether you have used a partial or not.
 I suggest that you copy the complete page html in the two cases and
 paste it into two files.  Then compare the files with a file
 comparison utility.  I am sure you will see a difference.



Yes, this is what I'm saying.  The source html is identical.
Comparing the two source files finds no differences, even though there
is clearly extra space on the page when using a partial.  Is Rails
somehow interpreting the .css differently?  I can't figure it
out...it's making for some ugly, non-DRY code on my views, 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: No route matches controller - scaffold generated code

2010-11-15 Thread Bob T.
# Here is the solution

class Dog  ActiveRecord::Base
set_primary_key dog_id
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.



[Rails] Re: how to install ror on windows 7

2010-11-15 Thread MarcRic
Hi Davo,

The mongrel item was covered in the next item of that material, but it
was for Rails 2.3.6.

With the retirement of Zed Shaw and the current Rails 3 version, for
developments purpose Webrick will do the job pretty well.

In a real production server You will find many alternatives better
then both.

All the best.

--
MarcRic
www.marcric.com
http://marcricblog.blogspot.com/
http://www.traineronrails.com/
http://groups.google.com.br/group/riorubyrails


On Nov 13, 11:14 am, Davo dave.southpe...@gmail.com wrote:
 Thanks Marcos,

 But I'm a bit confused over the list at the beginning that mentions
 Mongrel 1.1.6 beta ?
 I have been unable to get Mongrel going and have been 'Stuck' on
 Webrick.
 So even though Mongrel is mentioned it is not included in your
 instructions :(
 Kind Regards, Dave

 On Nov 13, 8:58 pm, MarcRic marc...@gmail.com wrote:

  Hi Romeu,

  I insist: everything you need is detailed here:

 http://www.public.traineronrails.com/guides/rails/pages/01-rails_inst...

  You can easily follow it updating when necessary (as I have
  done myself) to Ruby 1.9.2 and Rails 3.0.1.

  Hope it helps

  --
  MarcRicwww.marcric.comhttp://marcricblog.blogspot.com/http://www.traineronra...

  On Nov 7, 11:22 pm, romeo rap romeo_aka_...@yahoo.com wrote:

   On Nov 6, 7:36 am, venkata reddy venkatareddy...@gmail.com wrote:

Hi all,
i want to learn ruby on rails.i am using window7  .
I installed  ruby 1.9.2 p0 in C:\ruby   using one click
installer.and then installed
rails using the command gem install rails. and rails get installed
successfully. After that i tried to build a sample application.so i
created a new folder in c like  c:\venkat and  i moved to that
folder in the command prompt and  i created an application venu by
giving the command              c:\venkat rails new venu . And now i
came to know that  i have to start the server at this point of time
and i tried to start the server usting the command rails server but
after entering this command  i got an error like    the program cont
start because sqlite3.dll is missing from your computer.try
reinstalling the program to fix this problem.  so i downloaded
sqlite3.dll and pasted it in the C:\windows\system32 and tried once
again to start the server. But now i got a new error like The
rocedure entry point sqlite3_backup_finish could not be loacated in
the dynamic link library Sqlite3.dll

what i have to do next? pls help...

--
ThanksRegards
B.Venkata Reddy,
Mob:9959345033.

   ok, i got the same error and got verry frustrated.. i had only
   the .dll and the .exe sqlite3 files but not the .def one.. i just
   downloaded the .def too and worked like a charm :)

-- 
You received 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 install ror on windows 7

2010-11-15 Thread Marnen Laibow-Koser
MarcRic wrote in post #961698:
 Hi Davo,

 The mongrel item was covered in the next item of that material, but it
 was for Rails 2.3.6.

 With the retirement of Zed Shaw and the current Rails 3 version, for
 developments purpose Webrick will do the job pretty well.

 In a real production server You will find many alternatives better
 then both.

Of course, in a real production server, you shouldn't be using 
Windows...


 All the best.

 --
 MarcRic

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Render partial generate unwanted spaces

2010-11-15 Thread Marnen Laibow-Koser
bravehoptoad wrote in post #961694:

 Are you saying that the html, viewed via View  Page Source or similar
 in your browser is identical in the two cases, but it shows
 differently in the browser? I don't think this is possible, all the
 browser can see is the html (and scripts and css which we assume are
 identical) so it cannot tell whether you have used a partial or not.
 I suggest that you copy the complete page html in the two cases and
 paste it into two files. Then compare the files with a file
 comparison utility. I am sure you will see a difference.



 Yes, this is what I'm saying.  The source html is identical.
 Comparing the two source files finds no differences,

Wait.  You said source files.  That is not what we are asking.

We are asking about the *generated HTML*, as seen in the browser's View 
Source, not the Ruby source files.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: model relationship fails?

2010-11-15 Thread Marnen Laibow-Koser
arga aridarma wrote in post #961693:
 dear all,
 This may sound stupid, but I'm confused in creating the model
 relationship.
[...]

Please don't hijack threads.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: XML.Builder

2010-11-15 Thread Marnen Laibow-Koser
David Zhu wrote in post #961692:
 Hey guys,

 I have a quick question about xml.builder rendering in Rails. I'm
 pretty sure I am just getting the builder syntax wrong.

 The problem is that I can't get it to display things that I want
 rendered out. By looking at the logs it seems like Rails has found
 everything, but my syntax for displaying is wrong, so it displays
 nothing.

 I would like to display for example,

 post.title
 post.author
 post.body

 That's all wrapped in a for loop, that should display all the posts. I
 did a respond to xml in the controller, and I defined all my variables
 correctly. However, I'm getting a blank screen.

 What's the equivalent of %= % in xml.builder syntax?

http://builder.rubyforge.org/

But consider not using Builder.  Haml works just as well for XML as it 
does for HTML, as does ERb (though it's less pleasant than Haml).  I 
find Builder to be more trouble than it's worth in many cases.


 Thank you

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: No route matches controller - scaffold generated code

2010-11-15 Thread Bob T.
Someone else found this before I saw yours, but that is the problem.
I assumed that scaffold would know what the primary key is , because it 
was identified in the migrated schema:

schema.rb

  create_table dogs, :primary_key = dog_id, :force = true do |t|
t.string color,:limit = 20
t.string gender,   :limit = 20
t.string dog_name, :limit = 20
  end


Thanks for your help!

Colin Law wrote in post #961671:
 On 15 November 2010 19:20, Bob T. li...@ruby-forum.com wrote:
 When I move from learning mode to development mode, I will need to write
 code against existing databases, so I can't maintain the database source
 code in ruby.

 Did you put
 set_primary_key dog_id
 in the the dog model?

 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: No route matches controller - scaffold generated code

2010-11-15 Thread Bob T.
Regarding migrations -

We use Oracle, MySql , PHP and are just considering using RoR.

If we choose to develop some things in RoR, it will have to learn to get 
along with the code and the database tables we already have.

If you use only one technology, I understand why you would recommend 
using that technology exclusively.   Personally, I don't believe in 
getting locked into a particular technology.   Thats my choice.

-- 
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: model relationship fails?

2010-11-15 Thread arga aridarma
eh?
what do you mean by hijack the threads?

Regards,
Arga



- Original Message 
From: Marnen Laibow-Koser li...@ruby-forum.com
To: rubyonrails-talk@googlegroups.com
Sent: Tuesday, November 16, 2010 6:12:15
Subject: [Rails] Re: model relationship fails?

arga aridarma wrote in post #961693:
 dear all,
 This may sound stupid, but I'm confused in creating the model
 relationship.
[...]

Please don't hijack threads.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] Re: model relationship fails?

2010-11-15 Thread Peter Bell
He's suggesting that if you want to ask a new question, you create a new 
subject line and post a separate email. Keeps it easier for everyone to follow 
the content for a given topic.

FWIW, I'm not jumping in with an opinion on whether your request was relevant 
to the original thread or not - wasn't following it. Just describing what 
people usually mean when they say hijacking threads and aren't talking about 
some kind of weird concurrency bug :)

Best Wishes,
Peter

On Nov 15, 2010, at 6:22 PM, arga aridarma wrote:

 eh?
 what do you mean by hijack the threads?
 
 Regards,
 Arga
 
 
 
 - Original Message 
 From: Marnen Laibow-Koser li...@ruby-forum.com
 To: rubyonrails-talk@googlegroups.com
 Sent: Tuesday, November 16, 2010 6:12:15
 Subject: [Rails] Re: model relationship fails?
 
 arga aridarma wrote in post #961693:
 dear all,
 This may sound stupid, but I'm confused in creating the model
 relationship.
 [...]
 
 Please don't hijack threads.
 
 Best,
 --
 Marnen Laibow-Koser
 http://www.marnen.org
 mar...@marnen.org
 
 -- 
 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.
 

-- 
You received 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 route matches controller - scaffold generated code

2010-11-15 Thread Marnen Laibow-Koser
Bob T. wrote in post #961705:
 Regarding migrations -

Please quote when replying.


 We use Oracle, MySql , PHP, Perl/DBI and are just considering using RoR.

 If we choose to develop some things in RoR, it will have to learn to get
 along with the code and the database tables we already have.

And so it can.  But you should dump the schema into the schema file as I 
already suggested.


 If you use only one technology, I understand why you would recommend
 using that technology exclusively.   Personally, I don't believe in
 getting locked into a particular technology.   Thats my choice.

I don't either. But while you're developing in Rails, you should use 
Rails migrations.

It's not great practice to have multiple applications touching the same 
DB anyway.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] Why is my model relationship fails? (has_one and belongs_to)

2010-11-15 Thread arga aridarma
Dear all,
This is a repost of my question, because the first post is considered as thread 
hijack.
I have changed the title, hopefully this time it's not hijacking any threads :D

I have a silly problem in setting up a relationship between 4 models. 

I set these 4 models, ComUser, DefJabatan, DefUserRole, DefKelamin. In each 
model with name started with 'Def', i put a has_one:ComUser relationship.
So naturally i have 3 belongs_to relationship in ComUser.
I do a simple query in the controller: @users = ComUser.find(:first)
and in the view, i simply put a object debug: %=debug(@users)%

and I get this:

--- !ruby/object:ComUser 
attributes: 
  def_jabatan_id: 1
  created_at: 2010-11-16 04:31:35
  def_user_role_id: 1
  gsm: -
  updated_at: 2010-11-16 04:31:35
  alamat: -
  username: admin
  id: 1
  def_kelamin_id: 1
  password: admin
  online_status: 2
attributes_cache: {}

I'm getting a feeling that I didn't set the relationship right, because i don't 
see any attributes addition in the ComUser from the model started with 
Def-something that i create above..

Am I missing something here, like violating a naming convention or something? 

I even tries to alter the table by implicitly put a foreign key in the table 
for 
ComUser model using sql statements, and the debug result is still the same.
How can i make this relationship work?

Thanks 

PS. I put the code snippet that i use for migrating the database and defining 
the relationship below.

Regards,
Arga


ComUser  ActiveRecord::Base
   belongs_to :DefKelamin
   belongs_to :DefUserRole
   belongs_to :DefJabatan
Migration:
create_table :com_users do |t|
t.timestamps
t.references :def_jabatan, :null = false
t.integer :def_kelamin_id, :null = false
t.references :def_user_role, :null = false
t.column :username,'varchar(20)', :null = false
t.column :password,'varchar(20)', :null = false
end

DefJabatan  ActiveRecord::Base
   has_one:ComUser
Migration:
create_table :def_jabatans do |t|
t.timestamps
t.column :jabatan,'varchar(20)', :null = false
end

DefUserRole  ActiveRecord::Base
   has_one:ComUser
Migration:
create_table :def_user_roles do |t|
t.timestamps
t.column :role,'varchar(20)', :null = false
t.string :description, :null = false
t.string :icon
end

DefKelamin  ActiveRecord::Base
has_one :ComUser
Migration:
create_table :def_kelamins do |t|
t.timestamps
t.column :kelamin,'varchar(10)', :null = false
end


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-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 install ror on windows 7

2010-11-15 Thread MarcRic
Davo,

When I say alternatives better then both, I mean other HTTP Web
servers which is the subject now.

The O.S. of the server is just a matter of taste or a decision already
made for you.

I have my personal choices concerning O.S. for servers (Servers in
general not only for Web Servers), but at work that is a corporate
decision, which involves not only technical, but political and
commercial decisions, and currently they are under Windows O.S.

So, my general answer to those that are simply against Windows is:
stay out of the IT corporate business. Do only your personal choice
stuff with the resources you can afford, because in the corporate
industry, some decisions are made for you, not by you. And if you play
the game you will follow their rules not yours.

The origins of the Trainer On Rails site is an effort to prove that
the Windows users minority can develop cool stuff using Ruby on
Rails in a productive way under Windows, apart from which Server's
O.S. will support the application in the end.

Regards.

--
MarcRic
www.marcric.com
http://marcricblog.blogspot.com/
http://www.traineronrails.com/
http://groups.google.com.br/group/riorubyrails


On Nov 13, 11:14 am, Davo dave.southpe...@gmail.com wrote:
 Thanks Marcos,

 But I'm a bit confused over the list at the beginning that mentions
 Mongrel 1.1.6 beta ?
 I have been unable to get Mongrel going and have been 'Stuck' on
 Webrick.
 So even though Mongrel is mentioned it is not included in your
 instructions :(
 Kind Regards, Dave

 On Nov 13, 8:58 pm, MarcRic marc...@gmail.com wrote:

  Hi Romeu,

  I insist: everything you need is detailed here:

 http://www.public.traineronrails.com/guides/rails/pages/01-rails_inst...

  You can easily follow it updating when necessary (as I have
  done myself) to Ruby 1.9.2 and Rails 3.0.1.

  Hope it helps

  --
  MarcRicwww.marcric.comhttp://marcricblog.blogspot.com/http://www.traineronra...

  On Nov 7, 11:22 pm, romeo rap romeo_aka_...@yahoo.com wrote:

   On Nov 6, 7:36 am, venkata reddy venkatareddy...@gmail.com wrote:

Hi all,
i want to learn ruby on rails.i am using window7  .
I installed  ruby 1.9.2 p0 in C:\ruby   using one click
installer.and then installed
rails using the command gem install rails. and rails get installed
successfully. After that i tried to build a sample application.so i
created a new folder in c like  c:\venkat and  i moved to that
folder in the command prompt and  i created an application venu by
giving the command              c:\venkat rails new venu . And now i
came to know that  i have to start the server at this point of time
and i tried to start the server usting the command rails server but
after entering this command  i got an error like    the program cont
start because sqlite3.dll is missing from your computer.try
reinstalling the program to fix this problem.  so i downloaded
sqlite3.dll and pasted it in the C:\windows\system32 and tried once
again to start the server. But now i got a new error like The
rocedure entry point sqlite3_backup_finish could not be loacated in
the dynamic link library Sqlite3.dll

what i have to do next? pls help...

--
ThanksRegards
B.Venkata Reddy,
Mob:9959345033.

   ok, i got the same error and got verry frustrated.. i had only
   the .dll and the .exe sqlite3 files but not the .def one.. i just
   downloaded the .def too and worked like a charm :)

-- 
You received 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: Observe_filed Rails 3.

2010-11-15 Thread MDM
I just noticed that the form_tag does an ajax call when a submit
button is pressed, but when it is submitted via a
Form.Element.Observer it goes by html.

Does anyone know how can I force the Form.element.Observer to send an
ajax call instead of an html call.

On Nov 14, 9:06 am, Anh Tang anhnta...@gmail.com wrote:
 Thanks for posting...I've been trying to figure out how to do the same
 thing.

 On Sat, Nov 13, 2010 at 8:39 PM, MDM don.m...@gmail.com wrote:
  Here is my full code if anyone is interested. This code Observes the
  text_field_tag search every 2 seconds and if there is a change in
  the value it triggers a search automatically. The submit button can
  now be done away with I think. I might add :autocomplete =
  off, :onKeyPress=return disableEnterKey(event)) % to the
  text_field_tag to disable the return key, not sure.

  In my index.html.erb I have:-

     h1Listing homepages/h1
     div id = testsearch
        %=render :partial = 'homepage'%
     /div
     %= form_tag homepages_path, :method = 'get', :remote = true do
  %
     %= label_tag(:search, Search for:) %
     %= text_field_tag :search, params[:search]%
     %= submit_tag search, :name = nil %
     %end%

     %= set_focus_to_id 'search' %               // I have a helper
  set_focus_to_id

     script
     document.observe(dom:loaded, function() {   // ensures the page
  is loaded first
     new Form.Element.Observer(                          // Observes
  the text_field_tag every 2 seconds
       'search',
       2,
       respondToChange                         //refrences the function
  in the Layout head
     )                                                       // on a
  change in search calls respondToChange
     });
     /script
     br /
     %= link_to 'New Homepage', new_homepage_path %

  In my application Layout head I have:_

     script
     function respondToChange() {
     $('search').up('form').submit()            // The .up finds the
  form in the DOM
     };
     /script

  In my controller#index I have:-

      def index
      �...@homepages = Homepage.search(params[:search]) //.search method
  is in the Model
       respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml = @homepages }
        format.js
      end
     end

  In my Model I have:-

     def self.search(search_item)
        if search_item
         self.where('section LIKE ?', %#{search_item}%)    //Handles
  the ajax call.
        else
         self.all                                            //Handles
  the html call on startup.
        end
     end

  In the helper I have:-

     def set_focus_to_id(id)
       javascript_tag($('#{id}').focus());
     end

  In the _homepage partial I have:-

     table
       tr
         thId/th
         thSection/th
         thLink/th
         thDescription/th
         th/th
         th/th
         th/th
      /tr

     % for homepage in @homepages %

       tr
         td%= homepage.id %/td
         td%= homepage.section %/td
         td%= homepage.link %/td
         td%= homepage.description %/td
         td%= link_to 'Show', homepage %/td
         td%= link_to 'Edit', edit_homepage_path(homepage) %/td
         td%= link_to 'Destroy', homepage, :confirm = 'Are you
  sure?', :method = :delete %/td
       /tr
     %end%

     /table

  And in the index.js.erb I have:-

     $('testsearch').update(%= escape_javascript(render :partial =
  'homepage') %);

  If anyone has any comments on how I could improve this please contact
  me or say so.

  On Nov 14, 1:18 am, MDM don.m...@gmail.com wrote:
   Walter Many thanks I have cracked it.

   $('search').up('form').submit()

   I will post the whole code later.  I owe you a drink. Contact me on
   donsgarden.co.uk

   Don

   On Nov 13, 1:48 pm, Walter Lee Davis wa...@wdstudio.com wrote:

On Nov 12, 2010, at 9:08 PM, MDM wrote:

 With thanks to themiddleman and agnaki somewhere out there in the
 ether, I have solved the problem:-

 Use respondToChange not respondToChange()

 As the parensthesis () execute the function wheras without () it
 references it.

 $('search').observe('change', respondToChange()); only triggers when
 the focus is moved away from the text_field.

 new Form.Element.Observer(
  'search',
  1,
  respondToChange()
 ) }); repeatedly checks the
  text_field
 and call the function every 1 second if there is a any change.

 I now only have one small problem.
 How to call the form_tag from the function.
 Anyone have any ideas.

You might try this.up('form') inside your function, as inside the
anonymous function, this is set to the 'search' field. If that doesn't

work, you can always do it long-hand with myForm = $
('search').up('form').

Walter

  --
  You received this message because you are subscribed to the Google Groups
  Ruby on Rails: Talk group.
  To post to this group, send email to 

[Rails] Re: Why is my model relationship fails? (has_one and belongs_to)

2010-11-15 Thread Marnen Laibow-Koser
arga aridarma wrote in post #961713:
 Dear all,
 This is a repost of my question, because the first post is considered as
 thread
 hijack.
 I have changed the title, hopefully this time it's not hijacking any
 threads :D

Still hijacking.  Please start a new thread.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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 install ror on windows 7

2010-11-15 Thread Marnen Laibow-Koser
MarcRic wrote in post #961715:
 Davo,

 When I say alternatives better then both, I mean other HTTP Web
 servers which is the subject now.

 The O.S. of the server is just a matter of taste or a decision already
 made for you.

Not necessarily.  Many of us have significant control over that.


 I have my personal choices concerning O.S. for servers (Servers in
 general not only for Web Servers), but at work that is a corporate
 decision, which involves not only technical, but political and
 commercial decisions, and currently they are under Windows O.S.

 So, my general answer to those that are simply against Windows is:
 stay out of the IT corporate business.

Excuse me?  I'm quite happily working in a corporate IT job.  I still 
hate Windows.

 Do only your personal choice
 stuff with the resources you can afford, because in the corporate
 industry, some decisions are made for you, not by you. And if you play
 the game you will follow their rules not yours.

Depends.  We're using Rails (on Linux) with MS SQL (on Windows).  I can 
live with that because I don't ever really have to touch the Windows 
box.

OTOH, I would have little hesitation turning down a Rails dev job where 
I was forced to use either a Windows server or a Windows development 
computer.  I'm quite happy to refuse to play by their rules if those 
rules make no sense.


 The origins of the Trainer On Rails site is an effort to prove that
 the Windows users minority can develop cool stuff using Ruby on
 Rails in a productive way under Windows, apart from which Server's
 O.S. will support the application in the end.

Oh, I know you *can*.  I just don't see why it's worth the bother.


 Regards.

 --
 MarcRic
 www.marcric.com
 http://marcricblog.blogspot.com/
 http://www.traineronrails.com/
 http://groups.google.com.br/group/riorubyrails

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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: Why don't Helpers auto-refresh in development mode?

2010-11-15 Thread rails.n...@gmail.com
I have created a ticket for this on the Inherited Resources page

http://github.com/josevalim/inherited_resources/issues/issue/95

-- 
You received 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: model relationship fails?

2010-11-15 Thread arga aridarma
Ah, sorry. I wasn't aware that there is already a thread called model 
relationship fails? before.
So, I will restart my question in the new email. Hopefully this time, it does 
not hijack another thread.

Thanks

regards,
Arga



- Original Message 
From: Peter Bell pe...@pbell.com
To: rubyonrails-talk@googlegroups.com
Sent: Tuesday, November 16, 2010 6:32:49
Subject: Re: [Rails] Re: model relationship fails?

He's suggesting that if you want to ask a new question, you create a new 
subject 
line and post a separate email. Keeps it easier for everyone to follow the 
content for a given topic.

FWIW, I'm not jumping in with an opinion on whether your request was relevant 
to 
the original thread or not - wasn't following it. Just describing what people 
usually mean when they say hijacking threads and aren't talking about some 
kind of weird concurrency bug :)

Best Wishes,
Peter

On Nov 15, 2010, at 6:22 PM, arga aridarma wrote:

 eh?
 what do you mean by hijack the threads?
 
 Regards,
 Arga
 
 
 


-- 
You received 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: Filter records by dates occurring this year

2010-11-15 Thread KT
Thanks for your responses everyone.  Sorry for the delay in re-
posting, I've been away from computer.

@Erol   :current_year is an application helper method to pull the
current year!
I'll try your suggestions, as well and report back.  Thank you


@Hassan  I will try a debugger, too - thanks for the reminder.



On Nov 15, 2:31 am, Erol Fornoles erol.forno...@gmail.com wrote:
 On Mon, Nov 15, 2010 at 6:24 PM, Erol Fornoles erol.forno...@gmail.comwrote:

  Assuming your :dob is a date

  Try :conditions = ['dob BETWEEN ? AND ?', Date.today.beginning_of_year,
  Date.today.end_of_year]

 Wait let me correct that, but first, is :current_year a field or column in
 your table or a parameter that was meant to be passed to the named_scope?

 --
 Erol M. 
 Fornoleshttp://github.com/Erolhttp://twitter.com/erolfornoleshttp://ph.linkedin.com/in/erolfornoles

-- 
You received 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: Why is my model relationship fails? (has_one and belongs_to)

2010-11-15 Thread Brian Troutwine
On Mon, Nov 15, 2010 at 7:44 PM, Marnen Laibow-Koser
li...@ruby-forum.com wrote:
 arga aridarma wrote in post #961713:
 Dear all,
 This is a repost of my question, because the first post is considered as
 thread
 hijack.
 I have changed the title, hopefully this time it's not hijacking any
 threads :D

 Still hijacking.  Please start a new thread.

What are you talking about? I'm reading this via the mailing list; on
this end of things _both_ of arga's mails are hijacking nothing.

 Best,
 --
 Marnen Laibow-Koser
 http://www.marnen.org
 mar...@marnen.org

 --
 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.



Bls: [Rails] Re: Why is my model relationship fails? (has_one and belongs_to)

2010-11-15 Thread arga aridarma
Ok..i'm getting confused. Is there anyway that i can check whether my thread is 
hijacking other thread before i post my question? 
And by starting new thread, you mean that post an email to the group using 
unique subject, am i correct?

regards,
Arga

Pada Sel, 16 Nov 2010 07:44 ICT Marnen Laibow-Koser menulis:

arga aridarma wrote in post #961713:
 Dear all,
 This is a repost of my question, because the first post is considered as
 thread
 hijack.
 I have changed the title, hopefully this time it's not hijacking any
 threads :D

Still hijacking.  Please start a new thread.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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] Re: Why is my model relationship fails? (has_one and belongs_to)

2010-11-15 Thread Erol Fornoles
On Tue, Nov 16, 2010 at 10:50 AM, Brian Troutwine br...@troutwine.uswrote:

 On Mon, Nov 15, 2010 at 7:44 PM, Marnen Laibow-Koser
 li...@ruby-forum.com wrote:
  arga aridarma wrote in post #961713:
  Dear all,
  This is a repost of my question, because the first post is considered as
  thread
  hijack.
  I have changed the title, hopefully this time it's not hijacking any
  threads :D
 
  Still hijacking.  Please start a new thread.

 What are you talking about? I'm reading this via the mailing list; on
 this end of things _both_ of arga's mails are hijacking nothing.


If you check via Google Groups, it did.

-- 
Erol M. Fornoles
http://github.com/Erol
http://twitter.com/erolfornoles
http://ph.linkedin.com/in/erolfornoles

-- 
You received 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: Why is my model relationship fails? (has_one and belongs_to)

2010-11-15 Thread Erol Fornoles
On Tue, Nov 16, 2010 at 10:53 AM, arga aridarma arga_arida...@yahoo.comwrote:

 Ok..i'm getting confused. Is there anyway that i can check whether my
 thread is hijacking other thread before i post my question?
 And by starting new thread, you mean that post an email to the group using
 unique subject, am i correct?


Yes, and it should be a newly composed email and not one from a reply.

-- 
Erol M. Fornoles
http://github.com/Erol
http://twitter.com/erolfornoles
http://ph.linkedin.com/in/erolfornoles

-- 
You received 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   >