Ruby on Rails Thursday, June 30, 2011

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
#<#<Class:0x9180348>: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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

Walter Lee Davis <waltd@...> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

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

Ruby on Rails

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 <chirag.sing...@gmail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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/yyyy and for telephone like +xx (xx) xxxx-xxxx.
>
> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Well, that's basically it, how can I make an input field for date like mm/dd/yyyy and for telephone like +xx (xx) xxxx-xxxx.


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

Ruby on Rails

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 <sergio.sprite@gmail.com> 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 <rodrigo.ruiz7@gmail.com>
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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

try
git commit -m "Initial."

On Thu, Jun 30, 2011 at 1:38 PM, frandansan@gmail.com
<frandansan@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 <timshaf...@me.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Walter Lee Davis <waltd@...> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

We are looking for a Lead Rails Engineer to join our team here at
ngmoco.com in San Francisco. Please contact me for more details.
sdawson@ngmoco.com

Lead Rails Engineer, Global Platform

Come join ngmoco:) and help build the future of mobile entertainment.
We're looking for a talented Ruby on Rails engineer to lead the
development of the developer portal for the Mobage Social
Entertainment Network. In this hands on role, you'll help to guide
the technology choices and user experience for developers using the
Mobage platform. You'll join the talented group of ngmofo:) engineers
building scalable systems in a highly dynamic environment.

Requirements:
- Experience building modern, scalable web applications
- Mad Rails chops
- A burning, itching desire to always ship the best possible thing
- Experience configuring and deploying applications to production
environments
- A thorough understanding of web service technologies
- Possess the ability and experience required to meet requirements and
ship working code on time
- Ability to prioritize between what's necessary and what isn't, and
explain why

Other Key Attributes:
● A passion for social games and social networks.
● Comfort working under tight deadlines in a fast-paced environment.
● Appreciation for being part of a fast-paced startup environment—an
interest in working with a small team to create software used by
millions of people every day.
● Strong communication and time management skills—the ability to
balance high quality work standards against time constraints.
● A relentless passion for creating industry leading products and the
highest quality user experiences.

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

Ruby on Rails

Sebastian <sebastian.goldt@...> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails

Hello,

i am new to Rails and I'm trying to create an Quiz Site.

So how can i store the User_ID, rightanswers, time.

I have a view called "Quiz" it creates with the help of
quiz_controller, a form_tag with one question collect from the
database. So quiz_controller will be called 20 times, for 20
questions. Every time it called, it checks wheter the answer is true
or false.

In my opinion it is the best way to transmit (rember the controller
will called 20 times) the field right_answers / userID / startTime /
endTime by using cookies. But i think client-side cookies are unsecure
so i try the :active_record_store solution. Is this the best way??

Delete Rails the database entry when I call reset_session?

Thank you for your response!

best regards

homy 8)

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

Ruby on Rails

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

Ruby on Rails

Hi everyone,

I've been trying to find a solution for this but can't seem to find
anything. I'm current in Daylight Savings Pacific Time (-07:00). I've
configured all my default time zones to be for Pacific Time (US &
Canada). Everything works fine with ActiveRecords and filtering,
except DateTime.strptime which does not seem to recognize that
daylight savings is in effect.

I have something like this:

self.deadline = DateTime.strptime(deadline_date + " " + deadline_time
+ " " + time_zone, "%m/%d/%Y %H:%M:%S %Z") and it saves just fine
except it's an hour off. Any suggestions/help?

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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 <yves_duf...@mac.com> 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 :
>
> <form accept-charset="UTF-8" action="/en_GB/users/memberships/1034/
> renew" class="edit_membership" id="edit_membership_1034"
> method="post">
>
> <div style="margin:0;padding:0;display:inline">
> <input name="utf8" type="hidden" value="✓">
> <input name="_method" type="hidden" value="put">
> <input name="authenticity_token" type="hidden" value="MDNH/
> VmfJHBTgur3lksWEEuU5Rp02v70s8UFGR3hxG4="></div>
>
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Jun 30, 2:01 pm, David Zhang <dzhan...@gmail.com> 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)
>        (<Organization(id: integer, name: string, created_at: datetime,
> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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)
       (<Organization(id: integer, name: string, created_at: datetime, 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 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails

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 <john.ivan...@gmail.com> 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 <john.ivan...@gmail.com> 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 <chirag.sing...@gmail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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 <l.toth@modcloth.com> 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.toth@modcloth.com



On Wed, Jun 29, 2011 at 8:52 PM, Donna Martini <donna@donnamartini.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Leah Toth
ModCloth Talent Acquisition
 
 

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

Ruby on Rails

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 :

<form accept-charset="UTF-8" action="/en_GB/users/memberships/1034/
renew" class="edit_membership" id="edit_membership_1034"
method="post">

<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="✓">
<input name="_method" type="hidden" value="put">
<input name="authenticity_token" type="hidden" value="MDNH/
VmfJHBTgur3lksWEEuU5Rp02v70s8UFGR3hxG4="></div>

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

Ruby on Rails

Thank you,

that was exactly what I was looking for!!!


On 30 Jun., 15:16, Paulo Muggler Moreira <paulomugg...@gmail.com>
wrote:
> John's answer. Also, the Ruby Hash
> API<http://www.ruby-doc.org/core/classes/Hash.html>
> .
>
>
>
>
>
>
>
> On Thu, Jun 30, 2011 at 10:10, John Feminella <jo...@bitsbuilder.com> 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 <sebastian.go...@googlemail.com>
> > 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 <pavl...@gmail.com> wrote:
> > >> On 30 June 2011 13:27, Sebastian <sebastian.go...@googlemail.com>
> > 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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 <john.ivan...@gmail.com> 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 <chirag.sing...@gmail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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.toth@modcloth.com


On Wed, Jun 29, 2011 at 8:52 PM, Donna Martini <donna@donnamartini.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Leah Toth
ModCloth Talent Acquisition
 
 

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

Ruby on Rails

John's answer. Also, the Ruby Hash API.

On Thu, Jun 30, 2011 at 10:10, John Feminella <johnf@bitsbuilder.com> 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 <sebastian.goldt@googlemail.com> 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 <pavl...@gmail.com> wrote:
>> On 30 June 2011 13:27, Sebastian <sebastian.go...@googlemail.com> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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 <sebastian.goldt@googlemail.com> 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 <pavl...@gmail.com> wrote:
>> On 30 June 2011 13:27, Sebastian <sebastian.go...@googlemail.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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 <pavl...@gmail.com> wrote:
> On 30 June 2011 13:27, Sebastian <sebastian.go...@googlemail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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 <chirag.sing...@gmail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 June 2011 13:27, Sebastian <sebastian.goldt@googlemail.com> 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails

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 <jose.bonnet@gmail.com> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails

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

Ruby on Rails

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 <ritter@decoit.de> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

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

Ruby on Rails Wednesday, June 29, 2011

Try these guys. www.rorguru.com they are the best.

On Wed, Jun 29, 2011 at 5:54 PM, Donna Martini <donna@donnamartini.com> wrote:

Hi, I am looking for an expert ROR developer and having so much trouble finding  one.  I am not interested in ODesk or elance.  Are there any developers in your group looking for work?  D.

 

donna_email_logo

 

"Being born was your gift.

Living life is your challenge.

Being the best you can be is your choice."  D.

 

 

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

Ruby on Rails

Great, happy to help

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

Ruby on Rails

Thanks Chirag, it works fine now.. 




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

Ruby on Rails

Make sure that all references to culture model are removed.


You can use rails destroy model culture

If that still doesn't solve the issue, then please post your test here along with the controller and the model used in the test.

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

Ruby on Rails

Yes, I am using Rails 3.

I did successfully install the shoulda. thank you so much.

but i got some error
 "17) Error:
test_should_get_update(UsersControllerTest):
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: cultures: DELETE FROM "cultures" WHERE 1=1
"

but I did delete the model called culture.. and change it with deterrent name.. may u give me some advice


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

Ruby on Rails

Looks like you are using Rails 3.

In that case, you should be specifying the gem dependency in your Gemfile.

Remove the lines you have added to your environment.rb or application.rb file and the following to your Gemfile

gem 'shoulda'

or better still, define it as a test environment dependency only, by adding this to your Gemfile:

group :test do
  gem 'shoulda'
end

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

Ruby on Rails

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 view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/rxdCYx2GXiwJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

can u help me about this question http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f277b0fadde17bda?hl=en


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

Ruby on Rails

That's not an error, that's a deprecation warning.

The plugin is very old and doesn't seem to be maintained. Probably you can have a look at it's forks on github and pick a more updated version. https://github.com/thorny-sun/prawnto/network

If there aren't any other deprecated methods used in the plugin, then just moving tasks folder inside the lib folder should fix it

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

Ruby on Rails

Hi,

I have trouble about install Shoulda, can someone give me some
instruction to install it
I try some .. it ask me to add those code

Rails::Initializer.run do |config|
config.gem "shoulda", :lib => "shoulda"
end

then i cannot do rake to test units.
it gives me error of

/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/
application.rb:63:in `inherited': You cannot have more than one
Rails::Application (RuntimeError)
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/
deprecation.rb:7:in `initialize'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/
deprecation.rb:7:in `new'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/
deprecation.rb:7:in `run'
from /home/joanne/Desktop/2/config/environment.rb:7:in `<top
(required)>'
from /home/joanne/Desktop/2/test/test_helper.rb:2:in `require'
from /home/joanne/Desktop/2/test/test_helper.rb:2:in `<top
(required)>'
from test/functional/languages_controller_test.rb:1:in `require'
from test/functional/languages_controller_test.rb:1:in `<top
(required)>'
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `load'
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `block
in <main>'
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `each'
from /usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb:5:in `<main>'
Errors running test:units, test:functionals!

thanks for help

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

Ruby on Rails

Hi,
I'm trying to upgrade a rails app to 2.3.11 (from 2.3.2) and I'm
seeing some odd behavior.
I have a link_to_remote call that works in 2.3.2 but not in anything
above that. What I mean by not working is that in my controller I
have a new method that I want to handle a javascript new call and pop
up a form for creating a new user. To get this I have a page with a
link to remote like so:

link_to_remote(image_tag('adduser.gif', :border => "0"),
:url => new_users_path(:id => @reader.journal_id), :method
=> :get)

in my controller I have a new method such as:

def new
@user = User.new
respond_to do |wants|
wants.js
end
end

and a new.rjs.js with something like:
page.replace_html("add_user_window",:partial =>
'new_user_win.html.erb')
page.show("add_user_window")

This works fine in 2.3.2. Trying to upgrade to anything beyond 2.3.2
and the clicking of link to remote doesn't "register" with the
controller as being a JS call and I get an error saying it can't find
a new.html.erb template. I've changed no other code than to upgrade
rails.

Has anyone seen anything like this? I've been trying to read all the
upgrade notes I can get my hands on. I guess I'm looking for ideas,
pointers, suggestions, anything...

Thanks!
Jay

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