[Rails] Rating Plugin

2010-06-20 Thread Charanya Nagarajan
Hi,

I wanna rate an object on multiple criteria
Like..
Benefits
Applicability

etc..

So i would want the user to rate an object on 2 criteria.
Is there any plugin which will suit my need.Acts_as_rateable allows only
rating on a single context..

Thanks In Advance..

Charanya Nagarajan
-- 
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] Gem/plugin for AJAX advance search (multiple params)

2010-06-20 Thread Fernando Brito
Hello,

Does someone know a Gem or a plugin that can help me building something like
this advance search: http://demo.neeraj.name/admin_data/advance_search/user?
I like it because it knows if it is an integer field or string field
and automatically fill the select field with the correct options (greater
than, equal than, etc).

Or should I just try to implement my own solution, copying and pasting
somethings from admin_data?

Redmine has something similar:
http://www.redmine.org/projects/redmine/issues
In one hand, it fills the select field better then admin_data when there is
a table relationship but on the other hand I can't add 2 filters for the
same field. For example, I can't search issues with "% done" greater then 20
AND less then 70.

Thanks,
--
Fernando Brito

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] error when calling "to_sql" (Rails 3 beta 4, 1.9.2-head)

2010-06-20 Thread Matt Slay
I'm testing Rails 3 beta 4 on Ruby 1.9.2-head, and when I start a
console and do:

 Game.first.to_sql

I get this error:

  ArgumentError: wrong number of arguments (0 for 1)


I know it can find the Game record, because when I type:

  Game.first

it returns:

=> #


What am I missing? I just want to make the to_ql work in a very simple
case.
-- 
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: tabular view gem in script/console

2010-06-20 Thread Chamnap
Hi,

Thanks for your help.

Chamnap

On Jun 17, 8:53 pm, Leonardo Mateo  wrote:
> 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: Pleas Help Me regarding rake db:migrate

2010-06-20 Thread Tam Huynh
Haribhau Ingale  writes:

> 
> 
> I mean delete books table manually from Database if you don't have two
migration files creating books table.
> On Sat, May 29, 2010 at 3:49 PM, Haribhau Ingale
 wrote:Hi,  Can you just
check once again that you don't have two migration files creating books table?
If not then you can choose books tables manually.Thanks,--Haribhau
> 
> 
> 
> On Sat, May 29, 2010 at 3:24 AM, DVM
 wrote:
> 
> I am beginner for this Rails  from the past 2 days I am working hard
> to fix the following error
> C:\Murali Rubby\demo\library>rake db:migrate
> (in C:/Murali Rubby/demo/library)
> ==  CreateBooks: migrating
> 


---
Hi,

For this issue, I see the solution below on the internet, Can you try it:

** Add ":force => true" to your code.

example:
...
create_table :books, :force => true do |t|
t.string :title, :limit => 32, :null => false
..

** Try again: rake db:migrate --trace, then look at the Database to see 
the changes.

** This issue will be resolved by the logic in:
- We have the logic to handle this in:
ruby\gems\1.8\gems\activerecord-2.3.8\lib\active_record\connection_adapters
\abstract\schema_statements.rb

Regards,
THuynh


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: NoMethodError in StoreController#add_to_cart -> getting nil

2010-06-20 Thread Manuel Manuel
Manuel Manuel wrote:
> Hey everybody,
> 
> I am currently following the depot application from the book Web Agile
> Development with Rails (3rd Edition) but after creating the controller
> for the Store and the Cart model, I am always getting a nil product, no
> matter how many products I add to the database.
> I am very new with RoR (this only the page 110 of the book) and thus I
> am not very sure about what I could do to mitigate the problem.
> 
> Thanks a lot in advance!

The errors are both Cart.rb, line number 9:

def add_product(product)
-> @items << product
end

and

def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
 -> @cart.add_product(product)
end

Error:
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
-- 
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: Google Charts question.

2010-06-20 Thread PsiPro
You doing this all by hand? or using 
http://code.google.com/p/google-charts-on-rails/
or something comparable?

On Jun 20, 2:04 pm, UA  wrote:
> Ok... i was doing it in Rails.. though. thanks.
>
> On Jun 20, 1:00 pm, Marnen Laibow-Koser  wrote:
>
> > Ritvvij Parrikh wrote:
> > > Hello
>
> > > I am trying out Google Charts for the first time.
> > > There is a rectangular container to the Chart and then the Chart
> > > itself inside.
> > > There is a lot of space wasted in some kind of padding within the
> > > actual chart and the container.
>
> > > I tried playing around with width and height parameters still does not
> > > help.
> > > Can you someone advise please?
>
> > Please ask this question in Google's forums, where it will be on topic.
>
> > Best,
> > --
> > Marnen Laibow-Koserhttp://www.marnen.org
> > mar...@marnen.org
> > --
> > 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] NoMethodError in StoreController#add_to_cart -> getting nil

2010-06-20 Thread Manuel Manuel
Hey everybody,

I am currently following the depot application from the book Web Agile
Development with Rails (3rd Edition) but after creating the controller
for the Store and the Cart model, I am always getting a nil product, no
matter how many products I add to the database.
I am very new with RoR (this only the page 110 of the book) and thus I
am not very sure about what I could do to mitigate the problem.

Thanks a lot in advance!
-- 
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] ActiveRecord and ARel: correlated subqueries?

2010-06-20 Thread Michael Schuerig

I'm trying to figure out how to use ActiveRecord in conjunction with 
ARel. In particular, I'd like to replace my residual literal SQL with 
ARel, if only I could see how.

Let's take Article with multiple Versions as an example. With ARel 
alone, I can find articles with their latest versions like this

articles = Article.arel_table
versions = Article.arel_table

articles.join(versions).on(articles[:id].eq(versions[:article_id])).
  where(versions[:revision].eq(
versions.project(versions[:revision].maximum).
  where(versions[:article_id].eq(articles[:id]

That doesn't help me much in the context of ActiveRecord. There, I'd 
like to define things like this

class Article < ActiveRecord::Base
  has_many :versions
  has_one  :version
  scope :with_latest_version, ...
  scope :with_nth_version, lambda { |n| ... }
end

class Version < ActiveRecord::Base
  scope :latest, ...
end

In Rails 2.3.8, I have defined all this with the judicious help of some 
SQL. In Rails 3 I'd like to use ARel.

If you're wondering what the point of Article#version is: it points to a 
version that is determined by the query used to retrieve the object. So 
for

articles = Article.with_latest_version

article[i].version

is intended to be the latest version. Works nicely in 2.3.8, but in 
3.beta4 it breaks down somewhere when ARel somewhere deep down doesn't 
remember anymore that there is a :version association.

Michael

-- 
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/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] Error for update model with attachment_fu without file

2010-06-20 Thread Marcelo Junior
class AlbumSong < ActiveRecord::Base

  MAX_SIZE_IN_MB = 10

  has_attachment :content_type => 'audio/mp3',
:storage => :s3,
:max_size => MAX_SIZE_IN_MB.megabytes

  acts_as_indexed :fields => [:title, :author],
:index_file => [Rails.root.to_s, "tmp", "index"]

  belongs_to :album

  validates_presence_of :title
  validates_uniqueness_of :title
end

When update a model without file, it appears the following error. How
can I solve?


TypeError: can't convert nil into String
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb:262:in
`join'
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb:262:in
`full_filename'
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:367:in
`temp_paths'
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:361:in
`temp_path'
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:320:in
`save_attachment?'
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:424:in
`set_size_from_temp_path'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
`send'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
`evaluate_method'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in
`call'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in
`run'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in
`each'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in
`send'
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in
`run'
from
/home/marcelo/hueb/bandas/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:492:in
`run_callbacks'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:344:in
`callback'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:311:in
`valid?'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1077:in
`save_without_dirty'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in
`save_without_transactions'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in
`send'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in
`with_transaction_returning_status'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in
`transaction'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in
`transaction'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in
`with_transaction_returning_status'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in
`save'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in
`rollback_active_record_state!'
from
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in
`save'
from (irb):4>>
-- 
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] find in controller or view

2010-06-20 Thread Norm Scherer




I have an app
that does a number of collection_selects.  There are two general
methods of getting the data and displaying it that I am aware of.

You can do a find in the controller and assign the result to an
instance variable and do the collection_select stuff in the view.

Alternatively you can put the whole find and collection_select in the
view (in erb of course).

To me it seems to clutter up the view to do the find in the view so I
prefer it in the controller.  Is there some reason that it would be
better to do it all in the view? 

I am looking for opinions here on the 'best practice' or does it not
matter?

Thanks
Norm






-- 
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] Multiple has_one to same table

2010-06-20 Thread Michael Pavling
On 20 June 2010 20:05, dkmdnielsen  wrote:
> Your input/experience appreciated.  I have noticed multiple
> discussions regarding husband and wife.  But none really end in a
> "this is a the best way to handle things."

http://qntm.org/gay

Of course, you can stop at level 7 or 8 if it suits you.

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



[Rails] Re: Make just one restful action singular

2010-06-20 Thread Agoofin
Can't you declare the resource in the singular form?

http://api.rubyonrails.org/classes/ActionController/Resources.html#M000308



On Jun 20, 3:12 pm, Rory McKinley  wrote:
> On 20/06/2010 20:59, Marnen Laibow-Koser wrote:
> > Wrong.  If that were so, map.resource wouldn't exist.
>
> 
>
> I think I explained myself badly - I am not arguing that you cannot do
> it - but I was stating that for a consumer of the user/edit resource -
> the consumer needs to know internal detail (that the user will be set to
> the current user) to be able to answer the question "Which user am I
> editing?".
>
> With the more explicit version - users/:id/edit - it is more obvious
> which resource is being edited.
>
> So, whichever one is better depends on the OP's use case and how much he
> wants the consumer to know about the implementation. I tend to err on
> the side of more explicitness with methods that are publicly exposed but
> I am always open to hearing counter opinions on the matter :)

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] Multiple has_one to same table

2010-06-20 Thread dkmdnielsen
Your input/experience appreciated.  I have noticed multiple
discussions regarding husband and wife.  But none really end in a
"this is a the best way to handle things."  Here is my situation.  I'm
recording information on couples -- husband and wife, one of each.  If
the two are no longer married, the couple will evaporate.  If either
person is deleted, then couple will evaporate.  I originally thought
of having all individuals in one table, persons, and then creating
couple with alink to each person.

# == Schema Information
# Schema version: 20100620123354
#
# Table name: couples
#
#  id:integer not null, primary key
#  active:boolean
#  husband_id:integer  # reference to persons table
#  wife_id   :integer  # reference to persons table

I was then thinking:

belongs_to :husband,:class_name=>"Person",:foreign_key=>"husband_id"
belongs_to :wife,:class_name=>"Person",:foreign_key=>"wife_id"

and then having classes "Husband < Person" and "Wife < Person".  Is
this feasible?

I am so torn I don't know what step to take next.  I'm early in
development so I can do anything.  But what I want to do is what is
best.

Do I stick with a couples table and one persons table?

Do I create separate tables for husbands and wives?  If I do this, can
I create one Person class and Husband & Wife models inheriting
Person...that way the two tables are created and migrated
separately?

You input is really appreciated.
dvn

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] n00b question: 'Having troubles with map.namespace :admin'

2010-06-20 Thread Sebastian
Hi everyone!
Im having troubles with my routes.rb, i set map.namespace :admin so i
can enter to my scaffold 'contacts' via admin/contacts', but the view
its crashing showing this error:; *undefined method `contact_path' for
#*

The question is: 'where is *contact_path* variable declared?'

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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-20 Thread Agoofin
Look at your link_to in the index.html, it should contain the id for
the story you want to show.

Also, check to make sure that you have the to_param method in your
model, story.db and that it's correct. The author implements a
complicated beautification of the urls which is a waste in the course
of the examples.

I have the same book, one of the best for learning rails imho.

One other question for you - there are some extra methods that are a
bit confusing, your bin method and the get_stories for example. I
don't think the saving of a few lines of code is worth the possible
confusion.

On Jun 17, 6:32 pm, 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
>
> 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 viahttp://www.ruby-forum.com/.

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



Re: [Rails] Re: Re: Make just one restful action singular

2010-06-20 Thread Rory McKinley

On 20/06/2010 20:59, Marnen Laibow-Koser wrote:


Wrong.  If that were so, map.resource wouldn't exist.



I think I explained myself badly - I am not arguing that you cannot do 
it - but I was stating that for a consumer of the user/edit resource - 
the consumer needs to know internal detail (that the user will be set to 
the current user) to be able to answer the question "Which user am I 
editing?".


With the more explicit version - users/:id/edit - it is more obvious 
which resource is being edited.


So, whichever one is better depends on the OP's use case and how much he 
wants the consumer to know about the implementation. I tend to err on 
the side of more explicitness with methods that are publicly exposed but 
I am always open to hearing counter opinions on the matter :)


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



Re: [Rails] Re: Re: Using MacPorts To Install Ruby 1.9.1 and Rails 2.3.0 RC1

2010-06-20 Thread Conrad Taylor
On Sun, Jun 20, 2010 at 11:54 AM, Fernando Perez wrote:

> > If you're using Rails 3, it is recommended that you use Ruby 1.9.2.
> > If this is the case, then you might want to use RVM for installing
> > Ruby by doing the following:
> >
> > rvm install 1.9.2- head
> >
> > Good luck,
> >
> > -Conrad
>
> I'm still running 2.3.8 until 3 goes official. I'll give a try at RVM.
>
> By the way my machine runs Tiger on a PowerPC, is there any issue I
> might run into?
>

If you're using Rail 2.3.8, I would still recommend using Ruby 1.9.2 instead
of Ruby 1.9.1.  Why?

http://www.infoq.com/news/2010/03/ruby-192-schedule

Next, I would recommend upgrading to Leopard but you should be good
with Tiger.

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] Re: Re: Make just one restful action singular

2010-06-20 Thread Marnen Laibow-Koser
Rory McKinley wrote:
> On 20/06/2010 17:18, Marnen Laibow-Koser wrote:
> 
>> /users/edit would seem like it's supposed to edit *all* users.  You
>> probably want something like /user/edit .
> 
> 
> Sorry, going to commit the sin of not answering your question directly 
> :)
> 
> Would an approach such as this not make your interface less clear?
> 
> Within the Rails interpretation of REST, a path such as user/edit would
> still make it seem as if you are working on a collection rather than a
> member.

Wrong.  If that were so, map.resource wouldn't exist.

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: Using MacPorts To Install Ruby 1.9.1 and Rails 2.3.0 RC1

2010-06-20 Thread Fernando Perez
> If you're using Rails 3, it is recommended that you use Ruby 1.9.2.
> If this is the case, then you might want to use RVM for installing
> Ruby by doing the following:
> 
> rvm install 1.9.2- head
> 
> Good luck,
> 
> -Conrad

I'm still running 2.3.8 until 3 goes official. I'll give a try at RVM.

By the way my machine runs Tiger on a PowerPC, is there any issue I 
might run into?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Problem with testing rails applications..

2010-06-20 Thread Agoofin
Seems others are having this issue on Windows as well.

Try here for some direction: 
http://groups.google.com/group/rubyinstaller/browse_thread/thread/bd7ec8e1dab4ff17

Hope this helps

On Jun 20, 2:11 pm, Joe  wrote:
> When trying "gem install sqlite3-ruby"; it spits out "no definition
> for libversion".
>
> And when trying to "rake gems:install" it seems to think that
> everything is absolutely fine.
>
> Please note although I dont think it'll make a difference I get this
> on starting the application:
>
> C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:
> 99:Warning: Gem::Dependency#version_requirements is deprecated and
> will be removed on or after August 2010.  Use #requirement
>
> Please Help,
>
> Thanks In Advance,
>
> -Joe
>
> On Jun 20, 6:10 pm, Conrad Taylor  wrote:
>
> > Sent from my iPhone
>
> > On Jun 20, 2010, at 9:42 AM, Joe  wrote:
>
> > > Hi,
>
> > > Recently I've been trying to add permalinks to my rails system, so
> > > because I had my new OS just installed I installed ruby and rails and
> > > all of the things I had before..
> > > Then I downloaded my application files directly from the web, and
> > > attempted to run the server; when I visit it in my browser it comes up
> > > with my custom error message, and the console displays this:
>
> > > /!\ FAILSAFE /!\  Sun Jun 20 17:39:08 +0100 2010
> > >  Status: 500 Internal Server Error
> > >  no such file to load -- sqlite3
>
> >  From the message above, you are missing sqlite3.  You might want to
> > verify that each gem dependency is installed before you try to run
> > your application.
>
> > Good luck,
>
> > -Conrad
>
> > > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > > `gem_original_require'
> > >    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > > `require'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > > active_support/dependencies.rb:156:in `require'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > > active_support/dependencies.rb:521:in `new_constants_in'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > > active_support/dependencies.rb:156:in `require'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > > active_support/core_ext/kernel/requires.rb:7:in
> > > `require_library_or_gem'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > > active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > > active_support/core_ext/kernel/requires.rb:5:in
> > > `require_library_or_gem'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/sqlite3_adapter.rb:10:in
> > > `sqlite3_connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:223:in
> > > `send'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:223:in
> > > `new_connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:245:in
> > > `checkout_new_connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:188:in
> > > `checkout'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:184:in
> > > `loop'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:184:in
> > > `checkout'
> > >    C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:183:in
> > > `checkout'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:98:in
> > > `connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:326:in
> > > `retrieve_connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/
> > > connection_specification.rb:
> > > 123:in `retrieve_connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/
> > > connection_specification.rb:
> > > 115:in `connection'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/query_cache.rb:9:in `cache'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/query_cache.rb:28:in `call'
> > >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > > active_record/connection_adapters/abstract/connection_pool.rb:36

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

2010-06-20 Thread Rory McKinley

On 20/06/2010 01:08, Omar Renteria wrote:

But it exists...in deed when I try the same param in rails console the
object is found.



Are both cases (console and code running on server) running under the 
same environment? E.g. development vs production


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: Make just one restful action singular

2010-06-20 Thread Rory McKinley

On 20/06/2010 17:18, Marnen Laibow-Koser wrote:


/users/edit would seem like it's supposed to edit *all* users.  You
probably want something like /user/edit .



Sorry, going to commit the sin of not answering your question directly :)

Would an approach such as this not make your interface less clear?

Within the Rails interpretation of REST, a path such as user/edit would 
still make it seem as if you are working on a collection rather than a 
member.


While users/1234/edit may be redundant because your code is taking care 
of determining the user, the consumer of this interface should not need 
to know about this. Even if it is redundant, I would say the clarity 
that you achieve by using users/:id/edit outweighs the cost of the 
duplication.


Perhaps an approach would be to return a 403 if the consumer tries to 
edit a user that is not a current user?



--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] gitignore

2010-06-20 Thread Rory McKinley

On 20/06/2010 07:44, giorgio wrote:

I have just started using rad rails again after a long stint on
netbeans.

It seems to generate loads of files like:
app/views/group/.tmp_group_summary.rhtml.99932

I want to make git ignore all these .tmp files but my entries in
gitignore have so far been of no avail.

Anybody give me a suggestion?



.tmp_* will ignore the file given as an example above - you would just 
need to ensure that it doesn't ignore anything you would want to keep as 
it is a fairly large net :)


Rory

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: gitignore

2010-06-20 Thread Agoofin
I like the IDE approach overall. Netbeans has some nice autocomplete
features that really help in writing the code, but then again a simple
editor can work well too.

For the gitignore, just add a pattern of which files you don't want
included either in the root directory or in the specific directory.
Something along the lines of tmp_*

Should be a setting in rad rails for the backups as well.

Hope this helps.

p.s. http://help.github.com/git-ignore/

On Jun 20, 1:44 am, giorgio  wrote:
> I have just started using rad rails again after a long stint on
> netbeans.
>
> It seems to generate loads of files like:
> app/views/group/.tmp_group_summary.rhtml.99932
>
> I want to make git ignore all these .tmp files but my entries in
> gitignore have so far been of no avail.
>
> Anybody give me a suggestion?
>
> Cheers
> George

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] Self Reference, Almost There (I Hope!)

2010-06-20 Thread Michael Pavling
On 20 June 2010 19:12, Michael Satterwhite  wrote:
> class CreateRelationships < ActiveRecord::Migration
>  def self.up
>    create_table :relationships, :id => false do |t|
>    t.integer :category_id
>    t.integer :parent_id
>    t.integer :sort_order
>      t.timestamps
>    end
>  end
> end

If "relationships" is a join table, then it can't have any fields
other than the two foreign keys.

> class Relationship < ActiveRecord::Base
>  belongs_to :category,  :class_name => 'Category',
>       :foreign_key => 'category_id'
>  belongs_to :parent,   :class_name => 'Category',
>             :foreign_key => 'parent_id
> end

Right - so Relationship is an AR model - it *needs* an ID column.

There might be some other issues... but get to them after the
Relationship models are working (try creating one in the console to
make sure it works...)

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



[Rails] Self Reference, Almost There (I Hope!)

2010-06-20 Thread Michael Satterwhite
I'm still struggling with the self reference. I *THINK* I'm getting
close. I have the following tables:

class CreateCategories < ActiveRecord::Migration
  def self.up
create_table :categories do |t|
t.string :name, :limit => 40
  t.timestamps
end
  end
end

class CreateRelationships < ActiveRecord::Migration
  def self.up
create_table :relationships, :id => false do |t|
t.integer :category_id
t.integer :parent_id
t.integer :sort_order
  t.timestamps
end
  end
end

My models look like this:

class Relationship < ActiveRecord::Base
  belongs_to :category,  :class_name => 'Category',
   :foreign_key => 'category_id'
  belongs_to :parent,   :class_name => 'Category',
 :foreign_key => 'parent_id
end

class Category < ActiveRecord::Base
  has_many :relationships, :foreign_key => 'category_id'

  has_many :parents, :class_name => 'Category',
 :through => 'relationships',
 :source => :parent

  has_many :children, :class_name => 'Category',
  :through => 'relationships',
  :source => :category
end

I can create a category. When I try to add a parent to it (e.g.
c.parents << p) I get the error

ActiveRecord::HasManyThroughAssociationNotFoundError: Could not find the
association "relationships" in model Category

I'm sure that I'm missing something simple, but I don't see it. Can
anyone let me know what I'm missing?

Thanks much
---Michael
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Problem with testing rails applications..

2010-06-20 Thread Joe
When trying "gem install sqlite3-ruby"; it spits out "no definition
for libversion".

And when trying to "rake gems:install" it seems to think that
everything is absolutely fine.

Please note although I dont think it'll make a difference I get this
on starting the application:

C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:
99:Warning: Gem::Dependency#version_requirements is deprecated and
will be removed on or after August 2010.  Use #requirement


Please Help,

Thanks In Advance,

-Joe

On Jun 20, 6:10 pm, Conrad Taylor  wrote:
> Sent from my iPhone
>
> On Jun 20, 2010, at 9:42 AM, Joe  wrote:
>
> > Hi,
>
> > Recently I've been trying to add permalinks to my rails system, so
> > because I had my new OS just installed I installed ruby and rails and
> > all of the things I had before..
> > Then I downloaded my application files directly from the web, and
> > attempted to run the server; when I visit it in my browser it comes up
> > with my custom error message, and the console displays this:
>
> > /!\ FAILSAFE /!\  Sun Jun 20 17:39:08 +0100 2010
> >  Status: 500 Internal Server Error
> >  no such file to load -- sqlite3
>
>  From the message above, you are missing sqlite3.  You might want to
> verify that each gem dependency is installed before you try to run
> your application.
>
> Good luck,
>
> -Conrad
>
> > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `gem_original_require'
> >C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `require'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/dependencies.rb:156:in `require'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/dependencies.rb:521:in `new_constants_in'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/dependencies.rb:156:in `require'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/core_ext/kernel/requires.rb:7:in
> > `require_library_or_gem'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/core_ext/kernel/requires.rb:5:in
> > `require_library_or_gem'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/sqlite3_adapter.rb:10:in
> > `sqlite3_connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:223:in
> > `send'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:223:in
> > `new_connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:245:in
> > `checkout_new_connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:188:in
> > `checkout'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:184:in
> > `loop'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:184:in
> > `checkout'
> >C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:183:in
> > `checkout'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:98:in
> > `connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:326:in
> > `retrieve_connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/
> > connection_specification.rb:
> > 123:in `retrieve_connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/
> > connection_specification.rb:
> > 115:in `connection'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/query_cache.rb:9:in `cache'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/query_cache.rb:28:in `call'
> >C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:361:in
> > `call'
> >C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
> > action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
> >C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
> > action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
> >C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
> > action_controller/params_parser.rb:15:in `call'
> >C:/Ruby/lib/ruby/gems

[Rails] Re: Problem with testing rails applications..

2010-06-20 Thread Joe
When trying "gem install sqlite3-ruby"; it spits out "no definition
for libversion".

And when trying to "rake gems:install" it seems to think that
everything is absolutely fine.

Please note although I dont think it'll make a difference I get this
on starting the application:

C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:
99:Warning: Gem::Dependency#version_requirements is deprecated and
will be removed on or after August 2010.  Use #requirement


Please Help,

Thanks In Advance,

-Joe

On Jun 20, 6:10 pm, Conrad Taylor  wrote:
> Sent from my iPhone
>
> On Jun 20, 2010, at 9:42 AM, Joe  wrote:
>
> > Hi,
>
> > Recently I've been trying to add permalinks to my rails system, so
> > because I had my new OS just installed I installed ruby and rails and
> > all of the things I had before..
> > Then I downloaded my application files directly from the web, and
> > attempted to run the server; when I visit it in my browser it comes up
> > with my custom error message, and the console displays this:
>
> > /!\ FAILSAFE /!\  Sun Jun 20 17:39:08 +0100 2010
> >  Status: 500 Internal Server Error
> >  no such file to load -- sqlite3
>
>  From the message above, you are missing sqlite3.  You might want to  
> verify that each gem dependency is installed before you try to run  
> your application.
>
> Good luck,
>
> -Conrad
>
> > C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `gem_original_require'
> >    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> > `require'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/dependencies.rb:156:in `require'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/dependencies.rb:521:in `new_constants_in'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/dependencies.rb:156:in `require'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/core_ext/kernel/requires.rb:7:in
> > `require_library_or_gem'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> > active_support/core_ext/kernel/requires.rb:5:in
> > `require_library_or_gem'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/sqlite3_adapter.rb:10:in
> > `sqlite3_connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:223:in
> > `send'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:223:in
> > `new_connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:245:in
> > `checkout_new_connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:188:in
> > `checkout'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:184:in
> > `loop'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:184:in
> > `checkout'
> >    C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:183:in
> > `checkout'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:98:in
> > `connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:326:in
> > `retrieve_connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/
> > connection_specification.rb:
> > 123:in `retrieve_connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/
> > connection_specification.rb:
> > 115:in `connection'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/query_cache.rb:9:in `cache'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/query_cache.rb:28:in `call'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
> > active_record/connection_adapters/abstract/connection_pool.rb:361:in
> > `call'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
> > action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
> > action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
> >    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
> > action_controller/params_parser.rb:15:in `call'
> >    C:/Ruby/lib/ruby/

[Rails] Re: Google Charts question.

2010-06-20 Thread UA
Ok... i was doing it in Rails.. though. thanks.

On Jun 20, 1:00 pm, Marnen Laibow-Koser  wrote:
> Ritvvij Parrikh wrote:
> > Hello
>
> > I am trying out Google Charts for the first time.
> > There is a rectangular container to the Chart and then the Chart
> > itself inside.
> > There is a lot of space wasted in some kind of padding within the
> > actual chart and the container.
>
> > I tried playing around with width and height parameters still does not
> > help.
> > Can you someone advise please?
>
> Please ask this question in Google's forums, where it will be on topic.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> 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: Google Charts question.

2010-06-20 Thread Marnen Laibow-Koser
Ritvvij Parrikh wrote:
> Hello
> 
> I am trying out Google Charts for the first time.
> There is a rectangular container to the Chart and then the Chart
> itself inside.
> There is a lot of space wasted in some kind of padding within the
> actual chart and the container.
> 
> I tried playing around with width and height parameters still does not
> help.
> Can you someone advise please?

Please ask this question in Google's forums, where it will be on topic.

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] Google Charts question.

2010-06-20 Thread UA
Hello

I am trying out Google Charts for the first time.
There is a rectangular container to the Chart and then the Chart
itself inside.
There is a lot of space wasted in some kind of padding within the
actual chart and the container.

I tried playing around with width and height parameters still does not
help.
Can you someone advise please?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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 MacPorts To Install Ruby 1.9.1 and Rails 2.3.0 RC1

2010-06-20 Thread Conrad Taylor



Sent from my iPhone

On Jun 20, 2010, at 4:50 AM, Fernando Perez   
wrote:




I installed ruby 1.9.1 with the 1.9 suffix, and I think ./script/ 
server
is confused and is trying to run the old ruby stuff that ships with  
OSX.

Does it mean I have to reinstall everything from scratch with the
+nosuffix flag?

Thanks


I confirm I needed to reinstall ruby with +nosuffix. Now it all works,
well except ruby-debug which won't compile :-(


If you're using Rails 3, it is recommended that you use Ruby 1.9.2.   
If this is the case, then you might want to use RVM for installing  
Ruby by doing the following:


rvm install 1.9.2- head

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] Problem with testing rails applications..

2010-06-20 Thread Conrad Taylor



Sent from my iPhone

On Jun 20, 2010, at 9:42 AM, Joe  wrote:


Hi,

Recently I've been trying to add permalinks to my rails system, so
because I had my new OS just installed I installed ruby and rails and
all of the things I had before..
Then I downloaded my application files directly from the web, and
attempted to run the server; when I visit it in my browser it comes up
with my custom error message, and the console displays this:

/!\ FAILSAFE /!\  Sun Jun 20 17:39:08 +0100 2010
 Status: 500 Internal Server Error
 no such file to load -- sqlite3



From the message above, you are missing sqlite3.  You might want to  
verify that each gem dependency is installed before you try to run  
your application.


Good luck,

-Conrad


C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
   C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
   C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:156:in `require'
   C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:521:in `new_constants_in'
   C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:156:in `require'
   C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
   C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
   C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/sqlite3_adapter.rb:10:in
`sqlite3_connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
   C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/ 
connection_specification.rb:

123:in `retrieve_connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/ 
connection_specification.rb:

115:in `connection'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/query_cache.rb:9:in `cache'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/query_cache.rb:28:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:361:in
`call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/params_parser.rb:15:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/rewindable_input.rb:25:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/session/cookie_store.rb:93:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/reloader.rb:9:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/failsafe.rb:11:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/dispatcher.rb:106:in `call'
   C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.

[Rails] [help & ask] WYSIWYG for rails3 beta 4

2010-06-20 Thread anton effendi
Hiii GUys..

any body help me?? could u all tell me WYSIWYG  for rails3 beta 4??



Thank you.
-- 

Senior Rails Developer
Anton Effendi - Wu You Duan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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 testing rails applications..

2010-06-20 Thread Joe
Hi,

Recently I've been trying to add permalinks to my rails system, so
because I had my new OS just installed I installed ruby and rails and
all of the things I had before..
Then I downloaded my application files directly from the web, and
attempted to run the server; when I visit it in my browser it comes up
with my custom error message, and the console displays this:

/!\ FAILSAFE /!\  Sun Jun 20 17:39:08 +0100 2010
  Status: 500 Internal Server Error
  no such file to load -- sqlite3
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:156:in `require'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:521:in `new_constants_in'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/dependencies.rb:156:in `require'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/sqlite3_adapter.rb:10:in
`sqlite3_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
123:in `retrieve_connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
115:in `connection'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/query_cache.rb:9:in `cache'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/query_cache.rb:28:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/
active_record/connection_adapters/abstract/connection_pool.rb:361:in
`call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/head.rb:9:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/params_parser.rb:15:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/rewindable_input.rb:25:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/session/cookie_store.rb:93:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/reloader.rb:9:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/failsafe.rb:11:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:11:in `synchronize'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/dispatcher.rb:106:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/
static.rb:31:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/urlmap.rb:46:in `call'
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/

[Rails] Re: gitignore

2010-06-20 Thread Marnen Laibow-Koser
giorgio wrote:
> I have just started using rad rails again after a long stint on
> netbeans.

Why?  That's going from bad to worse.

NetBeans: excellent IDE, too heavy for Rails
Aptana: less good IDE, *still* too heavy for Rails

Just forget about IDEs and use a good editor such as KomodoEdit.  Rails 
doesn't benefit from the use of an IDE.

> 
> It seems to generate loads of files like:
> app/views/group/.tmp_group_summary.rhtml.99932
> 
> I want to make git ignore all these .tmp files but my entries in
> gitignore have so far been of no avail.
> 
> Anybody give me a suggestion?

You'll probably get better answers in a Git forum.  This is not a Rails 
question.

> 
> Cheers
> George

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: Make just one restful action singular

2010-06-20 Thread Marnen Laibow-Koser
Utsav Gupta wrote:
> Can we make just one restful action singular?
> 
> Here's my situation.
> 
> I have a user model. Hence:
> [code]
> ActionController::Routing::Routes.draw do |map|
>   ...
>   map.resources :users
>   ...
> end
> [/code]
> 
> But now the problem is whenever a user wants to edit his profile the
> corresponding path for this job will be /users/:id/edit . Now it's
> needless to say that using this mechanism is not at all secure since the
> :id can be changed by the user in the url. That would save those changes
> in some other user's record. 

You mean you don't have a permissions system in place?

> However that is not the issue here since
> that has been taken care of in:
> 
> [code]
> def edit
>  @user = current_user
> end
> [/code]
> 
> So now generating /users/:id/edit is futile. How can I generate
> /users/edit ??? However I want to keep it restful.
> 

/users/edit would seem like it's supposed to edit *all* users.  You 
probably want something like /user/edit .

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

> 
> Regards,
> 
> Utsav

-- 
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] Make just one restful action singular

2010-06-20 Thread Utsav Gupta
Can we make just one restful action singular?

Here's my situation.

I have a user model. Hence:
[code]
ActionController::Routing::Routes.draw do |map|
  ...
  map.resources :users
  ...
end
[/code]

But now the problem is whenever a user wants to edit his profile the
corresponding path for this job will be /users/:id/edit . Now it's
needless to say that using this mechanism is not at all secure since the
:id can be changed by the user in the url. That would save those changes
in some other user's record. However that is not the issue here since
that has been taken care of in:

[code]
def edit
 @user = current_user
end
[/code]

So now generating /users/:id/edit is futile. How can I generate
/users/edit ??? However I want to keep it restful.


Regards,

Utsav
-- 
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] ActionPack framework

2010-06-20 Thread Abder-rahman Ali
What is the "ActionPack" framework?

And, a thing that really confuses me a bit is: What do we mean by an
application framework?

And, is Rails considered a web application framework?

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] Debugging a Rails 3 app with RadRails 2?

2010-06-20 Thread Michael Schuerig

When trying to debug a Rails 3 app with RadRails 2.0.4, I'm running into 
a problem with gem loading, apparently. See below for a stack trace. 
That problem disappears, when I move Gemfile out of the way, but, of 
course, then other necessary gems aren't loaded.

>From my Debug Configuration 

Project: 
File: script/rails
Working Directory: /home/michael/aptana/
Interpreter Arguments: -e STDOUT.sync=true -e STDERR.sync=true -e 
load(ARGV.shift)
Programm Arguments: server --debugger --environment=development --
port=3000
Interpreter: standard /usr/bin/ruby

I've tried adding/removing ruby-debug and ruby-debug-ide to the Gemfile 
in any order and at the top-level as well as in the :development group.

I think, but are far from sure, that RadRails and Bundler are of devided 
minds as to which gems are active when. First, RadRails directly runs 
rdebug-ide, which runs script/rails which causes bundler to mangle which 
gems are active. In the file, where the error occurs, there's a

require 'ruby-debug/processor'

and that succeeds. But possibly it loads the wrong file, i.e. not the 
one from ruby-debug, but the one from ruby-debug-ide. The later does 
indeed not define Debugger::CommandProcessor. (I'm using Ruby 1.8.7 and 
this might matter here.)

I've tried my luck with the latest beta of Aptana Studio 3 as well, but 
that wasn't a pleasant experience, either.

I'm hoping someone has an idea how to get around this problem. I'm also 
taking suggestions for other Linux-based(!) IDEs with suitable debugging 
abilities :-(

Michael


Fast Debugger (ruby-debug-ide 0.4.9) listens on :2984
/var/lib/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug.rb:9
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:46:in 
`require'
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:46:in 
`require'
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:41:in 
`each'
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:41:in 
`require'
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:40:in 
`each'
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:40:in 
`require'
/var/lib/gems/1.8/gems/bundler-0.9.26/lib/bundler.rb:89:in `require'
/home/michael/workspace/ue_guidelines/config/application.rb:7

/var/lib/gems/1.8/gems/railties-3.0.0.beta4/lib/rails/commands.rb:28:in 
`require'
/var/lib/gems/1.8/gems/railties-3.0.0.beta4/lib/rails/commands.rb:28

/var/lib/gems/1.8/gems/railties-3.0.0.beta4/lib/rails/commands.rb:27:in 
`tap'
/var/lib/gems/1.8/gems/railties-3.0.0.beta4/lib/rails/commands.rb:27
./script/rails:6:in `require'
./script/rails:6
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-
ide.rb:109:in `debug_load'
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-
ide.rb:109:in `debug_program'
/var/lib/gems/1.8/gems/ruby-debug-ide-0.4.9/bin/rdebug-ide:87
/var/lib/gems/1.8/bin/rdebug-ide:19:in `load'
/var/lib/gems/1.8/bin/rdebug-ide:19
-e:3:in `load'
-e:3
Uncaught exception: uninitialized constant Debugger::CommandProcessor

-- 
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/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] Re: Using MacPorts To Install Ruby 1.9.1 and Rails 2.3.0 RC1

2010-06-20 Thread Fernando Perez

> I installed ruby 1.9.1 with the 1.9 suffix, and I think ./script/server 
> is confused and is trying to run the old ruby stuff that ships with OSX. 
> Does it mean I have to reinstall everything from scratch with the 
> +nosuffix flag?
> 
> Thanks

I confirm I needed to reinstall ruby with +nosuffix. Now it all works, 
well except ruby-debug which won't compile :-(
-- 
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: 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-20 Thread Anthony Green
More digging and the answer is to install monrel pre-release

gem install mongrel --pre



Anthony Green wrote:
> Anthony Green wrote:
>> I'm having the same issue and installed gems without user sudo.
>> 
>> Fernando Brito wrote:
>>> Looking at your error
>>> "gcc -I.
>>> -I/Users/yves/.rvm/rubies/ruby-1.9.2-preview3/include/ruby-1.9.1/x86_64-darwin10.4.0"
>>> 
>>> Do you see that there are 2 ruby versions there?
>>> RVM suggests you to always install gems without "sudo" (or if you 
>>> installed
>>> your first one with sudo, keep doing that forever).
> 
> After doing some further testing with RVM installs of 1.8.7 will let you 
> install mongrel, whereas installs 1.9.1 and 1.9.2 won't.

-- 
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: 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-20 Thread Anthony Green
Anthony Green wrote:
> I'm having the same issue and installed gems without user sudo.
> 
> Fernando Brito wrote:
>> Looking at your error
>> "gcc -I.
>> -I/Users/yves/.rvm/rubies/ruby-1.9.2-preview3/include/ruby-1.9.1/x86_64-darwin10.4.0"
>> 
>> Do you see that there are 2 ruby versions there?
>> RVM suggests you to always install gems without "sudo" (or if you 
>> installed
>> your first one with sudo, keep doing that forever).

After doing some further testing with RVM installs of 1.8.7 will let you 
install mongrel, whereas installs 1.9.1 and 1.9.2 won't.
-- 
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: 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-20 Thread Anthony Green
I'm having the same issue and installed gems without user sudo.

Fernando Brito wrote:
> Looking at your error
> "gcc -I.
> -I/Users/yves/.rvm/rubies/ruby-1.9.2-preview3/include/ruby-1.9.1/x86_64-darwin10.4.0"
> 
> Do you see that there are 2 ruby versions there?
> RVM suggests you to always install gems without "sudo" (or if you 
> installed
> your first one with sudo, keep doing that forever).
-- 
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] act as commentable

2010-06-20 Thread samprose
hi,
anyone help for act as commentable

with option for replying a comment or nested set of pluins.

plz help imm.

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