[Rails] trouble with rails-ckeditor gem "form_tag"

2011-06-30 Thread Pravin Mishra
Hi All,

I am trying to use the rails-ckeditor gem and running into some problems.
It is working fine for FORM_FOR but when implimenting on FORM_TAG, it
giving errot  "undefined method `ckeditor_textarea_tag' for
#<#:0x917e848>".

My view field is <%= ckeditor_textarea_tag :msg, :toolbar=>'Full',
:width => '100%', :height => '200px' %>

Here i c't put <%= ckeditor_textarea("object", "field", :width =>
'100%', :height => '200px') %> because it is for FORM_FOR. it will
expect object and field from me which i have not in FORM_TAG.

So what is the proper syntex and what should i Use here. Any help and
link will apriciated.

thanks in advance.

+++
Pravin Mishra

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



Re: [Rails] Help with cross information between different websites

2011-06-30 Thread Chirag Singhal
Hi Rogrigo

What Sergio is trying to say here is something like this:
1. You can have 3 different Rails apps for this, with 3 different databases. 
And then for the admin app, you can connect to the client app and company 
app database and pull information from there. For this, you will have to 
specify two other databases in your database.yml file, one with connection 
details of client app database and another with connection details for 
company app database.
Then either you can direct do sql queries on those databases or define 
corresponding models for the related tables in your admin app, and ask them 
to connect to right database. Using something like this in the model - 
"establish_connection 'company_database' "

2. Have 3 different Rails apps but use the same database for all three. Then 
you directly have access to all the company and client data in your admin 
app as well.

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



[Rails] Re: Rails Installer Problem

2011-06-30 Thread Chirag Singhal
If you prefer to do these things through GUI, then use "git gui", it will 
open up a nice gui for you where you can select which files should be 
committed, specify the commit comments, commit and push to the server.

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



[Rails] Re: How to play with shoulda with functional testing

2011-06-30 Thread Chirag Singhal
There's a Teach me to code screencast which may be helpful 
- http://teachmetocode.com/screencasts/shoulda-on-rails/
And some basic documentation on Rails wiki 
- http://wiki.rubyonrails.org/testing/shoulda

Some of the official documentation here:
https://github.com/thoughtbot/shoulda#readme
https://github.com/thoughtbot/shoulda-context#readme
https://github.com/thoughtbot/shoulda-matchers#readme

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



[Rails] Re: CanCan with Devise Invitable

2011-06-30 Thread Andrew Skegg
Walter Lee Davis  writes:

> Of course, and I've done that for the few User things that happen  
> inside the UsersController. But Devise Invitable injects its methods  
> into the User model, so there are all sorts of controllers buried  
> deeply in the Gem source tree that I don't have access to. In Rails  
> 2.3, I would just freeze the gems and hack them up there, but I  
> haven't found a way to do that in the brave new Bundler world.  
> Freezing there is kind of like compiling the code or something.
> 
> Walter

I may have misunderstood your question, but I don't see the need to access or 
change Devise's controllers directly.  You have control over your User model 
and the Controllers which utilise it, so you should be able to enforce your 
business logic as described.  I would not worry too much about the methods 
Devise injects into your models - you control access to them.

In the brave new world of Bundler, there is no easy method of freezing gems 
into your app in a reliable fashion.  I am sure you may be able to get 
something working, but I sense it will be brittle and ultimately frustrating.



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



Re: [Rails] Re: CanCan with Devise Invitable

2011-06-30 Thread Walter Lee Davis


On Jun 30, 2011, at 8:28 PM, Andrew Skegg wrote:


Walter Lee Davis  writes:



Has anyone used this combination before? I am curious how I am going
to enforce my authorization rules beyond the view layer w/r/t
invitations.

Certain groups of users will be able to invite new users, but most
will not. When one group of users makes invitations, that magically
sets the role of the invited user to a particular group, and locks
that invited user into a Practice inherited from the person who
invited them.

Since the Devise Invitable controller lives in a gem, how can I reach
in there and extend it to be aware of these restrictions?

Thanks in advance,

Walter




Since all requests must be handled by a Controller, you can simply  
bake your

business logic into the controller in question. For example:

load_and_authorize_resource # Be sure to specify who can create  
Users in

ability.rb

def create
 user = User.create params[:user]
 user.roles << current_user.roles # Or whatever floats your boat
end


Of course, and I've done that for the few User things that happen  
inside the UsersController. But Devise Invitable injects its methods  
into the User model, so there are all sorts of controllers buried  
deeply in the Gem source tree that I don't have access to. In Rails  
2.3, I would just freeze the gems and hack them up there, but I  
haven't found a way to do that in the brave new Bundler world.  
Freezing there is kind of like compiling the code or something.


Walter



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



[Rails] Re: Trying to upgrade a rails app from 2.3.2 to 2.3.11

2011-06-30 Thread Jay
thanks man!
I'm going to try that right now... that makes a bunch of sense.  I
appreciate you taking the time to respond.

On Jun 29, 11:50 pm, Chirag Singhal  wrote:
> Rename your template from new.rjs.js to new.js.rjs and it should 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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] How to format dates and telephones in form_for?

2011-06-30 Thread Leoncio Caminha
make on javascript for that and call in :onkeypress => 'yourJS(this);' i think 
so
Em 30/06/2011, às 22:23, Rodrigo Ruiz escreveu:

> Well, that's basically it, how can I make an input field for date like 
> mm/dd/ and for telephone like +xx (xx) -.
> 
> Thank you,
> Rodrigo
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

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



[Rails] How to format dates and telephones in form_for?

2011-06-30 Thread Rodrigo Ruiz
Well, that's basically it, how can I make an input field for date like
mm/dd/ and for telephone like +xx (xx) -.

Thank you,
Rodrigo

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



Re: [Rails] Help with cross information between different websites

2011-06-30 Thread Rodrigo Ruiz
what is query? and I don't know if thats what you understood, but I thought
about making the different websites in different projects

On Fri, Jul 1, 2011 at 12:37 AM, Sergio Sergio wrote:

> It depends on the architecture of your project. You could have one database
> for the clients app and one for the companies app, and in the companies app
> project you could connect to both databases(companies and clients) and just
> query the clients database for information. That's one solution, as I
> mentioned, It all depends on the architecture
>
> 2011/6/30 Rodrigo Ruiz 
>
>> Hi everyone, I'm developing an application that involves 3 websites: one
>> for the clients, one for other companies (kinda like other type of client),
>> and one the admin.
>>
>> I'd like to know how to get information from each an manipulate, for
>> example: I want to get the number of clicks on a link in the menu of the
>> clients website, and wanna display this information at the companies
>> website.
>>
>> Thank you,
>> Rodrigo
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

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



Re: [Rails] Re: Rails Installer Problem

2011-06-30 Thread Noel
try
git commit -m "Initial."

On Thu, Jun 30, 2011 at 1:38 PM, frandan...@gmail.com
 wrote:
> That did it.  Thanks.
>
> New problem...
>
> C:\Sites\ridemo>git init
> Initialized empty Git repository in C:/Sites/ridemo/.git/
>
> C:\Sites\ridemo>git add .
>
> C:\Sites\ridemo>git commit "Initial."
> error: pathspec 'Initial.' did not match any file(s) known to git.
>
>
>
>
> On Jun 30, 10:31 am, Tim Shaffer  wrote:
>> You probably need to designate that directory as a git repository first.
>>
>> git init
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: CanCan with Devise Invitable

2011-06-30 Thread Andrew Skegg
Walter Lee Davis  writes:

> 
> Has anyone used this combination before? I am curious how I am going  
> to enforce my authorization rules beyond the view layer w/r/t  
> invitations.
> 
> Certain groups of users will be able to invite new users, but most  
> will not. When one group of users makes invitations, that magically  
> sets the role of the invited user to a particular group, and locks  
> that invited user into a Practice inherited from the person who  
> invited them.
> 
> Since the Devise Invitable controller lives in a gem, how can I reach  
> in there and extend it to be aware of these restrictions?
> 
> Thanks in advance,
> 
> Walter
> 


Since all requests must be handled by a Controller, you can simply bake your 
business logic into the controller in question. For example:

load_and_authorize_resource # Be sure to specify who can create Users in 
ability.rb

def create
  user = User.create params[:user]
  user.roles << current_user.roles # Or whatever floats your boat
end

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



[Rails] CanCan with Devise Invitable

2011-06-30 Thread Walter Lee Davis
Has anyone used this combination before? I am curious how I am going  
to enforce my authorization rules beyond the view layer w/r/t  
invitations.


Certain groups of users will be able to invite new users, but most  
will not. When one group of users makes invitations, that magically  
sets the role of the invited user to a particular group, and locks  
that invited user into a Practice inherited from the person who  
invited them.


Since the Devise Invitable controller lives in a gem, how can I reach  
in there and extend it to be aware of these restrictions?


Thanks in advance,

Walter

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



[Rails] Re: Hash each where

2011-06-30 Thread Andrew Skegg
Sebastian  writes:

> 
> Thank you,
> 
> that was exactly what I was looking for!!!
> 

Further to the solution provided, if the data is coming from a database, then 
you can create some scopes to filter the information for you.  It might be 
faster than looping through the array.

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



Re: [Rails] Should I use has_one or belongs_to?

2011-06-30 Thread Leoncio Caminha
use has_one and belongs_to and i guess: store each others for maintain 
integrity is the best way, always
Em 30/06/2011, às 19:42, Rodrigo Ruiz escreveu:

> I have a one-to-one relationship between 2 models, should I store each others 
> id on both objects or just in one?
> 
> Thank you,
> 
> Rodrigo
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

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



[Rails] Should I use has_one or belongs_to?

2011-06-30 Thread Rodrigo Ruiz
I have a one-to-one relationship between 2 models, should I store each
others id on both objects or just in one?

Thank you,

Rodrigo

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



Re: [Rails] Help with cross information between different websites

2011-06-30 Thread Sergio Sergio
It depends on the architecture of your project. You could have one database
for the clients app and one for the companies app, and in the companies app
project you could connect to both databases(companies and clients) and just
query the clients database for information. That's one solution, as I
mentioned, It all depends on the architecture

2011/6/30 Rodrigo Ruiz 

> Hi everyone, I'm developing an application that involves 3 websites: one
> for the clients, one for other companies (kinda like other type of client),
> and one the admin.
>
> I'd like to know how to get information from each an manipulate, for
> example: I want to get the number of clicks on a link in the menu of the
> clients website, and wanna display this information at the companies
> website.
>
> Thank you,
> Rodrigo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

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



[Rails] Re: Beginner's question: Rails 3 and MySQL on Windows

2011-06-30 Thread Barney
Sorry, left out a step from the above:

 Get a dll:
http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
and put it in c:\ruby192\bin   with other dlls

That's before, of course, running:   rake db:migratein the ruby
command line shell

 Barney

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



[Rails] Capybara 'within' method not recognized in RSpec

2011-06-30 Thread David Zhang
This is my spec_helper.rb file:

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec' # doesn't work...<=

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

RSpec.configure do |config|
  # == Mock Framework
  #
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate 
line:
  #
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr
  config.mock_with :rspec

  # Remove this line if you're not using ActiveRecord or ActiveRecord 
fixtures
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  # If you're not using ActiveRecord, or you'd prefer not to run each of 
your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = true
end


Oddly, although I followed the instruction on the github page, this fails:

it "shows a list of all organizations" do
render
within("ul#organization_list") do
  rendered.should have_selector("li.sort")
end   
 end

with this error:
1) superadmin/organizations/index.html.erb shows a list of all organizations
 Failure/Error: within("ul#organization_list") do
 NoMethodError:
   undefined method `within' for 
#


Why might that be?  I'm using Rails 3.1rc4, and my Gemfile should be all 
set:

source 'http://rubygems.org'

gem 'rails', '3.1.0.rc4' # using ruby 1.9.2p180

gem 'mysql2' # using mysql db
gem 'authlogic' # smart user authentication
gem 'dynamic_form' # easy error messages for forms

# Asset template engines
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-script'
gem 'uglifier' # compresses JS code for production

gem 'jquery-rails'

group :test do
# helpers
gem 'factory_girl_rails'
gem 'forgery'
gem 'database_cleaner'
 # core testing frameworks
gem 'rspec-rails', '>= 2.6.1'
gem 'cucumber-rails', '>= 1.0.0'
gem 'capybara', '>= 1.0.0'
  # Pretty printed test output
  gem 'turn', :require => false
end

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

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



[Rails] Re: Beginner's question: Rails 3 and MySQL on Windows

2011-06-30 Thread Barney
Well, to use a former co-workers phrase, "I've been crawling over
broken glass", trying everything and seemed to have found something
that worked:  1) I downloaded and installed MySQL community edition
5.5.13, even though it isn't on anyone's recommended list and 2)
installed a gem for mysql-2.8.1-x86-mingw32 which I saw recommended
somewhere, then 3) modified John's yml file from above to be:

development:
  adapter: mysql
  encoding: Latin1
  reconnect: false
  database: mysql
  pool: 5
  timeout: 5000
  username: a
  password: a

and the line: rake db:migrate  finally worked and made a table with
the data I had in that file.  Also, I could add a couple of records
via the screen from http://localhost:3000/people
 so I think I can make progress from here.  Thanks to John and Chirag
for taking the time to point me in some good directions!
   Barney

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



[Rails] Re: Testing RSpec views: the index action; is my methodology flawed?

2011-06-30 Thread David Zhang
Oh, of course... thank you. How silly of me.

Question:  Do you recommend stubbing/mocking models?  Or could I just 
specify the real model as I did here?

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



[Rails] Re: Rails Installer Problem

2011-06-30 Thread frandan...@gmail.com
That did it.  Thanks.

New problem...

C:\Sites\ridemo>git init
Initialized empty Git repository in C:/Sites/ridemo/.git/

C:\Sites\ridemo>git add .

C:\Sites\ridemo>git commit "Initial."
error: pathspec 'Initial.' did not match any file(s) known to git.




On Jun 30, 10:31 am, Tim Shaffer  wrote:
> You probably need to designate that directory as a git repository first.
>
> git init

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



[Rails] Help with cross information between different websites

2011-06-30 Thread Rodrigo Ruiz
Hi everyone, I'm developing an application that involves 3 websites: one for
the clients, one for other companies (kinda like other type of client), and
one the admin.

I'd like to know how to get information from each an manipulate, for
example: I want to get the number of clicks on a link in the menu of the
clients website, and wanna display this information at the companies
website.

Thank you,
Rodrigo

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



[Rails] Re: Plugins from Vedor not loaded after bundler is installed

2011-06-30 Thread Ajit
Ashok

not sure why Plugins are not loading.. they should be. if you have a
list of plugins and one fails while loading environment.. it will
cancel all others to load.

do you have log trace??

Ajit

On Jun 29, 12:06 pm, Ashok Vijayendra  wrote:
> Hi,
>
> We are in a process of upgrading to rails 3 from rails 2.3.11. As a
> first step towards that, we are making the application to work with
> bundler. After doing bundle install,When I try to do script/console, I
> see none of my vendor plugin code is loaded, I get not defined error.
>
> can someone help me?
>
> Thanks

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



[Rails] Re: form_for routing issue

2011-06-30 Thread Ajit
It seems like you already have a member.

Post works for create. you should be using Put.. because it seems like
an update.

Ajit

On Jun 30, 10:34 am, Erwin  wrote:
> I defined a renew route for membership resources as following :
>
>     scope 'users' do
>       
>       resources :memberships  do
>         member do
>           post 'renew'
>         end
>       end
>      
>    end
>
> which leads to:
> renew_membership POST   (/:locale)/users/memberships/:id/
> renew(.:format) {:action=>"renew", :controller=>"memberships"}
>
> and in my view , my form helper is written as :
>         = form_for membership,  :url => renew_membership_path(membership) do |
> f|
>        ...
> generating the following HTML code :
>
>  method="post">
>
> 
> 
> 
> 
>
> submitting the form, I get a routing error :
>
> Started POST "/users/memberships/1034/renew" for 127.0.0.1 at
> 2011-06-30 16:33:08 +0200
>   Processing by ErrorsController#routing as HTML
>   Parameters: {"utf8"=>"✓", "authenticity_token"=>"MDNH/
> VmfJHBTgur3lksWEEuU5Rp02v70s8UFGR3hxG4=", "commit"=>"Renew this
> Membership",  "a"=>"users/memberships/1034/renew"}
>
> what could be wrong ?

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



[Rails] Re: Testing RSpec views: the index action; is my methodology flawed?

2011-06-30 Thread David Chelimsky


On Jun 30, 2:01 pm, David Zhang  wrote:
> This is my organizations_controller_spec.rb:
>
> require 'spec_helper'
>
> describe Superadmin::OrganizationsController do
>   describe "GET index" do
>     it "shows a list of all organizations" do
>       #pending "don't know why this doesn't work"
>       Organization.should_receive(:all)


You've got to actually invoke the action here:

get :index

HTH,
David

>     end
>   end
>
> end
>
> 
>
> This is my controllers/superadmin/organizations_controller.rb:
>
> class Superadmin::OrganizationsController < ApplicationController
>   def index
>     @organizations = Organization.all
>   end
> end
>
> Oddly, this doesn't pass:
>
> 1) Superadmin::OrganizationsController GET index shows a list of all
> organizations
>      Failure/Error: Organization.should_receive(:all)
>        ( updated_at: datetime) (class)>).all(any args)
>            expected: 1 time
>            received: 0 times
>
> Is my methodology incorrect?

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



[Rails] Testing RSpec views: the index action; is my methodology flawed?

2011-06-30 Thread David Zhang
This is my organizations_controller_spec.rb:

require 'spec_helper'

describe Superadmin::OrganizationsController do
  describe "GET index" do
it "shows a list of all organizations" do
  #pending "don't know why this doesn't work"
  Organization.should_receive(:all)
end
  end
  
end



This is my controllers/superadmin/organizations_controller.rb:

class Superadmin::OrganizationsController < ApplicationController
  def index
@organizations = Organization.all
  end
end


Oddly, this doesn't pass:

1) Superadmin::OrganizationsController GET index shows a list of all 
organizations
 Failure/Error: Organization.should_receive(:all)
   ().all(any args)
   expected: 1 time
   received: 0 times

Is my methodology incorrect?

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



[Rails] Re: How to play with shoulda with functional testing

2011-06-30 Thread David Zhang
Might I suggest using Cucumber and RSpec to test?  It's becoming the classic 
(and arguably best) way.  In fact, it's the way detailed in The RSpec Book, 
and it's used and supported by many.

http://cukes.info/
http://railscasts.com/episodes/155-beginning-with-cucumber
http://rspec.info/rails/
https://github.com/dchelimsky/rspec

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



[Rails] Re: Beginner's question: Rails 3 and MySQL on Windows

2011-06-30 Thread Barney
Hi Guys,
 Thanks for the replies, but I'm still stuck with "rake
db:migrate" failing.  I get a popup window that says that LIBMYSQL.DLL
can't be found and the command line says that c:/ruby192/lib/ruby/gems/
ruby 1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so  can't be
found (the statement has the Windows slashes backward but I don't know
where that request is coming from in the code and I suspect that it
doesn't matter, anyway).  Using the parameter "--trace" shows a lot of
lines but none of them are marked as creating the error.  I've
installed MySQL 5.5.13 today from the MySQL.com community site but I
have no evidence that that is being used.
 Any suggestions on what is stopping this progress would really be
appreciated!
Barney

On Jun 30, 9:20 am, John Ivanoff  wrote:
> example yml setting
>
> development:
>   adapter: mysql
>   encoding: utf8
>   reconnect: false
>   database: name_of_database
>   pool: 5
>   username: agoodone
>   password: secret
>   socket: /tmp/mysql.sock
>
> I've always used mysql Gem
>
> > gem install mysql
>
> John
>
> On Jun 30, 7:58 am, John Ivanoff  wrote:
>
> > I have a posthttp://bit.ly/lNxcB1whereI did a clean install for
> > rails 3 any MySQL. I am also using MySQL 5.1 on Win XP
> > It is a pain to get it going on windows but once you do it run OK.
> > Also on my blog I've posted a few gotcha's I've had with windows and
> > some gems.
>
> > Hope it helps.
>
> > John
>
> > On Jun 30, 2:20 am, Chirag Singhal  wrote:
>
> > > Easiest way to get started with Rails on Windows is to use RailsInstaller 
> > > -http://railsinstaller.org/
>
> > > MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while
> > > installing either choose the option where mysql exe is added to path or 
> > > copy
> > > libmysql.dll after installation to ruby's bin folder.
>
> > > If this doesn't work, then post the exact error you encounter and we will
> > > take it from there.

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



[Rails] How to play with shoulda with functional testing

2011-06-30 Thread Yennie
Hi,

I am new in rails testing, and now i try to use shoulda to test the
functional section.
can anyone give me some advice, example or recommend tutorial site to
me..

thanks

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



[Rails] Re: Rails Installer Problem

2011-06-30 Thread Tim Shaffer
You probably need to designate that directory as a git repository first.

git init

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



[Rails] Rails Installer Problem

2011-06-30 Thread frandan...@gmail.com
Hello. Thanks to all who made the rails installer possible.

I'm going through the video tutorial and am stuck at point 7:00 where
we're adding to github.  Everything went smoothly up to that point.

C:\Sites\ridemo>git add .
fatal: Not a git repository (or any of the parent directories): .git

What to do?

Thanks in advance,
Dan

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



[Rails] nested routes with namespaced models

2011-06-30 Thread Evan C
Hi all.  I'm having some trouble with nested routes and duplicate
namespaces.
I have an Article and Advert model,  both with an associated
Publication model:


class Article
  has_one :publication
end

class Article::Publication
  belongs_to :article
end

class Advert
  has_one :publication
end

class Advert::Publication
  belongs_to :advert
end


Each Publication model is different enough that it makes no sense to
have just one Publication model with  STI or polymorphism.  Also,
there are numerous other models such as Cancellation, Payment etc that
are namespaced for the same reason.

here's the routes I have for the above resources:

resources :articles do
  resource :publication, :module => :article
end

resource :adverts do
  resource :publication, :module => :article
end


this gives me article_publication_path and advert_publication_path
which are fine.  The problem occurs with polymorhic_url (used by
form_for).  Given [@article, @publication], it will try to generate
article_article_publication_url which of course hasn't been defined.
I've tried several of the options in the rails routing guide to no
avail so for now, I'm manually specifying the path in form_for

has anyone come across something similar or do you know of a potential
solution?

thanks, Ev

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



[Rails] Re: Sorting Text in ROR

2011-06-30 Thread pepe
If I were you I would add a new column PLAIN_NAME or similar and I
would strip everything out everything you don't want in the name and
then sort by it. I think it would remove the complexity. You can
populate the new column with a before_save callback.

On Jun 10, 10:59 am, Runa  wrote:
> While sorting /ordering text it considers space first, then '.' then
> characters
>
>  e.g.   @user = User.find(:all,:order=>'name')
>
> it outputs
>
> A Sharma
> A. Bansal ---with dot
> Aarti Dev
>
> Is there any way to sort, so that i get the output as
> Aarti Dev
> A. Bansal
> A Sharma

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



Re: [Rails] Need a Ruby on Rails expert

2011-06-30 Thread Basil Babu
Hello Leah and Donna:

Greets!

How are you doing ?

First of all; I am Basil Babu, CEO for Talinoz IT Systems (www.talinoz.com).
We based in Kochi, the southern part if India.

I am quiet sure I can help you both in your requirements as I have been
serving many client for 6-7 years. Once you dont mind to compromise to have
the remote development, your sorrows are over. We have good team.

Apart from us; once you need extra work force than we can offer, I know alot
of ROR guys and companies who is good to serve as I am a universal marketing
person for Indian IT companies.

Kindly find my profile by GOOGLE my name "Basil Babu", you will find what I
expressed is quiet truth. I am very transparent person and always open to
help. Please feel free to include me.

Wishing you the best and fruitful time ahead!



On Thu, Jun 30, 2011 at 6:47 PM, Leah Toth  wrote:

> Hi Donna - I feel your pain.  I've been looking heavily for a Ruby Engineer
> - we are willing to give a lot for the right person but I'm not finding
> one.
> Our site is built on Ruby and we need someone who can jump in and begin
> pair programming.
> Leah Toth - ModCloth
> l.t...@modcloth.com
>
>
>
> On Wed, Jun 29, 2011 at 8:52 PM, Donna Martini wrote:
>
>> I am looking for a Ruby on Rails expert willing to build out a new
>> site which has been designed and is ready for programming.  Anyone
>> interested, please email for specifics.  This is a one to two month
>> project with the potential for long term employment.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>
>
> --
> Leah Toth
> ModCloth Talent Acquisition
> l.t...@modcloth.com
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>



-- 
Thanks and regards

Basil Babu
Managing Partner
Talinoz IT Systems

Mobile : +91 9633900455
Skype : basil.biz | Email: ba...@talinoz.com 

Linkedin profile: http://www.linkedin.com/in/basilbabu

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



Re: [Rails] Need a Ruby on Rails expert

2011-06-30 Thread Leah Toth
Hi Donna - I feel your pain.  I've been looking heavily for a Ruby Engineer
- we are willing to give a lot for the right person but I'm not finding
one.
Our site is built on Ruby and we need someone who can jump in and begin pair
programming.
Leah Toth - ModCloth
l.t...@modcloth.com


On Wed, Jun 29, 2011 at 8:52 PM, Donna Martini wrote:

> I am looking for a Ruby on Rails expert willing to build out a new
> site which has been designed and is ready for programming.  Anyone
> interested, please email for specifics.  This is a one to two month
> project with the potential for long term employment.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Leah Toth
ModCloth Talent Acquisition
l.t...@modcloth.com

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



[Rails] Looking for rails hacker and partner

2011-06-30 Thread coolno9
I am looking for a self driven rails hacker who also has business
sense for a project that I am working on. Can be of any nationality,
gender or location but willing to participate full time, and possibly
travel half way around the world, a few times, to set up the thing in
California.

If interested, please write in to 'robertandy1980 at gmail dot com' .

- Coolno9.

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



[Rails] form_for routing issue

2011-06-30 Thread Erwin
I defined a renew route for membership resources as following :

scope 'users' do
  
  resources :memberships  do
member do
  post 'renew'
end
  end
 
   end

which leads to:
renew_membership POST   (/:locale)/users/memberships/:id/
renew(.:format) {:action=>"renew", :controller=>"memberships"}

and in my view , my form helper is written as :
= form_for membership,  :url => renew_membership_path(membership) do |
f|
   ...
generating the following HTML code :








submitting the form, I get a routing error :

Started POST "/users/memberships/1034/renew" for 127.0.0.1 at
2011-06-30 16:33:08 +0200
  Processing by ErrorsController#routing as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"MDNH/
VmfJHBTgur3lksWEEuU5Rp02v70s8UFGR3hxG4=", "commit"=>"Renew this
Membership",  "a"=>"users/memberships/1034/renew"}

what could be wrong ?



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



[Rails] Re: Hash each where

2011-06-30 Thread Sebastian
Thank you,

that was exactly what I was looking for!!!


On 30 Jun., 15:16, Paulo Muggler Moreira 
wrote:
> John's answer. Also, the Ruby Hash
> API
> .
>
>
>
>
>
>
>
> On Thu, Jun 30, 2011 at 10:10, John Feminella  wrote:
> > only_new_entries = array_of_hashes.select { |h| h[:status] == "new" }
>
> > ~ jf
> > --
> > John Feminella
> > Principal Consultant, BitsBuilder
> > LI:http://www.linkedin.com/in/johnxf
> > SO:http://stackoverflow.com/users/75170/
>
> > On Thu, Jun 30, 2011 at 09:07, Sebastian 
> > wrote:
> > > Sorry,
>
> > > yes I have an array of hashes:
>
> > > hash = [{:name => "like", :status => "old"}, {:name => "this", :status
> > > => "new"}, {:name => "here", :status => "old"}]
>
> > > On 30 Jun., 14:31, Michael Pavling  wrote:
> > >> On 30 June 2011 13:27, Sebastian 
> > wrote:
>
> > >> > I have a hash that has a :status key. The value could be 'new' or
> > >> > 'old'.
>
> > >> > Now I want to get only the entries where status is 'new'. I know how
> > >> > to do this with an if-clause, but there has to be a better way.
>
> > >> Do you mean you have an array of hashes? Or a hash where each value is
> > >> an object/array?
> > >> Can you give an illustration of what your hash looks like, so it's
> > >> possible to suggest some solutions.
>
> > >> 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-talk@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-talk@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.

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



[Rails] Re: Beginner's question: Rails 3 and MySQL on Windows

2011-06-30 Thread John Ivanoff
example yml setting

development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: name_of_database
  pool: 5
  username: agoodone
  password: secret
  socket: /tmp/mysql.sock


I've always used mysql Gem
> gem install mysql

John

On Jun 30, 7:58 am, John Ivanoff  wrote:
> I have a posthttp://bit.ly/lNxcB1where I did a clean install for
> rails 3 any MySQL. I am also using MySQL 5.1 on Win XP
> It is a pain to get it going on windows but once you do it run OK.
> Also on my blog I've posted a few gotcha's I've had with windows and
> some gems.
>
> Hope it helps.
>
> John
>
> On Jun 30, 2:20 am, Chirag Singhal  wrote:
>
>
>
>
>
>
>
> > Easiest way to get started with Rails on Windows is to use RailsInstaller 
> > -http://railsinstaller.org/
>
> > MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while
> > installing either choose the option where mysql exe is added to path or copy
> > libmysql.dll after installation to ruby's bin folder.
>
> > If this doesn't work, then post the exact error you encounter and we will
> > take it from there.

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



Re: [Rails] Re: Hash each where

2011-06-30 Thread Paulo Muggler Moreira
John's answer. Also, the Ruby Hash
API
.

On Thu, Jun 30, 2011 at 10:10, John Feminella  wrote:

> only_new_entries = array_of_hashes.select { |h| h[:status] == "new" }
>
> ~ jf
> --
> John Feminella
> Principal Consultant, BitsBuilder
> LI: http://www.linkedin.com/in/johnxf
> SO: http://stackoverflow.com/users/75170/
>
>
>
> On Thu, Jun 30, 2011 at 09:07, Sebastian 
> wrote:
> > Sorry,
> >
> > yes I have an array of hashes:
> >
> > hash = [{:name => "like", :status => "old"}, {:name => "this", :status
> > => "new"}, {:name => "here", :status => "old"}]
> >
> >
> >
> >
> >
> > On 30 Jun., 14:31, Michael Pavling  wrote:
> >> On 30 June 2011 13:27, Sebastian 
> wrote:
> >>
> >> > I have a hash that has a :status key. The value could be 'new' or
> >> > 'old'.
> >>
> >> > Now I want to get only the entries where status is 'new'. I know how
> >> > to do this with an if-clause, but there has to be a better way.
> >>
> >> Do you mean you have an array of hashes? Or a hash where each value is
> >> an object/array?
> >> Can you give an illustration of what your hash looks like, so it's
> >> possible to suggest some solutions.
> >>
> >> 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-talk@googlegroups.com.
> > To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] Re: Hash each where

2011-06-30 Thread John Feminella
only_new_entries = array_of_hashes.select { |h| h[:status] == "new" }

~ jf
--
John Feminella
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/johnxf
SO: http://stackoverflow.com/users/75170/



On Thu, Jun 30, 2011 at 09:07, Sebastian  wrote:
> Sorry,
>
> yes I have an array of hashes:
>
> hash = [{:name => "like", :status => "old"}, {:name => "this", :status
> => "new"}, {:name => "here", :status => "old"}]
>
>
>
>
>
> On 30 Jun., 14:31, Michael Pavling  wrote:
>> On 30 June 2011 13:27, Sebastian  wrote:
>>
>> > I have a hash that has a :status key. The value could be 'new' or
>> > 'old'.
>>
>> > Now I want to get only the entries where status is 'new'. I know how
>> > to do this with an if-clause, but there has to be a better way.
>>
>> Do you mean you have an array of hashes? Or a hash where each value is
>> an object/array?
>> Can you give an illustration of what your hash looks like, so it's
>> possible to suggest some solutions.
>>
>> 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-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Hash each where

2011-06-30 Thread Sebastian
Sorry,

yes I have an array of hashes:

hash = [{:name => "like", :status => "old"}, {:name => "this", :status
=> "new"}, {:name => "here", :status => "old"}]





On 30 Jun., 14:31, Michael Pavling  wrote:
> On 30 June 2011 13:27, Sebastian  wrote:
>
> > I have a hash that has a :status key. The value could be 'new' or
> > 'old'.
>
> > Now I want to get only the entries where status is 'new'. I know how
> > to do this with an if-clause, but there has to be a better way.
>
> Do you mean you have an array of hashes? Or a hash where each value is
> an object/array?
> Can you give an illustration of what your hash looks like, so it's
> possible to suggest some solutions.
>
> 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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Beginner's question: Rails 3 and MySQL on Windows

2011-06-30 Thread John Ivanoff
I have a post http://bit.ly/lNxcB1 where I did a clean install for
rails 3 any MySQL. I am also using MySQL 5.1 on Win XP
It is a pain to get it going on windows but once you do it run OK.
Also on my blog I've posted a few gotcha's I've had with windows and
some gems.

Hope it helps.

John

On Jun 30, 2:20 am, Chirag Singhal  wrote:
> Easiest way to get started with Rails on Windows is to use RailsInstaller 
> -http://railsinstaller.org/
>
> MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while
> installing either choose the option where mysql exe is added to path or copy
> libmysql.dll after installation to ruby's bin folder.
>
> If this doesn't work, then post the exact error you encounter and we will
> take it from there.

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



Re: [Rails] Hash each where

2011-06-30 Thread Michael Pavling
On 30 June 2011 13:27, Sebastian  wrote:
> I have a hash that has a :status key. The value could be 'new' or
> 'old'.
>
> Now I want to get only the entries where status is 'new'. I know how
> to do this with an if-clause, but there has to be a better way.

Do you mean you have an array of hashes? Or a hash where each value is
an object/array?
Can you give an illustration of what your hash looks like, so it's
possible to suggest some solutions.

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



[Rails] Hash each where

2011-06-30 Thread Sebastian
Hi,

this is actually a Ruby question, but I hope I get an answer anyway.

I am looking for a "hash.each.where" function, but I can't find
anything.

I have a hash that has a :status key. The value could be 'new' or
'old'.

Now I want to get only the entries where status is 'new'. I know how
to do this with an if-clause, but there has to be a better way.

What I want is something like this:

puts "New entries"
hash.each where :status => 'new' do |new|
  puts new
end

puts "Old entries"
hash.each where :status => 'old' do |old|
  puts old
end

I thought maybe the hash.select function could help me, but I only
found that example and I don't know how to unse the constraints only
for the :status key and not all keys:

   h = { "a" => 100, "b" => 200, "c" => 300 }
   h.select {|k,v| k > "a"}  #=> {"b" => 200, "c" => 300}
   h.select {|k,v| v < 200}  #=> {"a" => 100}

Thanks in advance
Sebastian

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



Re: [Rails] (jQuery) Accordion and Rails (3.0.9): architectural doubt

2011-06-30 Thread Chris Kottom
This isn't strictly a Rails question, but all the content sections in this
component are just elements of the same HTML document, so that suggests one
controller action / view template.

On Thu, Jun 30, 2011 at 1:13 PM, JB  wrote:

> Hi!
> I'm trying to use jQuery's Accordion (http://jqueryui.com/demos/
> accordion/) in the home page of an app.
>
> One (maybe two...) doubt is bugging me, though...
>
> Do I have to have only one view/controller, holding the actions for
> all the accordion's sections? What if (at least) one of those sections
> have tabs, is it still one view/controller?
>
> Thanks in advance,
>
> José Bonnet
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] (jQuery) Accordion and Rails (3.0.9): architectural doubt

2011-06-30 Thread JB
Hi!
I'm trying to use jQuery's Accordion (http://jqueryui.com/demos/
accordion/) in the home page of an app.

One (maybe two...) doubt is bugging me, though...

Do I have to have only one view/controller, holding the actions for
all the accordion's sections? What if (at least) one of those sections
have tabs, is it still one view/controller?

Thanks in advance,

José Bonnet

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



Re: [Rails] Social Networking

2011-06-30 Thread Sayuj Othayoth
Hi Bernd,

Diaspora is a little crazy to install :)

Diaspora is awesome. But it's developed under rails 2. Do you know, is
Diaspora available on rails 3 also?
Or is there any way to convert a rails 2 app to rails 3?

And, shall I customise Diaspora and use for my personal use on internet? Is
there any problem for this?

thank you,
sayuj o


On Fri, Jun 24, 2011 at 12:37 PM, Bernd Ritter  wrote:

> **
> Hi Sayuj,
>
> try https://joindiaspora.com/ its pretty much what you want, it's open
> source and it's ROR!
>
> Cheers,
> Bernd
>
> Am 24.06.2011 08:16, schrieb Sayuj Othayoth:
>
> Hi,
>
> I want to create a family website which includes social networking
> features.
> The site should have dynamic articles, news, announcements, events, gallery
> etc public.
> And it should have a social networking part for family members.
> Also an admin controller for public contents and social networking
> administration.
>
> I am familiar with Ruby and RoR.
> How can I start with these? Is there any app / cms for this? Will it be
> good to use TDD?
>
> Thank you
> sayuj
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>
> --
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

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

<>

[Rails] Re: Beginner's question: Rails 3 and MySQL on Windows

2011-06-30 Thread Chirag Singhal
Easiest way to get started with Rails on Windows is to use RailsInstaller - 
http://railsinstaller.org/

MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while 
installing either choose the option where mysql exe is added to path or copy 
libmysql.dll after installation to ruby's bin folder.

If this doesn't work, then post the exact error you encounter and we will 
take it from there.

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



Re: [Rails] Error of DEPRECATION WARNING

2011-06-30 Thread Derrek Long
On Wed, Jun 29, 2011 at 6:09 PM, Yennie  wrote:

>
> the error is:
>
> DEPRECATION WARNING: Rake tasks in /home/joanne/Desktop/picto/vendor/
> plugins/prawnto/tasks/prawnto_tasks.rake are deprecated. Use lib/tasks
> instead. (called from  at /home/joanne/Desktop/picto/
> Rakefile:7)
>
>
> thanks for help
>
>

Move the existing *.rake files that exist in the directories listed in the
warning to the lib/tasks directory in your project.
So from the output you show - move th prawnto_tasks.rake file to lib/tasks.

-Derrek

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