Re: [Rails] link_to_remote the right way in Rails 3.0?

2010-06-17 Thread Conrad Taylor
On Thu, Jun 17, 2010 at 11:27 PM, Conrad Taylor  wrote:

> On Thu, Jun 17, 2010 at 9:51 PM, Sharkie Landshark 
> wrote:
>
>> I have been using link_to_remote forever now. I have also been using
>> jquery through jrails.
>>
>> I am readying my code for Rails 3.0, and am wondering what is the best
>> way to accomplish.
>>
>> For example, I have something like this all over in Rails 2.0
>>
>> <%= link_to_remote "XXX",
>>  { :url => "/activities/hide_dock", :update =>
>> "dock-container", :complete => "fixDock()" }, { :class => "activities" }
>>  %>
>>
>>
> Sharkie, I would recommend reading the following first before you start
> upgrading from Rails 2.x to Rails 3.x:
>
> http://blog.peepcode.com/tutorials/2010/live-coding-rails-3-upgrade
>

Here's another excellent reference that goes into greater detail of
convert from Rails 2.x to Rails 3.x:

http://www.railsupgradehandbook.com

Good luck,

-Conrad


>
> Next, link_to_remote has been deprecated in Rails 3 and you would
> need to do the following:
>
> <%= link_to "XXX", { :remote => true }, { ... } %>
>
>
>> def hide_dock
>>  render :partial => "/layouts/dock"
>> end
>>
>> Now, in Rails 3.0 I am planning this
>>
>> <%= raw link_to "XXX", "/activities/hide_dock",
>>  {:remote => true, :class => "activities" }
>>  %>
>>
>>
> Next, the above shouldn't use raw because link_to method
> returns an html_safe string in Rails 3.
>
>
>> def hide_dock
>>  respond_to do |format|
>>format.html
>>  format.js do
>>? What do I put here ?
>>
>
> If you're using RJS, then you'll simple add
> the expression to be executed.  For example,
> I tend to be partial to JSON and I would do the
> following:
>
> format.js # render the action.js.rjs by default
>
> or you can redefine it as follows to return json
>
> format.js { render :json => @some_object }
>
>
>>  end
>>end
>> end
>>
>>
> It's not clear as to what you're trying to do.  The hide_dock is a
> controller
> action so do you want to allow the following:
>
> http://some_domain.com/controller_name/hide_dock
>
>
>> My main question is since I am using jQuery, is there any point in using
>> RJS?
>>
>>
> If you intend on using jQuery, then there's no need to use RJS.  Just make
> sure that you get the JS file here:
>
> http://github.com/rails/jquery-ujs
>
>
>> Should I just have
>>
>> render :layout => false
>>
>>
> If you're updating just a part of the page, then you'll need to use the
> above.
>
>
>> and in hide_dock.js.erb just use jQuery code with <%= render :partial
>> =>%> where appropriate.
>>
>
> Lastly, I would recommend getting the PDF for "Agile Web Development with
> Rails 4th Ed" by Sam Ruby, Dave Thomas, et al from pragprog.com for
> additional
> information regarding the questions that you have above.
>
> Good luck,
>
> -Conrad
>
>
>> --
>>
>> Posted via http://www.ruby-forum.com/.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-t...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>

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



Re: [Rails] link_to_remote the right way in Rails 3.0?

2010-06-17 Thread Conrad Taylor
On Thu, Jun 17, 2010 at 9:51 PM, Sharkie Landshark wrote:

> I have been using link_to_remote forever now. I have also been using
> jquery through jrails.
>
> I am readying my code for Rails 3.0, and am wondering what is the best
> way to accomplish.
>
> For example, I have something like this all over in Rails 2.0
>
> <%= link_to_remote "XXX",
>  { :url => "/activities/hide_dock", :update =>
> "dock-container", :complete => "fixDock()" }, { :class => "activities" }
>  %>
>
>
Sharkie, I would recommend reading the following first before you start
upgrading from Rails 2.x to Rails 3.x:

http://blog.peepcode.com/tutorials/2010/live-coding-rails-3-upgrade

Next, link_to_remote has been deprecated in Rails 3 and you would
need to do the following:

<%= link_to "XXX", { :remote => true }, { ... } %>


> def hide_dock
>  render :partial => "/layouts/dock"
> end
>
> Now, in Rails 3.0 I am planning this
>
> <%= raw link_to "XXX", "/activities/hide_dock",
>  {:remote => true, :class => "activities" }
>  %>
>
>
Next, the above shouldn't use raw because link_to method
returns an html_safe string in Rails 3.


> def hide_dock
>  respond_to do |format|
>format.html
>  format.js do
>? What do I put here ?
>

If you're using RJS, then you'll simple add
the expression to be executed.  For example,
I tend to be partial to JSON and I would do the
following:

format.js # render the action.js.rjs by default

or you can redefine it as follows to return json

format.js { render :json => @some_object }


>  end
>end
> end
>
>
It's not clear as to what you're trying to do.  The hide_dock is a
controller
action so do you want to allow the following:

http://some_domain.com/controller_name/hide_dock


> My main question is since I am using jQuery, is there any point in using
> RJS?
>
>
If you intend on using jQuery, then there's no need to use RJS.  Just make
sure that you get the JS file here:

http://github.com/rails/jquery-ujs


> Should I just have
>
> render :layout => false
>
>
If you're updating just a part of the page, then you'll need to use the
above.


> and in hide_dock.js.erb just use jQuery code with <%= render :partial
> =>%> where appropriate.
>

Lastly, I would recommend getting the PDF for "Agile Web Development with
Rails 4th Ed" by Sam Ruby, Dave Thomas, et al from pragprog.com for
additional
information regarding the questions that you have above.

Good luck,

-Conrad


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

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



[Rails] Nested Forms and ordering of new child elements

2010-06-17 Thread Jens
Hi everybody,

I am using Rails 2.3 and the new "nested forms" concept to add child
objects to a parent object from within a single form.

I have successfully gotten the example app from Github (alloy_complex-
form-examples) to run and modified the Javascript code (add_child) to
insert new child elements betwee existing children, _not_ only at the
end of the list of children. This works fine, client-side.

However, this order is not preserved. When I try to save the form, the
new children are simply appended to the list of children. Now I could
solve this by populating a "position" attribute using Javascript. But
when validation fails, the list of children is _also_ reordered before
Rails re-renders the form, so that new children always appear at the
end.

How do I define, within a form_for / fields_for construct, the ORDER
of child elements so that it will be preserved

 * upon re-rendering the form (when validations fail or exeptions
occur)
 * upon successfully saving the object

?

I have a "default_scope :order => :position" set in the child model,
which also works fine, but does not help in the first case.

How is the "accepts_nested_attributes_for" implemented, can I somehow
hook into this?

Thanks!

Jens

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



[Rails] prototip not working in ie8

2010-06-17 Thread Tony Augustine
i Hav  created an application  for prototip 2 in rails, application
works  well in firefox and ie7  but  fails  to work in ie8, can anyone
provide ssolutions,please help  me



Thanks,
Mathew A
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] link_to_remote the right way in Rails 3.0?

2010-06-17 Thread Sharkie Landshark
I have been using link_to_remote forever now. I have also been using
jquery through jrails.

I am readying my code for Rails 3.0, and am wondering what is the best
way to accomplish.

For example, I have something like this all over in Rails 2.0

<%= link_to_remote "XXX",
  { :url => "/activities/hide_dock", :update =>
"dock-container", :complete => "fixDock()" }, { :class => "activities" }
 %>

def hide_dock
  render :partial => "/layouts/dock"
end

Now, in Rails 3.0 I am planning this

<%= raw link_to "XXX", "/activities/hide_dock",
  {:remote => true, :class => "activities" }
 %>

def hide_dock
  respond_to do |format|
format.html
  format.js do
? What do I put here ?
  end
end
end

My main question is since I am using jQuery, is there any point in using
RJS?

Should I just have

render :layout => false

and in hide_dock.js.erb just use jQuery code with <%= render :partial
=>%> where appropriate.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: combobox from array

2010-06-17 Thread MichaelF
To get what you want you need two parts...

First you need an array of the objects in question and then you need a
field on a form that uses that array.

To create the array you could do something like:

def create_chapter_list
chapters = Chapter.find(:all)
chapter_list = Array.new
chapters.each do |chapter|
  #Chapter ID must be place in the array as an integer - that is
how it is stored in the DB
  chapter_list << [chapter.school_and_name, chapter.id]
end
return chapter_list.sort!
  end

Note that the array has two values per element so its an array in an
array.  What you put in the first slot is what you would see in the
list and the second is what you would have submitted in a form.

Then in the form you would reference that array:

 <%= f.select :chapter_id, @chapter_list, :prompt => 'Select a
Chapter' %>

In this example I am using a select object but the idea is the same
for all the list selection types in a form.  There are details on the
form options in the RoR documentation ... for example:

http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M002302


On Jun 17, 4:27 am, Maese  wrote:
> Hi, I'm new  in ruby and i need do the next:
>
> I want get a combobox from an array (@array) and save that value in a
> table called "form", into a field called "combo", i want save the
> value, not an id
> someone could tell me what i have to write?
> Thanks

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



[Rails] Re: RoutingError

2010-06-17 Thread Aashish Kiran
Bb Serviss wrote:
> What do you have in your routes.rb file to setup the custom route?
> 
> http://guides.rubyonrails.org/routing.html

thank you for reply, it helped me
answer is
%p  or
%p Upload a vCard file to import people into your account.
%p
  - form_tag(user_contacts_path(@current_user), :multipart => 
true) do

-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Stopping enter from submitting a form

2010-06-17 Thread Marnen Laibow-Koser
Brent Jameson wrote:
> Hey all,
> 
> I'm working on a rails app that will be accepting input from a wide
> array of brandless barcode scanners. Is there anyway of making the
> return key tab to the next field instead of submitting the form? I
> know this is more of a javascript thing,

You are correct.

> but I just can't get it
> solved.

Then I would suggest asking on a JavaScript list.  You'll get better 
answers.

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


-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Re: Install Plugins into vendor/plugins

2010-06-17 Thread Marnen Laibow-Koser
Filipe Quadros Borges wrote:
> Using command "./script/plugin install path/to/plugin.git" does not
> install nothing to me. It never ends!
> 'command/plugin.rb' are using a 'git pull --depth 1
> git://path/to/plugin.git' and this command never exits.
>

Then you probably need to install Git.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Off Topic Advice Needed (Time objects)

2010-06-17 Thread Marnen Laibow-Koser
Ants Pants wrote:
> I know this is a Ruby question but I'm not on any Ruby mailing lists

Then get on one (perhaps ruby-talk) and ask there.  Don't make lazy 
excuses for asking off-topic questions.

> and
> it's for a Rails project (so might come under select_time etc. ;) )

That may be a better reason to ask here.

> I
> thought I'd try here.

I'll look at your question when I have a little more time, but please 
remember that "because I couldn't bother to join the appropriate list" 
is not a valid reason for posting off-topic questions. :)

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Why do rails calls a method when I'm calling a property?

2010-06-17 Thread Marnen Laibow-Koser
Omar Renteria wrote:
> Well, I'm starting on RoR, so I got a Book called simply
> rails...Following the steps in it sometimes when I try to call a
> property, the browser shows me the next exception:
> 
> undefined method `name' for nil:NilClass

That's how Ruby works: all data access is done through method calls.
Unlike in Java or C++, there is no way (well, except for tricky hacks)
to see an instance variable from outside the object that contains it.
This is one of the best features of Ruby, since it means calling
routines don't have to know whether they're asking for an instance
variable or a computation.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Why do rails calls a method when I'm calling a property?

2010-06-17 Thread Marnen Laibow-Koser
Omar Renteria wrote:
> Well, I'm starting on RoR, so I got a Book called simply
> rails...Following the steps in it sometimes when I try to call a
> property, the browser shows me the next exception:
> 
> undefined method `name' for nil:NilClass

That's how Ruby works: all data access is done through method calls. 
Unlike in Java or C++, there is no way (well, except for tricky hacks) 
to see an instance variable from outside the object that contains it. 
This is one of the best features of Ruby, since it means calling 
routines don't have to know whether they're asking for an instance 
variable or a computation.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Need Full-time Senior Ruby Dev with CSS/Jquery skills etc

2010-06-17 Thread Philip Hallstrom
On Jun 17, 2010, at 4:09 PM, Jan Drake wrote:

> Subject says it all.  jan_dr...@hotmail.com

No... it doesn't... :-)

Company?  Location?  On-site or telecommute?  etc...

-philip

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



[Rails] Need Full-time Senior Ruby Dev with CSS/Jquery skills etc

2010-06-17 Thread Jan Drake
Subject says it all.  jan_dr...@hotmail.com
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Why do rails calls a method when I'm calling a property?

2010-06-17 Thread Omar Renteria
I would also add that the trouble is in Show view/controller.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Why do rails calls a method when I'm calling a property?

2010-06-17 Thread Omar Renteria
Well, I'm starting on RoR, so I got a Book called simply
rails...Following the steps in it sometimes when I try to call a
property, the browser shows me the next exception:

undefined method `name' for nil:NilClass

I don't know why...here's my controller:
#Controller starts here
class StoriesController < ApplicationController
  before_filter :login_required, :only => [ :new, :create]

  def index
get_stories 'votes_count >= 5'
  end

  def bin
get_stories ''
render :action => 'index'
  end

  protected
  def get_stories(conditions)
@stories = Story.find :all, :order => 'id DESC', :conditions =>
conditions
  end

  def new
@story = Story.new
  end

  def create
#...@story = Story.new(params[:story])
@story = @current_user.stories.build params[:story]
if @story.save
  flash[:notice] = "La historia a sido agregada correctamente!"
  redirect_to stories_path
else
  render :action => 'new'
end
  end

  def show
@story = Story.find_by_id(params[:id])
  end
end
#controller ends here

Here's my view:
#View starts here

   <%= @story.name %>



  Shoveadas => <%= @story.votes.size %>


 Agregada por: <%= @story.user.login %> 

<%= link_to @story.link, @story.link%>


  <% form_remote_tag :url => story_votes_path(@story) do %>
<%= submit_tag 'Shovealo!' %>
  <% end %>


  <% if @story.votes.empty? %>
Sin shoveadas aun
  <% else %>
<%= render :partial => 'votes/vote', :collection => @story.votes %>
  <% end %>

#view ends here

>From now thank you!
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: We're sorry, but something went wrong...

2010-06-17 Thread Marnen Laibow-Koser
GFP wrote:
> I am an RoR newb, so bear with me here. I am on an Intel based Mac
> running OS X 10.4.11

Er, why are you still on Tiger?

> 
> I have started the 'RoR Essentials' tutorial on lynda.com.

Don't.  That tutorial is way out of date.  You won't be able to use it 
with current Rails versions.  Follow a recent tutorial; perhaps the 
Rails Guides at http://guides.rubyonrails.org are a good place to start.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Recursive self-referential many-to-many relationship

2010-06-17 Thread Marnen Laibow-Koser
Toby Rodwell wrote:
> Marnen Laibow-Koser wrote:
>> Toby Rodwell wrote:
>>> Marnen Laibow-Koser wrote:
> 
>> You may be able to use aliases, but how does this solve the basic 
>> problem of adding fields to the DB?
> I don't add fields (or even records) to this database - I just use RoR 
> as way a way to get data out in a useful format.  Anyway, thanks for the 
> pointer to 'awesome'.

You'll have to add the lft and rgt fields to the database to use nested 
sets.  That's the way the data structure works.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Mac and Rails

2010-06-17 Thread Marnen Laibow-Koser
Andy Jeffries wrote:
>>
>> I have been just tasked to learn Rails for a new project and have been
>> given Mac machine for it. I have never used a Mac / Linux ever. I have
>> used Rails before on Windows. I need to set up Rails development env
>> on this Mac machine. Its Mac OS X - Snow Leopard. The development
>> environment needs Rails 2.3.5, GIT client and MySQL. We are still
>> swaying between using Mongreal or Apache locally, because the
>> production will be in Apache.
>>
> 
> Use Apache locally too.  It's simple, Apache is already installed on 
> Snow
> Leopard. Install Passenger and configure it (which you'll need to learn 
> how
> to do for production anyway).

What a waste of effort IMHO.  I've never used anything but Mongrel 
locally.  It works fine n

>  Update your gems on Snow Leopard (as 
> Rails is
> also already installed on Snow Leopard) and away you go.
> 
> 
>> Can someone advise what the best practices, best tools, editors, etc
>> to set up Rails development env locally on a Mac? Apologize for the v
>> basic question. :-)
>>
> 
> As I said, you already have Rails and Apache ready to go.  You need to
> install MySQL (or use sqlite in development) and that's it.  I 
> personally
> use TextMate, but RubyMine looks awesome if you don't mind the lag for
> Java-based IDEs to start up.

Please don't bother with an IDE for Rails; it doesn't need or want one. 
KomodoEdit rocks.

Check out http://www.apple.com/support/switch101 .  Consider iTerm as a 
more powerful substitute for Terminal.app .  If you're using Git, get 
GitX.

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

> 
> Cheers,
> 
> 
> Andy

-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Recursive self-referential many-to-many relationship

2010-06-17 Thread Toby Rodwell
Marnen Laibow-Koser wrote:
> Toby Rodwell wrote:
>> Marnen Laibow-Koser wrote:

> You may be able to use aliases, but how does this solve the basic 
> problem of adding fields to the DB?
I don't add fields (or even records) to this database - I just use RoR 
as way a way to get data out in a useful format.  Anyway, thanks for the 
pointer to 'awesome'.

-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] cannot install Mongrel gem w ruby-1.9.2-preview3 [ x86_64 ] and Rails 3.0.0.beta4 [OS X 10.6.4]

2010-06-17 Thread Erwin
error in make ...


 yves$ sudo gem install mongrel
Building native extensions.  This could take a while...
ERROR:  Error installing mongrel:
ERROR: Failed to build gem native extension.

/Users/yves/.rvm/rubies/ruby-1.9.2-preview3/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile

make
gcc -I. -I/Users/yves/.rvm/rubies/ruby-1.9.2-preview3/include/
ruby-1.9.1/x86_64-darwin10.4.0 -I/Users/yves/.rvm/rubies/ruby-1.9.2-
preview3/include/ruby-1.9.1/ruby/backward -I/Users/yves/.rvm/rubies/
ruby-1.9.2-preview3/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -
D_DARWIN_C_SOURCE   -fno-common -O3 -ggdb -Wextra -Wno-unused-
parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-
missing-field-initializers -Wshorten-64-to-32 -Wno-long-long  -fno-
common -pipe  -o http11.o -c http11.c
http11.c: In function ‘http_field’:
http11.c:70: warning: format not a string literal and no format
arguments
http11.c:71: warning: format not a string literal and no format
arguments
http11.c:77: error: ‘struct RString’ has no member named ‘ptr’
http11.c:77: error: ‘struct RString’ has no member named ‘len’

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



[Rails] Re: Subdomains

2010-06-17 Thread Franco Catena
You can do that with request.subdomains inside a controller. See
http://api.rubyonrails.org/classes/ActionController/Request.html#M000526

If you want to "change" your primary key (or the key used for search)
try with to_param. See 
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001840

Regards.

Franco Catena.

On Jun 17, 12:50 pm, David Zhu  wrote:
> hi,
>
> Is there a way for me to have subdomains on my rails project?
>
> For example, if I create a post, i get this 
> URL-http://www.localhost:3000/posts/
> (what ever number)
>
> How can I make the route so that it is  title.localhost:3000/
>
> title is a field of my posts.
>
> Is there a way to do that? OR if that's too complicated, then how do i
> replace the /posts/# with /post.title?
>
> THANKS!

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



[Rails] Re: Recursive self-referential many-to-many relationship

2010-06-17 Thread Marnen Laibow-Koser
Toby Rodwell wrote:
> Marnen Laibow-Koser wrote:
> 
>> You want awesome_nested_set, which will let you do that with one query. 
>> The Glue model is unnecessary.
> 
> Thanks very much for the info. I've had a quick look at the 
> documentation and I see it makes use of fields :lft and :rgt  -I guess I 
> can use aliases for these, along the lines of :lft => "my_field", as I 
> don't have control of the database?

If you don't have control of the database, you should not be doing the 
project.  Really.

You may be able to use aliases, but how does this solve the basic 
problem of adding fields to the DB?

>  Also, do you know if 
> awesome_nested_set will be faster than what I'm doing currently, or just 
> more convenient?

Probably both.  As I said, the advantage of nested sets is that you can 
fetch all descendants to arbitrary depth with one query.

> 
> regards

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Using Roles but don´t want to show them

2010-06-17 Thread Colin Law
On 17 June 2010 21:51, Mark  wrote:
> Thank you for your answer but i don't understand what you mean.
> I don't have a popup on the form.
>
> In my view there are in the sign in form the three checkboxes
>
> []admin
> []moderator
> []author
>
> So there you can choose what function you want to have. But no one
> else has to be admin. Everybody has to be author. So I just want du
> show one checkbox "author". But i can not delete admin and moderator
> because my admin account hasn't got the admin functions if i delete
> it.
> You know what i mean?
>
> So i just want to fade out the other oppertunities.

Could you not top post please, it is easier to follow the thread if
comments are inserted into the previous email.  Thanks

Why not just do not put the options on the sign in form?  If it always
has to be author there is no need to put it on the form at all.  This
does not mean that you have to do away with the roles, just do not
give the option to set it on the signup form.  Presumably you have an
alternative method of setting up admin and moderator roles.

Colin

>
> Thanks very much
>
>
> On 14 Jun., 18:07, Frederick Cheung 
> wrote:
>> On Jun 14, 4:59 pm, Mark  wrote:
>>
>>
>>
>> > But if somebody wants to sign in he can choose between admin,
>> > moderator, author by himself. He has to be automatically author.
>> > Is there a way to fix that problem?
>>
>> Don't put a role popup on the form ? ( & disallow mass assignment for
>> the attribute)
>>
>> Fred
>>
>>
>>
>> > Thanks
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Using Roles but don´t want to show them

2010-06-17 Thread Mark
Thank you for your answer but i don't understand what you mean.
I don't have a popup on the form.

In my view there are in the sign in form the three checkboxes

[]admin
[]moderator
[]author

So there you can choose what function you want to have. But no one
else has to be admin. Everybody has to be author. So I just want du
show one checkbox "author". But i can not delete admin and moderator
because my admin account hasn't got the admin functions if i delete
it.
You know what i mean?

So i just want to fade out the other oppertunities.

Thanks very much


On 14 Jun., 18:07, Frederick Cheung 
wrote:
> On Jun 14, 4:59 pm, Mark  wrote:
>
>
>
> > But if somebody wants to sign in he can choose between admin,
> > moderator, author by himself. He has to be automatically author.
> > Is there a way to fix that problem?
>
> Don't put a role popup on the form ? ( & disallow mass assignment for
> the attribute)
>
> Fred
>
>
>
> > Thanks

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



[Rails] "LoadError: no such file to load -- openssl", following Rails Guides

2010-06-17 Thread James Fisher
[With apologies for cross-posting at 
http://railsforum.com/viewtopic.php?id=39587]



Hi all,

I'm following the edge 'getting started' guide at
http://guides.rails.info/getting_started.html, running ROR 3.  I'm
running Ruby 1.9.2 (as instructed by the guide), installed using RVM.

I get an error when following "4.3 Setting the Application Home
Page".  When making a request to http://localhost:3000/ , I get:

l...@office:~/blog$ rails server
=> Booting WEBrick
=> Rails 3.0.0.beta4 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-06-17 17:40:09] INFO  WEBrick 1.3.1
[2010-06-17 17:40:09] INFO  ruby 1.9.2 (2010-05-31) [i686-linux]
[2010-06-17 17:40:09] INFO  WEBrick::HTTPServer#start: pid=15264
port=3000
[2010-06-17 17:40:16] ERROR LoadError: no such file to load -- openssl
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`block in require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:198:in
`block in load_dependency'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:554:in
`new_constants_in'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:198:in
`load_dependency'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`require'
/home/lm/.rvm/rubies/ruby-1.9.2-preview3/lib/ruby/1.9.1/net/
https.rb:92:in `'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`block in require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:198:in
`block in load_dependency'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:554:in
`new_constants_in'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:198:in
`load_dependency'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activeresource-3.0.0.beta4/lib/active_resource/connection.rb:2:in
`'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`block in require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:198:in
`block in load_dependency'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:554:in
`new_constants_in'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:198:in
`load_dependency'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/dependencies.rb:212:in
`require'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activeresource-3.0.0.beta4/lib/active_resource/base.rb:17:in `'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activeresource-3.0.0.beta4/lib/active_resource/railties/
log_subscriber.rb:11:in `logger'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/railties-3.0.0.beta4/
lib/rails/log_subscriber.rb:76:in `map'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/railties-3.0.0.beta4/
lib/rails/log_subscriber.rb:76:in `flushable_loggers'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/railties-3.0.0.beta4/
lib/rails/log_subscriber.rb:84:in `flush_all!'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/railties-3.0.0.beta4/
lib/rails/rack/logger.rb:30:in `after_dispatch'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/railties-3.0.0.beta4/
lib/rails/rack/logger.rb:16:in `call'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/rack-1.1.0/lib/rack/
runtime.rb:17:in `call'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/
activesupport-3.0.0.beta4/lib/active_support/cache/strategy/
local_cache.rb:72:in `call'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/rack-1.1.0/lib/rack/
lock.rb:11:in `block in call'
:10:in `synchronize'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/rack-1.1.0/lib/rack/
lock.rb:11:in `call'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/actionpack-3.0.0.beta4/
lib/action_dispatch/middleware/static.rb:30:in `call'
/home/lm/.rvm/gems/ruby-1.9.2-preview3/gems/railties-3.0.0.beta4/
lib/rails/application.rb:145:in `call'
/home/lm/.rvm/ge

[Rails] Re: Re: Split model in few files

2010-06-17 Thread Ken Boss
Rob Lacey wrote:
> You want to do this, as its the class that needs to evaluate this
> method, not the module.
> 
> module ProjectValidations
> 
>   def self.included(base)
>  base.send :validates_presence_of, :project_name
>   end
> 
> end

Thanks for the pointer, Rob.  But I've got a lot more of these than the 
simple use case shows, and I'd have to modify a lot of code to 
modularize things that way.  After some more experimentation, I've come 
up with this:

  def self.included(base)
base.class_eval {
  validates_presence_of :project_name
  ...
}
  end

This way I can just cut/paste all of the validations from the original 
model class file into the base.class_eval block; much less mucking 
around.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Help .. A question about if then

2010-06-17 Thread Ar Chron
>   <% if stamp.Mint == true %>
> 
> <%else%>
> 
>   <%end%>
> 
>  
>   <% if stamp.Mint == true %>
> 
> <%else %>
> 
>   <%end%>
> 

Well, you should invert the logic for your second case, if Mint is true, 
then Used column should show No, no?

Was that your question?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Rails application generator fails after installing version 3.beta4

2010-06-17 Thread Stewart
I am running 1.9.2 not 1.9.7 but I am going to assume your talking
about 1.9.2 and its a typo :)

ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin9.8.0]

is the version I am running.
I used RVM to install ruby 1.9.2

"rvm install 1.9.2"

All of the gems seem to be installed correctly. Here is my list

~/code/rails $ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta4)
actionpack (3.0.0.beta4)
activemodel (3.0.0.beta4)
activerecord (3.0.0.beta4)
activeresource (3.0.0.beta4)
activesupport (3.0.0.beta4)
arel (0.4.0)
builder (2.1.2)
bundler (0.9.26)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
erubis (2.6.5)
fastthread (1.0.7)
gem_plugin (0.2.3)
git (1.2.5)
i18n (0.4.1)
mail (2.2.4)
mime-types (1.16)
mysql (2.8.1)
nifty-generators (0.4.0)
polyglot (0.3.1)
rack (1.1.0)
rack-mount (0.6.4)
rack-test (0.5.4)
rails (3.0.0.beta4)
railties (3.0.0.beta4)
rake (0.8.7)
rdoc (2.5.8)
rubygems-update (1.3.7)
sys-proctable (0.9.0 x86-darwin-8)
thor (0.13.6)
treetop (1.4.8)
tzinfo (0.3.22)

I have tried the command with out skip git and I get the same problem.
Thanks for your reply. Anymore ideas?

On Jun 17, 7:25 pm, Yacobus Reinhart  wrote:
> I am using ruby 1.8.7, when running :
> rails new rails3_test --skip-git
>
> I have no problem with that. Are you sure that you installed rails 3
> correctly including all dependencies? what happen if you try :
> rails new rails3_test
>
> > I guessed that there was a problem with git so thats why I used skip
> > git. It did not work though. Any suggestions on what I am doing wrong?
>
> I am not sure you are right because if it is git problem you will get
> stopped at first directory creation, make sure your RVM gem list of ruby
> 1.9.7 contains all dependencies gem for rails 3 beta 4
>
> Yacobus Reinhartwww.reinhartlab.com
> --
> Posted viahttp://www.ruby-forum.com/.

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



[Rails] Re: Recursive self-referential many-to-many relationship

2010-06-17 Thread Toby Rodwell
Marnen Laibow-Koser wrote:

> You want awesome_nested_set, which will let you do that with one query. 
> The Glue model is unnecessary.

Thanks very much for the info. I've had a quick look at the 
documentation and I see it makes use of fields :lft and :rgt  -I guess I 
can use aliases for these, along the lines of :lft => "my_field", as I 
don't have control of the database?  Also, do you know if 
awesome_nested_set will be faster than what I'm doing currently, or just 
more convenient?

regards
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Help .. A question about if then

2010-06-17 Thread bumper
Please be gentile ... I am new at this ror thing
I have a view which looks like this

Nicaragua Stamps


  
Scott
Maxwell
Description
Url
Mint
Used
  

<% @stamps.each do |stamp| %>
  
<%=h stamp.Scott %>
<%=h stamp.Maxwell %>
<%=h stamp.Description %>
<%=h stamp.url %>



  <% if stamp.Mint == true %>

<%else%>

  <%end%>



 

  <% if stamp.Mint == true %>

<%else %>

  <%end%>


<%= link_to 'Show', stamp %>
<%= link_to 'Edit', edit_stamp_path(stamp) %>
<%= link_to 'Destroy', stamp, :confirm => 'Are you
sure?', :method => :delete %>
  
<% end %>




<%= link_to 'New stamp', new_stamp_path %>

When the if statement is executed the first time it seems ok but on
the subsequent times it shows only true.
I hope this makes sense ...

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



Re: [Rails] Re: Split model in few files

2010-06-17 Thread Rob Lacey
You want to do this, as its the class that needs to evaluate this
method, not the module.

>  class Project < ActiveRecord::Base
>    include ProjectValidations
>  end
>
>  module ProjectValidations
>    validates_presence_of :project_name
>  end

module ProjectValidations

  def self.included(base)
 base.send :validates_presence_of, :project_name
  end

end

RobL



]> But if I, for example, do this:
>
>  class Project < ActiveRecord::Base
>    include ProjectValidations
>  end
>
>  module ProjectValidations
>    validates_presence_of :project_name
>  end
>
> then I get the following error:
>
>  undefined method `validates_presence_of' for ProjectValidations:Module
>
> Suggestions, anyone?
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>



-- 
Rob Lacey
cont...@robl.me
http://www.robl.me

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



[Rails] Re: Split model in few files

2010-06-17 Thread Ken Boss
Max Williams wrote:
> Use modules, which are included not required.  This is much cleaner than 
> overriding the class as you are doing above.  You might find that you 
> can factor out some functionality such that other classes can use it as 
> well.  Put the modules in lib and keep your models folder with just the 
> class definitions.

I am trying to do just that.  I have a large model with lots of 
attributes - I am not trying to factor out code to share between models, 
I just want to break the model up into a few files for sanity's sake.

But if I, for example, do this:

  class Project < ActiveRecord::Base
include ProjectValidations
  end

  module ProjectValidations
validates_presence_of :project_name
  end

then I get the following error:

  undefined method `validates_presence_of' for ProjectValidations:Module

Suggestions, anyone?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] session hash set from outside program?

2010-06-17 Thread Sindri Guðmundsson
Hi,
I have had my new rails program up for a few days now. I'm running it on
Ubuntu 10.4 with apache2 in another location than the website it's made
for (it's a standalone database application for physiotherapists). The
people I made it for now want me to deploy it to the public part of
their website, only with one change. Those who open it via the link in
the public-part should not be able to click one button!

I was thinking of doing something like this in my view:

<% if session[:inside]%>
<%=button_to 'Sækja mælitæki', @link_to_mt%>
<%end%>

How could I set session[:inside] only to true if the program was started
from within the private part of the webpage? I thought of creating two
new actions, the other would set session[:inside] to true and the other
to false, but that seems to me like a security risk, is it not?

BR,
Sindri
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Covert HTML to PDF

2010-06-17 Thread Rails Learner
Thanks Everyone for your suggestions.
Appreciate your time and reply!

-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Rails application generator fails after installing version 3.beta4

2010-06-17 Thread Yacobus Reinhart
I am using ruby 1.8.7, when running :
rails new rails3_test --skip-git

I have no problem with that. Are you sure that you installed rails 3 
correctly including all dependencies? what happen if you try :
rails new rails3_test

> I guessed that there was a problem with git so thats why I used skip
> git. It did not work though. Any suggestions on what I am doing wrong?

I am not sure you are right because if it is git problem you will get 
stopped at first directory creation, make sure your RVM gem list of ruby 
1.9.7 contains all dependencies gem for rails 3 beta 4

Yacobus Reinhart
www.reinhartlab.com
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Covert HTML to PDF

2010-06-17 Thread Ivan Nastyukhin
its easy use pdf-kit )

Ivan Nastyukhin
dieinz...@me.com






On Jun 17, 2010, at 7:14 PM, Joshua Martin wrote:

> I was also going to suggest wkthml2pdf... but in the easy to use form of a 
> plugin called wicked_pdf...
> 
> See this tutorial.. 
> http://snikt.net/index.php/2010/03/03/generating-pdfs-from-ruby-on-rails
> 
> 
> On Thu, Jun 17, 2010 at 11:09 AM, Ivan Nastyukhin  wrote:
> hi
> look to wkhtml2pdf
> 
> Ivan Nastyukhin
> dieinz...@me.com
> 
> 
> 
> 
> 
> 
> On Jun 17, 2010, at 7:04 PM, Rails Learner wrote:
> 
> > Hello Everyone,
> >
> > I am working on a website where I am required to convert an HTML view
> > into a PDF document. I have found some gems and plug-ins like
> > PDF::Writer, but none of these are good for converting HTML and CSS to
> > PDF file.
> >
> > I found a gem called "Princely" which works with "PrinceXML". But
> > PrinceXML library is not free and we don't have money to pay for it as
> > we are non-profit.
> >
> > Anyone who knows of a gem or plug-in that will best fit my scenario?
> >
> > Thanks a lot!
> > --
> > Posted via http://www.ruby-forum.com/.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group at 
> > http://groups.google.com/group/rubyonrails-talk?hl=en.
> >
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 
> 
> 
> 
> -- 
> _
> 
> Joshua S. Martin
> 
> 
> CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s), 
> contains information that may be confidential, protected by the attorney 
> client or other legal privileges, and or proprietary non public information. 
> If you are not an intended recipient of this message or an authorized 
> assistant to an intended recipient, please notify the sender by replying to 
> this message and then delete it from your system. Use, dissemination, 
> distribution, or reproduction of this message and or any of its attachments 
> (if any) by unintended recipients is not authorized and may be unlawful.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

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



Re: [Rails] How to run nifty generators in rails 3.0

2010-06-17 Thread karnati kiran
>
>
>
> Thank you Peter
>

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



[Rails] Re: ONMOUSEOVER CELL CHANGING LINKS COLOR

2010-06-17 Thread Antonio Dos santos
Matter resolved. Thank again.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Rails 3: link_to with "data-confirm"

2010-06-17 Thread Ray Parker
I'll check into 1.7.  I confirmed that this is a problem with 
Rails3.beta4:

Create a new project, generate a scaffold for some Foo class.  Confirm 
that the delete link from the index page gives you a confirmation 
dialog.  Change the "Destroy" text to an image_tag and the confirmation 
no longer works.  I read somewhere else that this was an issue with the 
JS library and the way that it's referring to page elements.

> I know I also upgraded the rails.js file to the latest version as well 
> as prototype (1.7 rc)
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Re: Forcing helper like link_to to use single quotes

2010-06-17 Thread Ar Chron
Sheesh, I don't know...

Smack yourself in the head every time you type a double-quote for an 
HTML attribute???

Use an IDE and re-write the syntax rules for the language recognition so 
it does not allow double-quotes for HTML attributes?

Surely, there are more important things you could be learning in the 
time you are spending trying to force the code to be 'just so'.
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Covert HTML to PDF

2010-06-17 Thread Peter De Berdt


On 17 Jun 2010, at 17:04, Rails Learner wrote:


I am working on a website where I am required to convert an HTML view
into a PDF document. I have found some gems and plug-ins like
PDF::Writer, but none of these are good for converting HTML and CSS to
PDF file.

I found a gem called "Princely" which works with "PrinceXML". But
PrinceXML library is not free and we don't have money to pay for it as
we are non-profit.

Anyone who knows of a gem or plug-in that will best fit my scenario?


You could also just try and e-mail the guys at Prince and present them  
with your case and ask if they would be interested in sponsoring your  
non-profit project (in exchange for some kind of promotional banner or  
mentioning Prince perhaps).



Best regards

Peter De Berdt

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



[Rails] Re: Can i use a hash on a collection_select? If don't, alternatives.

2010-06-17 Thread Miguel.camba
I have just found a solution, but using a helper
In application_helper i wrote this function:
  def select_from_hash(object, name, arg)
select = "#{e}"
end
select += ""
  end
And in my views I use it this way (im using Haml):
.field= render :inline=> select_from_hash(:profile, :loved_food,
CATEGORIES)

Works fine but im all ears for other-more-elegant approach.

On Jun 17, 5:40 pm, "Miguel.camba"  wrote:
> I dont think so. I want to show a select that shows que values of the
> hash but the stored data when you submit a form is the key of that
> value un the hash.
>
> On Jun 17, 2:29 pm, Colin Law  wrote:
>
>
>
> > On 17 June 2010 12:17, Miguel.camba  wrote:
>
> > > In my current application, i have food categories: mexican, home made,
> > > japanese, ect
> > > As these categories only have ID and name, no other attributes, i dont
> > > want to create a table on the DB.
> > > My first idea was to create a constant named FOOD_CATEGORIES, that is
> > > has like:
> > > FOOD_CATEGORIES = { 1=>'mexican',
> > >                                       2=>'japanese', ... }
> > > BUT, since the hash doesn't have :id method, i dont know how to use
> > > this constant on a collection_select in my views.
>
> > > Do you have a better idea?
>
> > Maybe options_for_select is what you are looking for.
>
> > Colin

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



[Rails] Re: mysql gem install not happening on Mac OS Leopard - any inputs at all??

2010-06-17 Thread Ram
:) I do. And no, not a dumb question. Im happy answering *any*
question if it means you can help me fix this hair-loss-causing
issue!!!

On Jun 17, 5:21 pm, Frederick Cheung 
wrote:
> On Jun 17, 9:58 am, Ram  wrote:
>
> > Hello Fred,
>
> > I can see the following errors in the mkmf.log residing in ../
> >mysql-2.8.1/ext/mysql_api/ .
>
> dumb question: do you have the apple developer tools installed?
>
> Fred
>
>
>
> > 1. (Under "find_library: checking for mysql_query() in -
> > lmysqlclient...  no")
> > conftest.c: In function 't':
> > conftest.c:3: error: 'mysql_query' undeclared (first use in this
> > function)
> > conftest.c:3: error: (Each undeclared identifier is reported only once
> > conftest.c:3: error: for each function it appears in.)
>
> > 2. (Under "find_library: checking for mysql_query() in -
> > lmysqlclient...  no")
> > ld: library not found for -lmysqlclient
> > collect2: ld returned 1 exit status
>
> > 3. ld: library not found for -lmygcc (Under "have_library: checking
> > for main() in -lmygcc...  no")
>
> > 4. ld: library not found for -lnsl (Under "have_library: checking for
> > main() in -lnsl...  no")
>
> > 5. ld: library not found for -lsocket (Under "have_library: checking
> > for main() in -lsocket...  no")
>
> > Hope that helps. Thanks!
>
> > On Jun 17, 1:37 pm, Frederick Cheung 
> > wrote:
>
> > > On Jun 16, 12:07 pm, Ram  wrote:
>
> > > >  :S
>
> > > > Im not comfortable uninstalling everything and installing it from
> > > > scratch again. Dont want to lose my existing setup. Pointers from
> > > > anyone at all?
>
> > > There should be a log file detailing what went wrong when it tried to
> > > build thegem. What's in it?
>
> > > Fred
>
> > > > On Jun 15, 1:52 pm, Ram  wrote:
>
> > > > > I also get this warning in the very beginning of thegeminstall. Does
> > > > > it have any relevance?
>
> > > > > WARNING:  Installing to ~/.gemsince /Library/Ruby/Gems/1.8 and
> > > > >           /usr/bin aren't both writable.
> > > > > WARNING:  You don't have /Users/Ram/.gem/ruby/1.8/bin in your PATH,
> > > > >          gemexecutables will not run.
>
> > > > > On Jun 15, 1:41 pm, Ram  wrote:
>
> > > > > > Hello all,
>
> > > > > > Ive got Mac OS X Leopard (10.5.8), ruby 1.8.6 (2009-06-08 patchlevel
> > > > > > 369) [universal-darwin9.0] andmysql5.0.67 installed and working fine
> > > > > > with Rails 2.1.0.
>
> > > > > > "which ruby" outputs /usr/bin/ruby. I can see themysqlsymlink in /
> > > > > > usr/local/mysql. I can also see themysql-5.0.67-osx10.5-x86 folder
> > > > > > in /usr/local .
>
> > > > > > Im trying to upgrade my Rails apps to 2.3.5 but when i try to 
> > > > > > install
> > > > > > themysqlgem, I get "ERROR: Failed to buildgemnative extension." I
> > > > > > tried all the following commands with and without sudo and get the
> > > > > > same error everytime
>
> > > > > > > env ARCHFLAGS="-arch i386"geminstallmysql-- 
> > > > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > > > > env ARCHFLAGS="-arch i386"geminstallmysql-- 
> > > > > > > --with-mysql-dir=/usr/local/mysql--with-mysql-lib=/usr/local/mysql/lib
> > > > > > >  --with-mysql-include=/usr/local/mysql/include
> > > > > > > env ARCHFLAGS="-arch i386"geminstallmysql-- 
> > > > > > > --with-mysql-dir=/usr/local/mysql--with-mysql-lib=/usr/local/mysql/lib
> > > > > > >  --with-mysql-include=/usr/local/mysql/include 
> > > > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > > > > env ARCHFLAGS="-arch 
> > > > > > > i386"geminstallmysql--with-mysql-dir=/usr/local/mysql
> > > > > > >geminstallmysql-- --with-mysql-dir=/usr/local/mysql
> > > > > > >geminstallmysql-- 
> > > > > > >--with-mysql-config=/usr/local/mysql/bin/mysql_config
>
> > > > > > Im not sure what Im doing wrong. Am I supposed to uninstall the
> > > > > > existingmysqland reinstall the latest (5.1.x) before I install the
> > > > > >mysqlgem? Or are my ruby andmysqlpaths screwed up? Ive googled a
> > > > > > lot and tried all the suggestions (as you can see above) but none
> > > > > > work.
>
> > > > > > I raised this issue already in the group but no replies yet. So I've
> > > > > > reframed it in a simpler fashion. Even if noone knows the solution
> > > > > > right away, I'd really appreciate any inputs at all.
>
> > > > > > Thanks!- Hide quoted text -
>
> - Show quoted text -

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



Re: [Rails] ONMOUSEOVER CELL CHANGING LINKS COLOR

2010-06-17 Thread Peter De Berdt



On 17 Jun 2010, at 16:36, Antonio Dos santos wrote:


I work with tables.
I have many links in one cell and I wish when onmouseover the cell  
all

links changing for the same new color.
One link is possible.
Many links, it is possible?


Do it using CSS, it going to be the most efficient way:

table td:hover a {
 color: #123456;
}

Of course IE might pose a problem here, but it's up to you to  
decide if you even want to care about that anymore, especially if  
the link coloring is purely cosmetic.



80% of visitors use IE, but thanks for your help.


Well, only IE6 has erratic behavior.

Very quick and dirty, but should give you something to work on:

http://pastie.org/private/tjz1avqnx3yk3r0ajeypyw


Best regards

Peter De Berdt

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



[Rails] Re: Re: Forcing helper like link_to to use single quotes

2010-06-17 Thread Sharkie Landshark
Dear Friends,

I am the original poster. I use double quote for all Ruby strings in my 
Ruby codes.

But, I use single quotes for HTML attributes.

How would I force such behavior even though it is not compliance etc.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Subdomains

2010-06-17 Thread David Zhu
hi,

Is there a way for me to have subdomains on my rails project?

For example, if I create a post, i get this URL- 
http://www.localhost:3000/posts/
(what ever number)

How can I make the route so that it is  title.localhost:3000/

title is a field of my posts.

Is there a way to do that? OR if that's too complicated, then how do i
replace the /posts/# with /post.title?


THANKS!

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



[Rails] Re: Can i use a hash on a collection_select? If don't, alternatives.

2010-06-17 Thread Miguel.camba
I dont think so. I want to show a select that shows que values of the
hash but the stored data when you submit a form is the key of that
value un the hash.


On Jun 17, 2:29 pm, Colin Law  wrote:
> On 17 June 2010 12:17, Miguel.camba  wrote:
>
> > In my current application, i have food categories: mexican, home made,
> > japanese, ect
> > As these categories only have ID and name, no other attributes, i dont
> > want to create a table on the DB.
> > My first idea was to create a constant named FOOD_CATEGORIES, that is
> > has like:
> > FOOD_CATEGORIES = { 1=>'mexican',
> >                                       2=>'japanese', ... }
> > BUT, since the hash doesn't have :id method, i dont know how to use
> > this constant on a collection_select in my views.
>
> > Do you have a better idea?
>
> Maybe options_for_select is what you are looking for.
>
> Colin

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



[Rails] Re: Re: Interpreter Problems

2010-06-17 Thread Pale Horse
Colin Law wrote:
> 
> Googling for the error string found numerous hits suggesting that this
> is a problem with MySQL version 5.1 on Vista, and reverting to 5.0
> fixed it.  Are you on 5.1?
> 
> Colin

That, I have already tried with no success.
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Interpreter Problems

2010-06-17 Thread Colin Law
On 17 June 2010 16:06, Pale Horse  wrote:

>
> "Ruby interpreter (CUI) 1.8.6 [i386-mswin32] has stopped working". This
> occurs when script/server is running.
>
> I've tried upgrading my version of Ruby to a more recent version, such
> as 1.9.1 and downgrading my version of Ruby to an older version.
>
> My Rails version is 2.3.5 and I'm running Vista HP 32bit on my
> development computer.

Googling for the error string found numerous hits suggesting that this
is a problem with MySQL version 5.1 on Vista, and reverting to 5.0
fixed it.  Are you on 5.1?

Colin

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



Re: [Rails] Re: Field validation

2010-06-17 Thread lucas franceschi
try looking 
Here
.
Sempre Alerta Para Servir,

Lucas Franceschi
Equipe de Programação (Automação)
SGI Sistemas
(049) 9922-3360


On Thu, Jun 17, 2010 at 12:14 PM, lucas franceschi wrote:

> well... in fact... you did defined it as an "integer" so, dont expect to
> get any other class thats not Fixnum or Bignum...
>
> but, you can also use some model validations to be sure that the user
> entered an integer...
>
> try validates_numericality_of :cost
> it will stop your user from entering strings
>
> i`m not sure how to stop it from entering floats like "10.6", but i`m sure
> there's a simple way of doing it...
>
> you know, you're programming in ruby on rails, it IS simple.
> Sempre Alerta Para Servir,
>
> Lucas Franceschi
> Equipe de Programação (Automação)
> SGI Sistemas
> (049) 9922-3360
>
>
>
> On Thu, Jun 17, 2010 at 11:35 AM, Stanislav Orlenko 
> wrote:
>
>> Colin Law wrote:
>> > On 16 June 2010 11:34, Stanislav Orlenko  wrote:
>> >> � � �errors.add_to_base("Error message") unless cost.is_a?(Fixnum)
>> >>
>> >> when I enter 'asdf':
>> >>
>> >> ### 0: Fixnum
>> >>
>> >> I completely can't understand what happen. In migration:
>> >>
>> >> t.integer :cost
>> >>
>> >> I think ActiveRectord converts value to Fixnum because in migration
>> this
>> >> field signed as integer
>> >
>> > How is the string you enter getting into the cost attribute?
>> >
>> > Colin
>>
>> I can't understand why cost field value (10, 10.1 or 'asdf') all time is
>> Fixnum in model. In this model I try to validate cost, and can't because
>> all time I get only one type - Fixnum!
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-t...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>

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



Re: [Rails] Re: Field validation

2010-06-17 Thread lucas franceschi
well... in fact... you did defined it as an "integer" so, dont expect to get
any other class thats not Fixnum or Bignum...

but, you can also use some model validations to be sure that the user
entered an integer...

try validates_numericality_of :cost
it will stop your user from entering strings

i`m not sure how to stop it from entering floats like "10.6", but i`m sure
there's a simple way of doing it...

you know, you're programming in ruby on rails, it IS simple.
Sempre Alerta Para Servir,

Lucas Franceschi
Equipe de Programação (Automação)
SGI Sistemas
(049) 9922-3360


On Thu, Jun 17, 2010 at 11:35 AM, Stanislav Orlenko wrote:

> Colin Law wrote:
> > On 16 June 2010 11:34, Stanislav Orlenko  wrote:
> >> � � �errors.add_to_base("Error message") unless cost.is_a?(Fixnum)
> >>
> >> when I enter 'asdf':
> >>
> >> ### 0: Fixnum
> >>
> >> I completely can't understand what happen. In migration:
> >>
> >> t.integer :cost
> >>
> >> I think ActiveRectord converts value to Fixnum because in migration this
> >> field signed as integer
> >
> > How is the string you enter getting into the cost attribute?
> >
> > Colin
>
> I can't understand why cost field value (10, 10.1 or 'asdf') all time is
> Fixnum in model. In this model I try to validate cost, and can't because
> all time I get only one type - Fixnum!
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] Covert HTML to PDF

2010-06-17 Thread Joshua Martin
I was also going to suggest wkthml2pdf... but in the easy to use form of a
plugin called wicked_pdf...

See this tutorial..
http://snikt.net/index.php/2010/03/03/generating-pdfs-from-ruby-on-rails


On Thu, Jun 17, 2010 at 11:09 AM, Ivan Nastyukhin  wrote:

> hi
> look to wkhtml2pdf
>
> Ivan Nastyukhin
> dieinz...@me.com
>
>
>
>
>
>
> On Jun 17, 2010, at 7:04 PM, Rails Learner wrote:
>
> > Hello Everyone,
> >
> > I am working on a website where I am required to convert an HTML view
> > into a PDF document. I have found some gems and plug-ins like
> > PDF::Writer, but none of these are good for converting HTML and CSS to
> > PDF file.
> >
> > I found a gem called "Princely" which works with "PrinceXML". But
> > PrinceXML library is not free and we don't have money to pay for it as
> > we are non-profit.
> >
> > Anyone who knows of a gem or plug-in that will best fit my scenario?
> >
> > Thanks a lot!
> > --
> > Posted via http://www.ruby-forum.com/.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-t...@googlegroups.com.
> > To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
_

Joshua S. Martin


CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
contains information that may be confidential, protected by the attorney
client or other legal privileges, and or proprietary non public information.
If you are not an intended recipient of this message or an authorized
assistant to an intended recipient, please notify the sender by replying to
this message and then delete it from your system. Use, dissemination,
distribution, or reproduction of this message and or any of its attachments
(if any) by unintended recipients is not authorized and may be unlawful.

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



[Rails] Re: passenger and apache mpm's

2010-06-17 Thread Bruno Sousa
Thanks for replying Hongli.
But, even with worker mpm installed, passenger installation asks me to 
install development headers and apxs2 binary for apache2-mpm-prefork. 
Why is that?

Hongli Lai wrote:
> On Jun 17, 12:47�am, Bruno Sousa  wrote:
>> Hi!
>> Is it safe to run phusion passenger with all apache kinds of MPM?
> 
> Prefork and Worker are supported.

-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Covert HTML to PDF

2010-06-17 Thread Ivan Nastyukhin
hi
look to wkhtml2pdf

Ivan Nastyukhin
dieinz...@me.com






On Jun 17, 2010, at 7:04 PM, Rails Learner wrote:

> Hello Everyone,
> 
> I am working on a website where I am required to convert an HTML view
> into a PDF document. I have found some gems and plug-ins like
> PDF::Writer, but none of these are good for converting HTML and CSS to
> PDF file.
> 
> I found a gem called "Princely" which works with "PrinceXML". But
> PrinceXML library is not free and we don't have money to pay for it as
> we are non-profit.
> 
> Anyone who knows of a gem or plug-in that will best fit my scenario?
> 
> Thanks a lot!
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

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



[Rails] Re: ONMOUSEOVER CELL CHANGING LINKS COLOR

2010-06-17 Thread Antonio Dos santos
80% of visitors use IE, but thanks for your help.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Interpreter Problems

2010-06-17 Thread Pale Horse
Colin Law wrote:
> On 17 June 2010 12:17, Pale Horse  wrote:
>> I really aren't sure why but my interpreter continues to fail after an
>> unknown amount of requests or time on my local (home) computer. I've
>> tried following instructions from people who have encountered similar
>> problems with no success.
>>
>> Is it necessary for me to provide you with version details for Ruby,
>> Rails and MySQL?
>>
>> Does anyone know of this problem, or, better still, a way to solve it?
> 
> I think some details of the problem seen would be useful. What do you
> mean by 'my interpreter continues to fail'?  What is the symptom?  Is
> there anything in the log that gives clues?
> 
> Versions of rails etc and which OS may be useful.
> 
> Colin

"Ruby interpreter (CUI) 1.8.6 [i386-mswin32] has stopped working". This 
occurs when script/server is running.

I've tried upgrading my version of Ruby to a more recent version, such 
as 1.9.1 and downgrading my version of Ruby to an older version.

My Rails version is 2.3.5 and I'm running Vista HP 32bit on my 
development computer.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Covert HTML to PDF

2010-06-17 Thread Rails Learner
Hello Everyone,

I am working on a website where I am required to convert an HTML view
into a PDF document. I have found some gems and plug-ins like
PDF::Writer, but none of these are good for converting HTML and CSS to
PDF file.

I found a gem called "Princely" which works with "PrinceXML". But
PrinceXML library is not free and we don't have money to pay for it as
we are non-profit.

Anyone who knows of a gem or plug-in that will best fit my scenario?

Thanks a lot!
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Rails application generator fails after installing version 3.beta4

2010-06-17 Thread Stewart
Hi,

I have some free time today so I am having a look at beta4 of rails3.
I am using RVM and just installed ruby version...

ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin9.8.0]

I installed rails too with no problem. When I try and generate a new
application I get the following output


~/code/rails $ rails new rails3_test --skip-git
  create
  create  README
  create  Rakefile
  create  config.ru
  create  Gemfile
  create  app
  create  app/controllers/application_controller.rb
  create  app/helpers/application_helper.rb
  create  app/views/layouts/application.html.erb
  create  app/models
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/secret_token.rb
  create  config/initializers/session_store.rb
  create  config/locales
  create  config/locales/en.yml
  create  config/boot.rb
  create  config/database.yml
  create  db
  create  db/seeds.rb
  create  doc
  create  doc/README_FOR_APP
  create  lib
/Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/generators/rails/app/app_generator.rb:
22:in `empty_directory_with_gitkeep': protected method
`empty_directory_with_gitkeep' called for
# (NoMethodError)
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/generators/rails/app/app_generator.rb:
87:in `lib'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/generators/rails/app/app_generator.rb:
335:in `build'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/generators/rails/app/app_generator.rb:
255:in `create_lib_files'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/task.rb:33:in `run'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/invocation.rb:109:in `block in invoke'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/invocation.rb:118:in `each'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/invocation.rb:118:in `map'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/invocation.rb:118:in `invoke'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/group.rb:36:in `block in start'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/base.rb:378:in `start'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
thor-0.13.6/lib/thor/group.rb:29:in `start'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/commands/application.rb:18:in `'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/cli.rb:30:in `require'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
railties-3.0.0.beta4/lib/rails/cli.rb:30:in `'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
rails-3.0.0.beta4/bin/rails:2:in `require'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/gems/
rails-3.0.0.beta4/bin/rails:2:in `'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/bin/rails:
19:in `load'
from /Users/stewartmatheson/.rvm/gems/ruby-1.9.2-preview1/bin/rails:
19:in `'


I guessed that there was a problem with git so thats why I used skip
git. It did not work though. Any suggestions on what I am doing 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] ONMOUSEOVER CELL CHANGING LINKS COLOR

2010-06-17 Thread Peter De Berdt


On 17 Jun 2010, at 16:36, Antonio Dos santos wrote:


I work with tables.
I have many links in one cell and I wish when onmouseover the cell all
links changing for the same new color.
One link is possible.
Many links, it is possible?


Do it using CSS, it going to be the most efficient way:

table td:hover a {
  color: #123456;
}

Of course IE might pose a problem here, but it's up to you to decide  
if you even want to care about that anymore, especially if the link  
coloring is purely cosmetic.



Best regards

Peter De Berdt

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



[Rails] Re: ONMOUSEOVER CELL CHANGING LINKS COLOR

2010-06-17 Thread Antonio Dos santos
I sincerely apologize for having spelled the title in capital letters
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] ONMOUSEOVER CELL CHANGING LINKS COLOR

2010-06-17 Thread Antonio Dos santos
I work with tables.
I have many links in one cell and I wish when onmouseover the cell all
links changing for the same new color.
One link is possible.
Many links, it is possible?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Field validation

2010-06-17 Thread Stanislav Orlenko
Colin Law wrote:
> On 16 June 2010 11:34, Stanislav Orlenko  wrote:
>> � � �errors.add_to_base("Error message") unless cost.is_a?(Fixnum)
>>
>> when I enter 'asdf':
>>
>> ### 0: Fixnum
>>
>> I completely can't understand what happen. In migration:
>>
>> t.integer :cost
>>
>> I think ActiveRectord converts value to Fixnum because in migration this
>> field signed as integer
> 
> How is the string you enter getting into the cost attribute?
> 
> Colin

I can't understand why cost field value (10, 10.1 or 'asdf') all time is 
Fixnum in model. In this model I try to validate cost, and can't because 
all time I get only one type - Fixnum!
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] tabular view gem in script/console

2010-06-17 Thread Leonardo Mateo
On Thu, Jun 17, 2010 at 12:30 AM, Chamnap  wrote:
> I remember there is a gem on github that is able to display tabular
> view like mysql console in script/console. Anyone knows, I seem to
> forget, couldn't find it?
>
Hi, the gem you're asking for is "hirb".

Install it and then add:
require 'hirb'
Hirb.enable

in your ~/.irbrc

Hope it helps.

Cheers.


-- 
Leonardo Mateo.
There's no place like ~

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



[Rails] Re: Big performance issues regarding the browser

2010-06-17 Thread Nicolas Vincent
Yes I'm using JavaScript ; I tried disabling it but it didn't solved the 
problem.

I found a part of the solution : put the keepalive_timeout to 0.

Now it's as speedy on Firefox than IE !! But ... the bigger pictures 
don't want to display anymore ... Even if I just try to load a pictures 
stored in the public/images directory directly (so no JavaScript is 
involved). I'll try fidling around this parameter.

Thanks for your thought though,

Marnen Laibow-Koser wrote:
> Nicolas Vincent wrote:
> [...]
>> I'm facing a serious issue : when the developped site is browsed with
>> firefox, eveything is clean and fast. When browsed with IE, it is
>> ve sl (more than a minute for each page to show). I
>> checked various parameters on the server, in the browser, checked the
>> logs,but I'm running out of idea.
> 
> Are you using JavaScript?  If so, the problem might somehow be related 
> to the difference in JS interpreters.
> 
> 
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> mar...@marnen.org

-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] How to run nifty generators in rails 3.0

2010-06-17 Thread Peter De Berdt


On 17 Jun 2010, at 14:42, karnati kiran wrote:

   I want to run nifty generators in Rails 3.0 but it not accepts.  
Please send me the information,Please send me the commands  for  
authentication


From the Github site and the README:

Rails 3

To use Nifty Generators with Rails 3 you will need to include it in  
your Gemfile.


  gem "nifty-generators"
The generators use a colon as the separator instead of an underscore.

  rails g nifty:layout
The Rails 3 support is still in early development, please report any  
issues you find.



If you have issues, I'd suggest you report them or debug it urself and  
contribute it back.



Best regards

Peter De Berdt

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



Re: [Rails] Rails won't execute backticked OS commands

2010-06-17 Thread Jeffrey L. Taylor
There is probably no or different path.  Try with an absolute file name, e.g.,
`/usr/bin/commmand args`.

HTH,
  Jeffrey

Quoting Greg Willits :
> I'm at a loss as what to look for...
> 
> I can issue a command result = `some_os_command_string` on my dev system
> just fine in both a pur ruby test file, and from Rails in dev mode.
> 
> When I push that code to my server, the backtick command doesn't work.
> No failure message -- even if I wrap it in begin/rescue so I have no
> specific clues to work from.
> 
> I can run that same back ticked command on the server from a simple ruby
> test file, but not from Rails.
> 
> Any ideas what I could look for as to why Rails might be interfering
> with this?
> 
> Thx
> 
> (OS X 10.5.8 client and server versions, Ruby 1.8.6, Rails 2.3.2)
> 
> -- gw
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

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



[Rails] How to run nifty generators in rails 3.0

2010-06-17 Thread karnati kiran
Dear all,


   I want to run nifty generators in* Rails 3.0* but it not accepts. Please
send me the information,Please send me the commands  for authentication


  Thanks

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



Re: [Rails] Interpreter Problems

2010-06-17 Thread Ivan Nastyukhin
try to use ree
http://www.rubyenterpriseedition.com/

Ivan Nastyukhin
dieinz...@me.com






On Jun 17, 2010, at 3:17 PM, Pale Horse wrote:

> I really aren't sure why but my interpreter continues to fail after an
> unknown amount of requests or time on my local (home) computer. I've
> tried following instructions from people who have encountered similar
> problems with no success.
> 
> Is it necessary for me to provide you with version details for Ruby,
> Rails and MySQL?
> 
> Does anyone know of this problem, or, better still, a way to solve it?
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

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



Re: [Rails] syntax error, unexpected kEND, expecting $end

2010-06-17 Thread Colin Law
On 17 June 2010 12:21, Michael Sopira  wrote:
> I get this error
>
> /Users/sopira/rubydev/hello/app/models/spracovatel.rb:5: syntax error,
> unexpected kEND, expecting $end
>
> on the 5th line of the code, which has got just (and only) 5 line:
>
> CODE:
> Class Spracovatel

That should be class not Class

Colin

>  def spracovat
>    return 5
>  end
> end
>
> What can cause this error?
> After digging all the internet I have not found any idea.
> Maybe here.
>
> Thanks,
> Michael.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Big performance issues regarding the browser

2010-06-17 Thread Marnen Laibow-Koser
Nicolas Vincent wrote:
[...]
> I'm facing a serious issue : when the developped site is browsed with
> firefox, eveything is clean and fast. When browsed with IE, it is
> ve sl (more than a minute for each page to show). I
> checked various parameters on the server, in the browser, checked the
> logs,but I'm running out of idea.

Are you using JavaScript?  If so, the problem might somehow be related 
to the difference in JS interpreters.


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

-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Can i use a hash on a collection_select? If don't, alternatives.

2010-06-17 Thread Colin Law
On 17 June 2010 12:17, Miguel.camba  wrote:
> In my current application, i have food categories: mexican, home made,
> japanese, ect
> As these categories only have ID and name, no other attributes, i dont
> want to create a table on the DB.
> My first idea was to create a constant named FOOD_CATEGORIES, that is
> has like:
> FOOD_CATEGORIES = { 1=>'mexican',
>                                       2=>'japanese', ... }
> BUT, since the hash doesn't have :id method, i dont know how to use
> this constant on a collection_select in my views.
>
> Do you have a better idea?

Maybe options_for_select is what you are looking for.

Colin

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



[Rails] syntax error, unexpected kEND, expecting $end

2010-06-17 Thread Michael Sopira
I get this error

/Users/sopira/rubydev/hello/app/models/spracovatel.rb:5: syntax error,
unexpected kEND, expecting $end

on the 5th line of the code, which has got just (and only) 5 line:

CODE:
Class Spracovatel
  def spracovat
return 5
  end
end

What can cause this error?
After digging all the internet I have not found any idea.
Maybe here.

Thanks,
Michael.

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



[Rails] Can i use a hash on a collection_select? If don't, alternatives.

2010-06-17 Thread Miguel.camba
In my current application, i have food categories: mexican, home made,
japanese, ect
As these categories only have ID and name, no other attributes, i dont
want to create a table on the DB.
My first idea was to create a constant named FOOD_CATEGORIES, that is
has like:
FOOD_CATEGORIES = { 1=>'mexican',
   2=>'japanese', ... }
BUT, since the hash doesn't have :id method, i dont know how to use
this constant on a collection_select in my views.

Do you have a better idea?

Thanks

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



Re: [Rails] Need Help - New to RoR

2010-06-17 Thread lucas franceschi
as long as I understood, this is your very first app right?

so, maybe some really basic questions will help...

what DB are you using?
and...
do you have de driver gem for that DB?

I am not sure if I`m right, but
I could simulate your error, and look at the output, on the server terminal
window:


*!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.*

maybe just installing that gem before creating your application, or
installing it after and running  "rake db:create" to create your application
database would help...


Sempre Alerta Para Servir,

Lucas Franceschi
Equipe de Programação (Automação)
SGI Sistemas
(049) 9922-3360


On Thu, Jun 17, 2010 at 7:07 AM, kannav rajeev wrote:

> check yours db table does that exists ?
>
>
> On Thu, Jun 17, 2010 at 1:31 PM, Colin Law  wrote:
>
>> On 16 June 2010 21:48, Sangeetha  wrote:
>> > Hello All,
>> >
>> > I installed Ruby on Windows (using rubyinstaller-1.9.1-p378.exe from
>> > here - http://rubyforge.org/frs/?group_id=167).
>> > Then I ran gem install rails.
>> >
>> > I was following instructions here -http://oreilly.com/pub/a/ruby/
>> > archive/rails.html?page=1 to create my first app.
>> > I was able to start the server and see the first page.
>>
>> That tutorial has been 'updated for rails 1.2' and is dated 2005, it
>> must be hopelessly out of date.  Have a look at the Rails Guides
>> (google it) to get you started and http://www.railstutorial.org/ for a
>> more in depth tutorial.
>>
>> >
>> > When I click on "About you application's environment" link, I get the
>> > following message.
>> >
>> > We're sorry, but something went wrong. We've been notified about this
>> > issue and we'll take a look at it shortly.
>> >
>> > I get the same message when I generate a new controller and try to
>> > access that on the URL.
>>
>> Have a look in log/development.log for more information on what went
>> wrong.
>>
>> Colin
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-t...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>
>
> --
> Thanks:
> Rajeev sharma
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

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



[Rails] combobox from array

2010-06-17 Thread Maese
Hi, I'm new  in ruby and i need do the next:

I want get a combobox from an array (@array) and save that value in a
table called "form", into a field called "combo", i want save the
value, not an id
someone could tell me what i have to write?
Thanks

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



[Rails] Re: mysql gem install not happening on Mac OS Leopard - any inputs at all??

2010-06-17 Thread Frederick Cheung


On Jun 17, 9:58 am, Ram  wrote:
> Hello Fred,
>
> I can see the following errors in the mkmf.log residing in ../
> mysql-2.8.1/ext/mysql_api/ .
>

dumb question: do you have the apple developer tools installed?

Fred
> 1. (Under "find_library: checking for mysql_query() in -
> lmysqlclient...  no")
> conftest.c: In function 't':
> conftest.c:3: error: 'mysql_query' undeclared (first use in this
> function)
> conftest.c:3: error: (Each undeclared identifier is reported only once
> conftest.c:3: error: for each function it appears in.)
>
> 2. (Under "find_library: checking for mysql_query() in -
> lmysqlclient...  no")
> ld: library not found for -lmysqlclient
> collect2: ld returned 1 exit status
>
> 3. ld: library not found for -lmygcc (Under "have_library: checking
> for main() in -lmygcc...  no")
>
> 4. ld: library not found for -lnsl (Under "have_library: checking for
> main() in -lnsl...  no")
>
> 5. ld: library not found for -lsocket (Under "have_library: checking
> for main() in -lsocket...  no")
>
> Hope that helps. Thanks!
>
> On Jun 17, 1:37 pm, Frederick Cheung 
> wrote:
>
>
>
> > On Jun 16, 12:07 pm, Ram  wrote:
>
> > >  :S
>
> > > Im not comfortable uninstalling everything and installing it from
> > > scratch again. Dont want to lose my existing setup. Pointers from
> > > anyone at all?
>
> > There should be a log file detailing what went wrong when it tried to
> > build the gem. What's in it?
>
> > Fred
>
> > > On Jun 15, 1:52 pm, Ram  wrote:
>
> > > > I also get this warning in the very beginning of the gem install. Does
> > > > it have any relevance?
>
> > > > WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
> > > >           /usr/bin aren't both writable.
> > > > WARNING:  You don't have /Users/Ram/.gem/ruby/1.8/bin in your PATH,
> > > >           gem executables will not run.
>
> > > > On Jun 15, 1:41 pm, Ram  wrote:
>
> > > > > Hello all,
>
> > > > > Ive got Mac OS X Leopard (10.5.8), ruby 1.8.6 (2009-06-08 patchlevel
> > > > > 369) [universal-darwin9.0] and mysql 5.0.67 installed and working fine
> > > > > with Rails 2.1.0.
>
> > > > > "which ruby" outputs /usr/bin/ruby. I can see the mysql symlink in /
> > > > > usr/local/mysql. I can also see the mysql-5.0.67-osx10.5-x86 folder
> > > > > in /usr/local .
>
> > > > > Im trying to upgrade my Rails apps to 2.3.5 but when i try to install
> > > > > the mysql gem, I get "ERROR: Failed to build gem native extension." I
> > > > > tried all the following commands with and without sudo and get the
> > > > > same error everytime
>
> > > > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > > > --with-mysql-dir=/usr/local/mysql 
> > > > > > --with-mysql-lib=/usr/local/mysql/lib 
> > > > > > --with-mysql-include=/usr/local/mysql/include
> > > > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > > > --with-mysql-dir=/usr/local/mysql 
> > > > > > --with-mysql-lib=/usr/local/mysql/lib 
> > > > > > --with-mysql-include=/usr/local/mysql/include 
> > > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > > > env ARCHFLAGS="-arch i386" gem install mysql 
> > > > > > --with-mysql-dir=/usr/local/mysql
> > > > > > gem install mysql -- --with-mysql-dir=/usr/local/mysql
> > > > > > gem install mysql -- 
> > > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
>
> > > > > Im not sure what Im doing wrong. Am I supposed to uninstall the
> > > > > existing mysql and reinstall the latest (5.1.x) before I install the
> > > > > mysql gem? Or are my ruby and mysql paths screwed up? Ive googled a
> > > > > lot and tried all the suggestions (as you can see above) but none
> > > > > work.
>
> > > > > I raised this issue already in the group but no replies yet. So I've
> > > > > reframed it in a simpler fashion. Even if noone knows the solution
> > > > > right away, I'd really appreciate any inputs at all.
>
> > > > > Thanks!

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



[Rails] Re: Allow blank on should validate_uniqueness_of

2010-06-17 Thread J . Pablo Fernández
No, allowing blank is fine, the validation is this:

validate_uniqueness_of(:email, :allow_blank => true)

The issue is writing the test.

On Jun 17, 10:47 am, Colin Law  wrote:
> On 17 June 2010 09:18, pepe  wrote:
>
>
>
>
>
> > On Jun 17, 1:28 am, J. Pablo Fernández  wrote:
> >> Where do you pass that?
>
> >> should validate_uniqueness_of(:email, :allow_blank => true)
>
> >> That doesn't work. That method takes only one argument:
> > group/rubyonrails-talk?hl=en.
>
> >> --
> >> J. Pablo Fernández  (http://pupeno.com)
>
> > Here is a link to the validation method doc:
>
> >http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMeth...
>
> > You should be able to use :allow_blank => true, unless your version of
> > Rails does not support the option, which I guess could be possible? If
> > that is the case you should be able to use :if or :unless:
>
> > Supposing your model is for a customer:
>
> > # The 'c' inside the proc represents the customer record you're
> > validating (you can, of course, use any variable name you want).
> > validate_uniqueness_of :email, :unless => Proc.new {|c|
> > c.email.blank?}
>
> > You have to take into consideration that if your DB table has a unique
> > constraint on the e-mail column you'll still run into problems because
> > the DB itself will not let you add 2 records with an empty e-mail
> > address, only one. The second attempt will fail.
>
> Is the solution to allow null for the email rather than empty string?
> Will the unique constraint fail in that case?
>
> Colin

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



Re: [Rails] Interpreter Problems

2010-06-17 Thread Colin Law
On 17 June 2010 12:17, Pale Horse  wrote:
> I really aren't sure why but my interpreter continues to fail after an
> unknown amount of requests or time on my local (home) computer. I've
> tried following instructions from people who have encountered similar
> problems with no success.
>
> Is it necessary for me to provide you with version details for Ruby,
> Rails and MySQL?
>
> Does anyone know of this problem, or, better still, a way to solve it?

I think some details of the problem seen would be useful. What do you
mean by 'my interpreter continues to fail'?  What is the symptom?  Is
there anything in the log that gives clues?

Versions of rails etc and which OS may be useful.

Colin

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



[Rails] Interpreter Problems

2010-06-17 Thread Pale Horse
I really aren't sure why but my interpreter continues to fail after an
unknown amount of requests or time on my local (home) computer. I've
tried following instructions from people who have encountered similar
problems with no success.

Is it necessary for me to provide you with version details for Ruby,
Rails and MySQL?

Does anyone know of this problem, or, better still, a way to solve it?
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error

2010-06-17 Thread kannav rajeev
use action mailer optional tls

http://douglasfshearer.com/blog/gmail-smtp-with-ruby-on-rails-and-actionmailer

On Thu, Jun 17, 2010 at 2:45 PM, Nimesh Nikum  wrote:

> Try to do like this:
> from "Monaqasat "
> headers  "return-path" => 'nore...@monaqasat.com'
>
> It worked for me !!!
>
> Thanks,
> Nimesh Nikum
>
> Karim Helal wrote:
> > Any updates on how we can send a @from with a name before the email
> > address?
> >
> > I want to be able to send emails using the nore...@monaqasat.com email
> > address but show 'Monaqasat' as the name of the sender.
> >
> > Thx.
> >
> > .Karim
> >
> > Bruno Brunagh wrote:
> >> Aslam Syed wrote:
> >>> Hello all,
> >>>
> >>> I am trying to send email and written code like this:
> >>>
> >>> 
> >>>  def matches_for_request( contact, req, matching_offers )
> >>> recipients  "#{contact}"
> >>> from"gaadish...@mapunity.in"
> >>> subject "Matches found for your request"
> >>> sent_on Time.now
> >>>
> >>> body[:offers] = matching_offers
> >>>   end
> >>> 
> >>>
> >>> I also had put angled brackets in the from address like
> >>> "". However, as Chris's reply suggets I tried
> >>> removing the angled brackets. But, this did not solve my problem. I am
> >>> continuing to get the following error message:
> >>>
> >>> 555 5.5.2 Syntax error. 23sm387874pxi.9
> >>>
> >>> Please help.
> >>
> >>
> >> Hi all,
> >> I have the same issue:
> >> Net::SMTPFatalError 555 using rails 2.3.3
> >> under development environment
> >>
> >> I both tried with or without angle brackets in the @from parameter,
> >>  but with no help.
> >>
> >> Any idea?
> >>
> >> Thanks
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Thanks:
Rajeev sharma

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



Re: [Rails] Need Help - New to RoR

2010-06-17 Thread kannav rajeev
check yours db table does that exists ?

On Thu, Jun 17, 2010 at 1:31 PM, Colin Law  wrote:

> On 16 June 2010 21:48, Sangeetha  wrote:
> > Hello All,
> >
> > I installed Ruby on Windows (using rubyinstaller-1.9.1-p378.exe from
> > here - http://rubyforge.org/frs/?group_id=167).
> > Then I ran gem install rails.
> >
> > I was following instructions here -http://oreilly.com/pub/a/ruby/
> > archive/rails.html?page=1 to create my first app.
> > I was able to start the server and see the first page.
>
> That tutorial has been 'updated for rails 1.2' and is dated 2005, it
> must be hopelessly out of date.  Have a look at the Rails Guides
> (google it) to get you started and http://www.railstutorial.org/ for a
> more in depth tutorial.
>
> >
> > When I click on "About you application's environment" link, I get the
> > following message.
> >
> > We're sorry, but something went wrong. We've been notified about this
> > issue and we'll take a look at it shortly.
> >
> > I get the same message when I generate a new controller and try to
> > access that on the URL.
>
> Have a look in log/development.log for more information on what went wrong.
>
> Colin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Thanks:
Rajeev sharma

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



[Rails] Re: Rails 3: link_to with "data-confirm"

2010-06-17 Thread Michael Rigart
Hi Ray, I fixed the problem some time ago, but I'm not sure anymore what 
the problem was.

I know I had some other problems as well, And they where all related to 
a conflicting javascript library that I developed. It was not 
conflicting with rails.js but with prototype.js .

I know I also upgraded the rails.js file to the latest version as well 
as prototype (1.7 rc)

Ray Parker wrote:
> Did you find a solution to this?  I just hit this myself last night and 
> have spent a few hours trying to find an answer.

-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Allow blank on should validate_uniqueness_of

2010-06-17 Thread Colin Law
On 17 June 2010 09:18, pepe  wrote:
> On Jun 17, 1:28 am, J. Pablo Fernández  wrote:
>> Where do you pass that?
>>
>> should validate_uniqueness_of(:email, :allow_blank => true)
>>
>> That doesn't work. That method takes only one argument:
> group/rubyonrails-talk?hl=en.
>>
>> --
>> J. Pablo Fernández  (http://pupeno.com)
>
> Here is a link to the validation method doc:
>
> http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001400
>
> You should be able to use :allow_blank => true, unless your version of
> Rails does not support the option, which I guess could be possible? If
> that is the case you should be able to use :if or :unless:
>
> Supposing your model is for a customer:
>
> # The 'c' inside the proc represents the customer record you're
> validating (you can, of course, use any variable name you want).
> validate_uniqueness_of :email, :unless => Proc.new {|c|
> c.email.blank?}
>
> You have to take into consideration that if your DB table has a unique
> constraint on the e-mail column you'll still run into problems because
> the DB itself will not let you add 2 records with an empty e-mail
> address, only one. The second attempt will fail.

Is the solution to allow null for the email rather than empty string?
Will the unique constraint fail in that case?

Colin

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



[Rails] Re: Problem with options_for_select

2010-06-17 Thread Greg Ma
Ok, I find out, it works without the options_for_select
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: how to avoid (Net::SMTPFatalError) "555 5.5.2 Syntax error

2010-06-17 Thread Nimesh Nikum
Try to do like this:
from "Monaqasat "
headers  "return-path" => 'nore...@monaqasat.com'

It worked for me !!!

Thanks,
Nimesh Nikum

Karim Helal wrote:
> Any updates on how we can send a @from with a name before the email 
> address?
> 
> I want to be able to send emails using the nore...@monaqasat.com email 
> address but show 'Monaqasat' as the name of the sender.
> 
> Thx.
> 
> .Karim
> 
> Bruno Brunagh wrote:
>> Aslam Syed wrote:
>>> Hello all,
>>> 
>>> I am trying to send email and written code like this:
>>> 
>>> 
>>>  def matches_for_request( contact, req, matching_offers )
>>> recipients  "#{contact}"
>>> from"gaadish...@mapunity.in"
>>> subject "Matches found for your request"
>>> sent_on Time.now
>>> 
>>> body[:offers] = matching_offers
>>>   end
>>> 
>>> 
>>> I also had put angled brackets in the from address like 
>>> "". However, as Chris's reply suggets I tried 
>>> removing the angled brackets. But, this did not solve my problem. I am 
>>> continuing to get the following error message:
>>> 
>>> 555 5.5.2 Syntax error. 23sm387874pxi.9
>>> 
>>> Please help.
>> 
>> 
>> Hi all,
>> I have the same issue:
>> Net::SMTPFatalError 555 using rails 2.3.3
>> under development environment
>> 
>> I both tried with or without angle brackets in the @from parameter,
>>  but with no help.
>> 
>> Any idea?
>> 
>> Thanks

-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: mysql gem install not happening on Mac OS Leopard - any inputs at all??

2010-06-17 Thread Ram
Hello Fred,

I can see the following errors in the mkmf.log residing in ../
mysql-2.8.1/ext/mysql_api/ .

1. (Under "find_library: checking for mysql_query() in -
lmysqlclient...  no")
conftest.c: In function 't':
conftest.c:3: error: 'mysql_query' undeclared (first use in this
function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)

2. (Under "find_library: checking for mysql_query() in -
lmysqlclient...  no")
ld: library not found for -lmysqlclient
collect2: ld returned 1 exit status

3. ld: library not found for -lmygcc (Under "have_library: checking
for main() in -lmygcc...  no")

4. ld: library not found for -lnsl (Under "have_library: checking for
main() in -lnsl...  no")

5. ld: library not found for -lsocket (Under "have_library: checking
for main() in -lsocket...  no")

Hope that helps. Thanks!

On Jun 17, 1:37 pm, Frederick Cheung 
wrote:
> On Jun 16, 12:07 pm, Ram  wrote:
>
> >  :S
>
> > Im not comfortable uninstalling everything and installing it from
> > scratch again. Dont want to lose my existing setup. Pointers from
> > anyone at all?
>
> There should be a log file detailing what went wrong when it tried to
> build the gem. What's in it?
>
> Fred
>
>
>
> > On Jun 15, 1:52 pm, Ram  wrote:
>
> > > I also get this warning in the very beginning of the gem install. Does
> > > it have any relevance?
>
> > > WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
> > >           /usr/bin aren't both writable.
> > > WARNING:  You don't have /Users/Ram/.gem/ruby/1.8/bin in your PATH,
> > >           gem executables will not run.
>
> > > On Jun 15, 1:41 pm, Ram  wrote:
>
> > > > Hello all,
>
> > > > Ive got Mac OS X Leopard (10.5.8), ruby 1.8.6 (2009-06-08 patchlevel
> > > > 369) [universal-darwin9.0] and mysql 5.0.67 installed and working fine
> > > > with Rails 2.1.0.
>
> > > > "which ruby" outputs /usr/bin/ruby. I can see the mysql symlink in /
> > > > usr/local/mysql. I can also see the mysql-5.0.67-osx10.5-x86 folder
> > > > in /usr/local .
>
> > > > Im trying to upgrade my Rails apps to 2.3.5 but when i try to install
> > > > the mysql gem, I get "ERROR: Failed to build gem native extension." I
> > > > tried all the following commands with and without sudo and get the
> > > > same error everytime
>
> > > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > > --with-mysql-dir=/usr/local/mysql 
> > > > > --with-mysql-lib=/usr/local/mysql/lib 
> > > > > --with-mysql-include=/usr/local/mysql/include
> > > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > > --with-mysql-dir=/usr/local/mysql 
> > > > > --with-mysql-lib=/usr/local/mysql/lib 
> > > > > --with-mysql-include=/usr/local/mysql/include 
> > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > > env ARCHFLAGS="-arch i386" gem install mysql 
> > > > > --with-mysql-dir=/usr/local/mysql
> > > > > gem install mysql -- --with-mysql-dir=/usr/local/mysql
> > > > > gem install mysql -- 
> > > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
>
> > > > Im not sure what Im doing wrong. Am I supposed to uninstall the
> > > > existing mysql and reinstall the latest (5.1.x) before I install the
> > > > mysql gem? Or are my ruby and mysql paths screwed up? Ive googled a
> > > > lot and tried all the suggestions (as you can see above) but none
> > > > work.
>
> > > > I raised this issue already in the group but no replies yet. So I've
> > > > reframed it in a simpler fashion. Even if noone knows the solution
> > > > right away, I'd really appreciate any inputs at all.
>
> > > > Thanks!

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



Re: [Rails] Big performance issues regarding the browser

2010-06-17 Thread Colin Law
On 17 June 2010 09:36, Nicolas Vincent  wrote:
> Hi !
>
> I have a ruby server set up running Ruby v1.8.7 and those gems :
> actionmailer (2.3.8, 2.3.5, 2.3.3)
> actionpack (2.3.8, 2.3.5, 2.3.3)
> activerecord (2.3.8, 2.3.5, 2.3.3)
> activeresource (2.3.8, 2.3.5, 2.3.3)
> activesupport (2.3.8, 2.3.5, 2.3.3)
> fastthread (1.0.7)
> haml (3.0.12, 2.0.6)
> mysql (2.8.1)
> passenger (2.2.14, 2.2.9)
> rack (1.1.0, 1.0.1)
> rails (2.3.8, 2.3.5, 2.3.3)
> rake (0.8.7)
> restful_authentication (1.1.6)
>
> The web server used is NGinx running on port 8443 ; transactions are
> made with HTTPS.
>
> I'm facing a serious issue : when the developped site is browsed with
> firefox, eveything is clean and fast. When browsed with IE, it is
> ve sl (more than a minute for each page to show). I
> checked various parameters on the server, in the browser, checked the
> logs,but I'm running out of idea.

Are you sure it is browser related rather than a configuration problem
on the client PC?  If you have not already done so try it on another
PC.  You may already have done this of course.

Another thought, have you checked that the html is valid by pasting it
into the w3c html validator website?

Colin

>
> Has one of you faced a problem like it before ?
>
> Could you propose a way to determine where the bottleneck is ?
>
> The only thing I havent done is install a packet sniffer to investigate
> the transactions ...
>
> Any help would be really appreciated,
>
> Thanks a lot,
>
> Nicolas
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] Re: Allow blank on should validate_uniqueness_of

2010-06-17 Thread J . Pablo Fernández
pepe, I'm not asking how to do the validation, I'm asking how to test
the validation with shoulda using the new syntax, I already have this
line in the model:

validate_uniqueness_of :email, :allow_blank => true

in my tests I have:

should validate_uniqueness_of(:email)

should being a shoulda method.

On Thu, Jun 17, 2010 at 10:18, pepe  wrote:
> On Jun 17, 1:28 am, J. Pablo Fernández  wrote:
>> Where do you pass that?
>>
>> should validate_uniqueness_of(:email, :allow_blank => true)
>>
>> That doesn't work. That method takes only one argument:
> group/rubyonrails-talk?hl=en.
>>
>> --
>> J. Pablo Fernández  (http://pupeno.com)
>
> Here is a link to the validation method doc:
>
> http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001400
>
> You should be able to use :allow_blank => true, unless your version of
> Rails does not support the option, which I guess could be possible? If
> that is the case you should be able to use :if or :unless:
>
> Supposing your model is for a customer:
>
> # The 'c' inside the proc represents the customer record you're
> validating (you can, of course, use any variable name you want).
> validate_uniqueness_of :email, :unless => Proc.new {|c|
> c.email.blank?}
>
> You have to take into consideration that if your DB table has a unique
> constraint on the e-mail column you'll still run into problems because
> the DB itself will not let you add 2 records with an empty e-mail
> address, only one. The second attempt will fail.
>
> Hope it helps.
>
> --
> You received 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.
>
>



-- 
J. Pablo Fernández  (http://pupeno.com)

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



Re: [Rails] Allow blank on should validate_uniqueness_of

2010-06-17 Thread J . Pablo Fernández
I'm asking how to test the validation with shoulda with the new
syntax, hence the line:

should validate_uniqueness_of(:email)

On Thu, Jun 17, 2010 at 10:45, Colin Law  wrote:
> 2010/6/15 J. Pablo Fernández :
>> Hello,
>>
>> Using shoulda, any ideas how to allow blank when having this test:
>>
>> should validate_uniqueness_of(:email)
>
> I think there is confusion about your question.  Are you asking how to
> allow blank in the validation itself (in which case allows_blank in
> the call of validates_uniqueness of is the way to go) or are you
> asking how to code the test to check that multiple blank emails are
> allowed?
>
> Colin
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>



-- 
J. Pablo Fernández  (http://pupeno.com)

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



Re: [Rails] Allow blank on should validate_uniqueness_of

2010-06-17 Thread Colin Law
2010/6/15 J. Pablo Fernández :
> Hello,
>
> Using shoulda, any ideas how to allow blank when having this test:
>
> should validate_uniqueness_of(:email)

I think there is confusion about your question.  Are you asking how to
allow blank in the validation itself (in which case allows_blank in
the call of validates_uniqueness of is the way to go) or are you
asking how to code the test to check that multiple blank emails are
allowed?

Colin

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



Re: [Rails] Need Help - New to RoR

2010-06-17 Thread Colin Law
On 16 June 2010 21:48, Sangeetha  wrote:
> Hello All,
>
> I installed Ruby on Windows (using rubyinstaller-1.9.1-p378.exe from
> here - http://rubyforge.org/frs/?group_id=167).
> Then I ran gem install rails.
>
> I was following instructions here -http://oreilly.com/pub/a/ruby/
> archive/rails.html?page=1 to create my first app.
> I was able to start the server and see the first page.

That tutorial has been 'updated for rails 1.2' and is dated 2005, it
must be hopelessly out of date.  Have a look at the Rails Guides
(google it) to get you started and http://www.railstutorial.org/ for a
more in depth tutorial.

>
> When I click on "About you application's environment" link, I get the
> following message.
>
> We're sorry, but something went wrong. We've been notified about this
> issue and we'll take a look at it shortly.
>
> I get the same message when I generate a new controller and try to
> access that on the URL.

Have a look in log/development.log for more information on what went wrong.

Colin

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



[Rails] Windows 7 and imagemagick

2010-06-17 Thread ashu
rails 2-.3.8 i am using install rmagick having an error fo
Core_rl_rmaigick.dll mising re-install may solve the problem

i think its issue of where to install imagemagick in which folder
can you please suggest .

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



[Rails] Re: Learning RoR

2010-06-17 Thread rtacconi
I agree with DK: Agile Web Development with Rails, the last edition
covers Rails 3. The tutorial (first part of the book) is what you need
to get started. I watched the ruby videos at http://www.lynda.com/ but
it is a bit outdated. Than do not forget popular screencasts sites:

railscasts.com - intermediate level, best screencasts on Rails
learnivore.com - list of screencasts sites
http://peepcode.com/ - good quality but commercial
http://ruby5.envylabs.com/ - podcasts
http://www.informit.com/store/product.aspx?isbn=0321517067 - DVD
course, I suppose it is outdated
google, blogs and, of course, http://guides.rubyonrails.com/



On Jun 16, 4:36 pm, Juan Pablo Genovese 
wrote:
> If you are new to Ruby too, don't forget to take a look at "The Well
> Grounded Rubyist". It's an awesome book.
>
> 2010/6/15 Ryan Kneer 
>
>
>
> > Hey.  I'm just getting into RoR and was hoping someone could direct me
> > to the best learning resources.
>
> > P.S.: I took a couple computer sciences courses in university (learned
> > some Java and C++).
>
> > Cheers,
> > Ryan
>
> > --
> > You received 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.
>
> --
> Mis mejores deseos,
> Best wishes,
> Meilleurs vœux,
>
> Juan Pablo
> --http://www.twitter.com/eljuanchosf

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



[Rails] Re: mysql gem install not happening on Mac OS Leopard - any inputs at all??

2010-06-17 Thread Frederick Cheung


On Jun 16, 12:07 pm, Ram  wrote:
>  :S
>
> Im not comfortable uninstalling everything and installing it from
> scratch again. Dont want to lose my existing setup. Pointers from
> anyone at all?
>

There should be a log file detailing what went wrong when it tried to
build the gem. What's in it?

Fred
> On Jun 15, 1:52 pm, Ram  wrote:
>
>
>
> > I also get this warning in the very beginning of the gem install. Does
> > it have any relevance?
>
> > WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
> >           /usr/bin aren't both writable.
> > WARNING:  You don't have /Users/Ram/.gem/ruby/1.8/bin in your PATH,
> >           gem executables will not run.
>
> > On Jun 15, 1:41 pm, Ram  wrote:
>
> > > Hello all,
>
> > > Ive got Mac OS X Leopard (10.5.8), ruby 1.8.6 (2009-06-08 patchlevel
> > > 369) [universal-darwin9.0] and mysql 5.0.67 installed and working fine
> > > with Rails 2.1.0.
>
> > > "which ruby" outputs /usr/bin/ruby. I can see the mysql symlink in /
> > > usr/local/mysql. I can also see the mysql-5.0.67-osx10.5-x86 folder
> > > in /usr/local .
>
> > > Im trying to upgrade my Rails apps to 2.3.5 but when i try to install
> > > the mysql gem, I get "ERROR: Failed to build gem native extension." I
> > > tried all the following commands with and without sudo and get the
> > > same error everytime
>
> > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib 
> > > > --with-mysql-include=/usr/local/mysql/include
> > > > env ARCHFLAGS="-arch i386" gem install mysql -- 
> > > > --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib 
> > > > --with-mysql-include=/usr/local/mysql/include 
> > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
> > > > env ARCHFLAGS="-arch i386" gem install mysql 
> > > > --with-mysql-dir=/usr/local/mysql
> > > > gem install mysql -- --with-mysql-dir=/usr/local/mysql
> > > > gem install mysql -- 
> > > > --with-mysql-config=/usr/local/mysql/bin/mysql_config
>
> > > Im not sure what Im doing wrong. Am I supposed to uninstall the
> > > existing mysql and reinstall the latest (5.1.x) before I install the
> > > mysql gem? Or are my ruby and mysql paths screwed up? Ive googled a
> > > lot and tried all the suggestions (as you can see above) but none
> > > work.
>
> > > I raised this issue already in the group but no replies yet. So I've
> > > reframed it in a simpler fashion. Even if noone knows the solution
> > > right away, I'd really appreciate any inputs at all.
>
> > > Thanks!

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



[Rails] Problem with options_for_select

2010-06-17 Thread Greg Ma
Hi,
I have a problem with the form select. In the value field I have the
generated html...

<%= f.select :brand_id,
  options_for_select([['Brands', 0]] +
@search_brands.map { |b| [b.name, b.id]}),
  {:id => 'cbxBrand', :tabindex => (@tabindex += 1)} %>


This is the html:






Am i forgetting a parameter or something?

Greg
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Big performance issues regarding the browser

2010-06-17 Thread Nicolas Vincent
Hi !

I have a ruby server set up running Ruby v1.8.7 and those gems :
actionmailer (2.3.8, 2.3.5, 2.3.3)
actionpack (2.3.8, 2.3.5, 2.3.3)
activerecord (2.3.8, 2.3.5, 2.3.3)
activeresource (2.3.8, 2.3.5, 2.3.3)
activesupport (2.3.8, 2.3.5, 2.3.3)
fastthread (1.0.7)
haml (3.0.12, 2.0.6)
mysql (2.8.1)
passenger (2.2.14, 2.2.9)
rack (1.1.0, 1.0.1)
rails (2.3.8, 2.3.5, 2.3.3)
rake (0.8.7)
restful_authentication (1.1.6)

The web server used is NGinx running on port 8443 ; transactions are
made with HTTPS.

I'm facing a serious issue : when the developped site is browsed with
firefox, eveything is clean and fast. When browsed with IE, it is
ve sl (more than a minute for each page to show). I
checked various parameters on the server, in the browser, checked the
logs,but I'm running out of idea.

Has one of you faced a problem like it before ?

Could you propose a way to determine where the bottleneck is ?

The only thing I havent done is install a packet sniffer to investigate
the transactions ...

Any help would be really appreciated,

Thanks a lot,

Nicolas
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Errno::ENOENT in User sessionsController#new No such file or directory - getcwd

2010-06-17 Thread Colin Law
On 16 June 2010 23:43, bpfarmer  wrote:
> I cloned an existing git repo and get that error when I try to use
> script/server and view the application on a mongrel server.  I can
> still access the models in script/console.

Someone may suggest an answer from this limited data but I think the
full stack trace might be helpful.  Have a look at it yourself first
and try and see what is wrong.  If it gives a line number in
user_sessions_controller where it has failed have a look at the code.

Colin

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



[Rails] Re: Stopping enter from submitting a form

2010-06-17 Thread pepe
I just read this up in a JS book. The submit button has actually 2
events happening sequentially. The first one is an onClick and the
second one an onSubmit. Both can return false and stop the execution
of the action. If onClick returns false onSubmit will not be executed.
I guess you could control your flow of execution based on what area of
the page has the focus and only submit the form when you're really
done and switch focus to the next area of your page based on where you
are when the submit button is pressed.

On Jun 16, 4:20 pm, Brent Jameson  wrote:
> Hey all,
>
> I'm working on a rails app that will be accepting input from a wide
> array of brandless barcode scanners. Is there anyway of making the
> return key tab to the next field instead of submitting the form? I
> know this is more of a javascript thing, but I just can't get it
> solved.

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



[Rails] Re: Allow blank on should validate_uniqueness_of

2010-06-17 Thread pepe
On Jun 17, 1:28 am, J. Pablo Fernández  wrote:
> Where do you pass that?
>
> should validate_uniqueness_of(:email, :allow_blank => true)
>
> That doesn't work. That method takes only one argument:
group/rubyonrails-talk?hl=en.
>
> --
> J. Pablo Fernández  (http://pupeno.com)

Here is a link to the validation method doc:

http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#M001400

You should be able to use :allow_blank => true, unless your version of
Rails does not support the option, which I guess could be possible? If
that is the case you should be able to use :if or :unless:

Supposing your model is for a customer:

# The 'c' inside the proc represents the customer record you're
validating (you can, of course, use any variable name you want).
validate_uniqueness_of :email, :unless => Proc.new {|c|
c.email.blank?}

You have to take into consideration that if your DB table has a unique
constraint on the e-mail column you'll still run into problems because
the DB itself will not let you add 2 records with an empty e-mail
address, only one. The second attempt will fail.

Hope it helps.

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



  1   2   >