[Rails] Re: Rails3 Jquery link_to

2010-06-29 Thread tspore
Ok I think I figured out a simple version -
$('#content').load('/clients #index');
Right now I have it in my index.js.erb
but I need to now figure out how to load it into my controller, so I
can reduce files.

On Jun 28, 6:11 pm, tspore tsp...@gmail.com wrote:
 Ok I think I'm 1/2 their - I got something to load on the rjs
 template-
  $(#content).html(fish);
 Which renders html inside the content tag...
 But it just will render a plain tag for fish - not html code e.g. h1
 fish/h1

 But I think ideally it would render the same index.html.erb file so I
 wouldn't have to maintain code in 2 places. Any suggestions how to do
 that?

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

2010-06-29 Thread Carsten Gehling
I have a site with a lot of view code like this:

p
  %...@post.user.name%
/p

Unfortunately a lot of old posts have had their users deleted, so the
code above breaks the entire view. I am working on a larger cleanup on
the code, but in the meantime I would like to make a quickfix to get the
views working.

What I would like is to convert

%...@post.user.name%

to

%=(@post.user.name) rescue ''%

Is there any way to override %= to do the above? Thus fixing all errors
on the spot.

Thanks

- Carsten
-- 
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] list using a sql statement

2010-06-29 Thread Colin Law
On 29 June 2010 02:56, RailsFan Radha li...@ruby-forum.com wrote:

 I have a table called category and i want to show only the records where
 status = A in my list.erb

 currently, my list.erb shows all records from category table.
 but, i would like to show only the records where status = 'A'

 for example:
 select * frm category where status = 'A'

 the idea behind this is, i have this status column to show only the
 active records.
 This status flag accepts,
 A for active,
 I for inative and
 R for Requested newly, but not yet processed.
 .. and may be others as per the futurre needs.

 so how can i apply this filter of where status = 'A' in my controller.

  def list
     �...@categories=category.find_all_categories
        end


I think it would be worth your while working through some tutorials
and guides.  Have a look at the guides at
http://guides.rubyonrails.org/ for a start.  Agile Development with
Rails is an excellent book.  The tutorial at
http://www.railstutorial.org/ is good.  Make sure that any tutorial
you try is for rails 2.3.

For your particular problem I would suggest using named_scope.

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] Authlogic and persistence token

2010-06-29 Thread Lesanglier Lesanglier
Hello,

I would to know if if does it possible to have something like this :

  acts_as_authentic do |c|
c.login_field = :user_name
c.crypted_password_field = :user_passwd
c.persistence_token = :pertok
  end

Using the pertok field instead of the persistence_token field ?
Or say to Ror to use the user_passwd as persistence_token field.

How to generate a persistence token ?

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



Re: [Rails] Re: list using a sql statement

2010-06-29 Thread Colin Law
On 29 June 2010 03:19, RailsFan Radha li...@ruby-forum.com wrote:
 RailsFan Radha wrote:

 I have a table called category and i want to show only the records where
 status = A in my list.erb

 currently, my list.erb shows all records from category table.
 but, i would like to show only the records where status = 'A'

 for example:
 select * frm category where status = 'A'

 the idea behind this is, i have this status column to show only the
 active records.
 This status flag accepts,
 A for active,
 I for inative and
 R for Requested newly, but not yet processed.
 .. and may be others as per the futurre needs.

 so how can i apply this filter of where status = 'A' in my controller.

   def list
       @categories=Category.find_all_categories
         end



 - thanks,
 radha


 Added another method to the model,

  def self.find_active_categories
      find_by_sql(SELECT * from category
           where status = 'A')
      order by category_id )
  end

Don't use find_by_sql unless absolutely necessary.  The above can be
done by using the :conditions and :order options in find.  Also as I
suggested previously, I would use a named scope (with default_scope
for the order if you will always sort by the same thing).


 And changed the controller, list action to call this new method.

   def list
       @categories=Category.find_active_categories
   end

 And this seems to be working.
 Let me know if i have missed any or please add any additional info which
 this implies too.

Do you always want to just show active categories on the index?  If so
then that concept is ok (subject to comments above).

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] show action - restrict manual url change from user to view

2010-06-29 Thread Colin Law
On 29 June 2010 03:36, RailsFan Radha li...@ruby-forum.com wrote:

 This is show action in my category controller.

   # Show ---
  def show
    # @category=Category.find(params[:category_id])
     @category=Category.find(params[:category_id])
  end

 show action - restrict manual url change from user to view the
 inactive records. 
 Active/inactive are set via status column in category table.
 where status='A'

 since the url shows up in the url bar, the user can simply type in a
 different category_id and view the record, even if status = 'I'
 but, i don't want the user to modify the url and view the category where
 status  'A'
 In short, the users get to view only status='A'

 How do i do this for show action? (since this accepts a param)
 I made the change for list action and list is working fine and shows
 only where status='A'. List doesn't accept any params such as
 category_id so it was ok.

 but this show accepts a param which is category_id.

 let me know how i could get the result of showing only actives and none
 other statuses, directly from the url or via show action.

Add a condition to the find call so that it only finds active
categories.  If the id does not match a valid category then it will
return nil.

Colin


 thanks,
 radha.

 (i have tried by best to communicate.. but let me know if any is not
 clear. i will re-iterate)

 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.



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

2010-06-29 Thread Michael Pavling
On 29 June 2010 08:40, Carsten Gehling li...@ruby-forum.com wrote:
 What I would like is to convert
 %...@post.user.name%
 to
 %=(@post.user.name) rescue ''%

No it's not. You shouldn't use exceptions to handle non-exceptional
behaviour - and if you know that some posts have had their user
deleted, then it's not exceptional
Besides, this all needs to be done in the model or controller, as the
view should be blissfully ignorant about any data integrity problems
you might have.

 Is there any way to override %= to do the above? Thus fixing all errors
 on the spot.

I use a method of substituting a mock object (I'd call it MissingUser
in this instance) which has accessors for each of the properties that
I need from the real AR object that's missing. I then instanciate one
of the mock objects if I request a child object that's missing, by
overloading the call to the associated object, and adding a check that
it exists.

  # missing_user.rb
  # just a normal Ruby model, but not AR-backed
  class MissingUser
attr_accessor :name, :dob # ...etc (any fields you know you need)

# as well as accessors you can set default values for parameters,
so every new instance gets populated with some values
def name
  @name || Missing User
end
  end

  # post.rb
  class Post  ActiveRecord::Base

has_one :user

alias_method :ar_user, :user # alias the ActiveRecord call
def user
  @user || = (ar_user || MissingUser.new)  # memoized to save
creating a new MissingUser for every call to the method
  # you could also pass in default values as parameters for the
new if you wanted - just overload MissingUser's initialize method
end
  end


Does that make sense?

I apologise for any typos or mistakes in the code above, as I've just
written it in the email and haven't run it to test. But I hope you can
get the gist from what's there.

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

2010-06-29 Thread Colin Law
On 29 June 2010 08:40, Carsten Gehling li...@ruby-forum.com wrote:
 I have a site with a lot of view code like this:

 p
  %...@post.user.name%
 /p

 Unfortunately a lot of old posts have had their users deleted, so the
 code above breaks the entire view. I am working on a larger cleanup on
 the code, but in the meantime I would like to make a quickfix to get the
 views working.

 What I would like is to convert

 %...@post.user.name%

%= @post.user.name if @post.user %

Colin


 to

 %=(@post.user.name) rescue ''%

 Is there any way to override %= to do the above? Thus fixing all errors
 on the spot.

 Thanks

 - Carsten
 --
 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: Add a filter on the ERB %= ... %

2010-06-29 Thread Carsten Gehling
Michael Pavling wrote:

 Does that make sense?

It does make sense, and this is a process that I am currently working 
through. My example was just a single extract from the application, 
though, and there are many of these scattered all over the code.

So what I really wants is a quick-fix that makes the presentation-code 
work until I've fixed the errors the Right Way(tm).

For now I've resorted to

class NilClass
  def method_missing(method_name, *args)
''
  end
end

That works - if not pretty, then at least it holds my view code together 
while I fix it.

- Carsten
-- 
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: Add a filter on the ERB %= ... %

2010-06-29 Thread Michael Pavling
On 29 June 2010 10:24, Carsten Gehling li...@ruby-forum.com wrote:
 class NilClass
  def method_missing(method_name, *args)
    ''
  end
 end

Overloading method_missing is probable to cause more problems than it fixes :-)

 That works - if not pretty, then at least it holds my view code together
 while I fix it.

You only need to fix the missing associations one at a time; get a
MissingUser in there and all the nil users will disappear. Then if you
discover another nil association, create the MissingModel for that.

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

2010-06-29 Thread pepe
Check out some of the railscasts episodes (http://railscasts.com).
Search for 'multiple' and you might find something of interest to you.

On Jun 28, 2:23 pm, richardsugg richards...@gmail.com wrote:
 I have a table that contains user options, so the table looks like
 id
 username
 option_name
 option_value

 How do I create a single page that allows me to edit all the options?
 Would it be something like

 % form_for :options, :url = { :action = update_options } do |
 form| %
 tr
   td%= form.label :option_name %/td
   td%= form.text_field :option_value %/td
 /tr
 % end %
 %= submit_tag save, :class = save %

 If so, how do I send both the id and username?

 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: Re: Add a filter on the ERB %= ... %

2010-06-29 Thread Carsten Gehling
Michael Pavling wrote:
 
 Overloading method_missing is probable to cause more problems than it 
 fixes :-)

I know - it is a very VERY temporary solution to get peace to do real 
fixing. :-)

 You only need to fix the missing associations one at a time; get a
 MissingUser in there and all the nil users will disappear. Then if you
 discover another nil association, create the MissingModel for that.

Yup it is a very neat solution, that I will adapt to. Thanks

- Carsten
-- 
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] Jobs - VP Engineering role and ROR developers NEEDED

2010-06-29 Thread Kelly Faber
San Francisco Bay Area, CA – VP Engineering Position.   Rapidly
growing social media company whose award-winning technology, is used
by thousands of companies including top brands like Pepsi, Facebook,
ATT, Unilever, CNN,  Ogilvy. Headquartered in Palo Alto, California,
they are a privately-held technology company specialized in developing
simple tools that enable organizations to engage the hundreds of
millions of users of social network sites such as Facebook and
Twitter.
•   Experience with Domain Drive Design (DDD) is desired
•   Ability to make technical deep-dives into code while balancing
business-objective discussions with the business team
•   Someone who has played with multi-tenant architectures, NoSQL, GWT,
and Open Source well before they became known
•   Familiarity with Ruby on Rails is a plus
VERY generous Salary + options.
Please contact me – kfa...@culvercareers.com  916-932-2360

San Francisco Bay Area – Looking for Senior Ruby on Rails Developers.
Profitable Start up!  Generous Base Salary + Options.  Willing to look
at candidates that will relocate to the Bay Area within the first
year.  Experience with social Networking is a huge plus!  Please
contact me at kfa...@culvercareers.com.  916-932-2360.

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



[Rails] rake db:create failing

2010-06-29 Thread Joe
Hi everyone,

First of all, I'm running Mac OS X Snow Leopard.

Trying to set up a new SQLite database, but when I run rake db:create,
I get the following huge message:


unable to open database file
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
sqlite3_adapter.rb:13:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
sqlite3_adapter.rb:13:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
sqlite3_adapter.rb:13:in `sqlite3_connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:223:in `send'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:223:in `new_connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:245:in `checkout_new_connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:188:in `checkout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:184:in `loop'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:184:in `checkout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/monitor.rb:242:in `synchronize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:183:in `checkout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:98:in `connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_pool.rb:326:in `retrieve_connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_specification.rb:123:in `retrieve_connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
abstract/connection_specification.rb:115:in `connection'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:43:in
`create_database'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:31
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/monitor.rb:242:in `synchronize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'

[Rails] How to submit a drop down menu using forms

2010-06-29 Thread atin
Hi
I am learning rails  I am developing a blog site using it so i want
to make a drop down menu which would have the title of the blog  on
selecting that title i should be redirected to the show page of blog
contents
I have 2 models
Blog:
title
has_many articles

Artcile:
name
author
date
body
belongs_to blog

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

2010-06-29 Thread Michael Pavling
On 29 June 2010 10:37, Carsten Gehling li...@ruby-forum.com wrote:
 Yup it is a very neat solution, that I will adapt to. Thanks

No worries. I got it from the Refactoring: Ruby Edition book - they
call it the introduce null object pattern.
Well worth being familiar with the book for loads of other very good
little patterns.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] 3 Month (initially) Contract Ruby Developer role - Full time office based - London - Market Rates

2010-06-29 Thread Richard Marshall
Hi All

Looking for a solid Ruby developer who is looking for contract work
in
London. working for a fantastic online client. Please contact me for
this great position.


• Ruby on Rails 2.3+ web application development
• Familiar with HTML/CSS
• Object Orientated programming skills
• Knowledge of Design Patterns
• Ability to translate visual mock-ups and storyboards to a
useable
product
• A passion for usability issues  requirements
• Experience with using source code control particularly SVN and
GIT
• Use of unit testing in Ruby on Rails


Desirable
• A Computer Science, Maths or Science degree equivalent
• Familiar with Ruby on Rails 3.0+ beta
• Relevant gaming experience
• Use of Eclipse IDE
• Knowledge of Java
• Experience with web service integration


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

2010-06-29 Thread Neil Bye
I have this bit of code in my email.controller

user = @current_user
story = @current_story
recipient = story.user

It doesn't work because @current_story isn't defined. How can I find the
current page to make this work?
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] problem finding find current page

2010-06-29 Thread Andy Jeffries
On 29 June 2010 11:00, Neil Bye li...@ruby-forum.com wrote:

 I have this bit of code in my email.controller

 user = @current_user
 story = @current_story
 recipient = story.user

 It doesn't work because @current_story isn't defined. How can I find the
 current page to make this work?


You haven't given anywhere enough detail for us to help you.

@current_story - what are you expecting this variable to contain?  Saying
the current page won't help.  Do you mean the current URL
(@request.request_uri)?  The current Page object (in which case you must
have found the Page object using some code, assign that to @current_story.
 A variable from the session?  @current_story = session[:current_story].

We need a lot more information to be able to help.  @current_story is an
instance variable, but there's no information on what you're expecting it to
magically contain.

Cheers,


Andy

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

2010-06-29 Thread Peter Hickman
I know this will sound a little silly but do you have a db directory just
below the application root? Rails should have created it.

Do you have permission to access that directory?
Do you have permission to create files in that directory?

Maybe the application directory was created by a different user to the user
who is running the db:create

Does the file db/development.sqlite3 already exist?
What permissions does it have?

If it does not already exist what happens when you do this from the
application root

$ touch db/development.sqlite3

It should just create the file for 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: How to submit a drop down menu using forms

2010-06-29 Thread Bohdan Pohoriletz
atin wrote:
 Hi
 I am learning rails  I am developing a blog site using it so i want
 to make a drop down menu which would have the title of the blog  on
 selecting 

you need javascript to handle event onselect

that title i should be redirected to the show page of blog
 contents
 I have 2 models
 Blog:
 title
 has_many articles
 
 Artcile:
 name
 author
 date
 body
 belongs_to blog

If you want to do it using forms you must show some button to submit 
form data
-- 
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 finding find current page

2010-06-29 Thread Neil Bye
Andy Jeffries wrote:
 On 29 June 2010 11:00, Neil Bye li...@ruby-forum.com wrote:
 
 I have this bit of code in my email.controller

 user = @current_user
 story = @current_story
 recipient = story.user

 It doesn't work because @current_story isn't defined. How can I find the
 current page to make this work?
 
 
 You haven't given anywhere enough detail for us to help you.
 
 @current_story - what are you expecting this variable to contain? 
 Saying
 the current page won't help.  Do you mean the current URL
 (@request.request_uri)?  The current Page object (in which case you must
 have found the Page object using some code, assign that to 
 @current_story.
  A variable from the session?  @current_story = session[:current_story].
 
 We need a lot more information to be able to help.  @current_story is an
 instance variable, but there's no information on what you're expecting 
 it to
 magically contain.
 
 Cheers,
 
 
 Andy

The email is to be sent from a page containing a story and comments. I 
want it to go to @story.user's email. If I use story= 
Story.find_by_id(2) it works but I want an expression to find the 
current story not one specified.
Does that tell you enough? Do you want more files sent?

Attachments:
http://www.ruby-forum.com/attachment/4823/email_controller.rb

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

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



Re: [Rails] rake db:create failing

2010-06-29 Thread Colin Law
On 28 June 2010 20:49, Joe x.lt0...@gmail.com wrote:
 Hi everyone,

 First of all, I'm running Mac OS X Snow Leopard.

 Trying to set up a new SQLite database, but when I run rake db:create,
 I get the following huge message:


 unable to open database file
...
 Couldn't create database for {timeout=5000, adapter=sqlite3,
 database=db/development.sqlite3, pool=5}

Just a guess, could it be a permissions issue?  Do you have write
permission in that folder?

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] Is there any way to have observe_field react to the current value of a field also?

2010-06-29 Thread Bill Walton
HI Bob,

On Mon, Jun 28, 2010 at 3:16 PM, Bob Smith bsm...@gmail.com wrote:
 The problem is
 that this is the page is to edit an existing record also, so
 observe_field needs to see that the zip code currently doesn't match,
 so the church list needs to be shown. Currently, even if the zip
 doesn't match, the list will only be shown after the field is changed,

For the initial page load you just need to test and render if
appropriate on the initial page load.

div id=church
  % if @household.zip != x and @household.zip != y %
  %= render :partial = church_select %
  % end %
/div

You need to change the render :nothing in your controller to render an
empty string or partial to empty the content of the church div when
appropriate.

HTH,
Bill

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

2010-06-29 Thread Tushar Gandhi
Hi,
I am doing an integration with commission junction using SOAP to get the
result. It is working fine for me. My problem is I have to add the
pagination so I have used will_paginate for pagination. For each page I
am doing a call to commission junction and getting the result which make
a performance bottleneck for my application. To solve this I have
decided to store the response in session and when the request for
another page comes I will show the result from session instead of
calling CJ.

Problem is whenever I am trying to dump the response in session I
getting an error
singleton can't be dumped in rails session.

It seems that SOAP object is instance of singleton class and due to that
it is not allowing to dump it.

Is there any other way to solve this?


Thanks,
Tushar
-- 
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] Possible to recover data from log/development.log files?

2010-06-29 Thread Andrew Vliet
Hey all.  Seems I've found a bug in Rails db:migrate - maybe it is,
maybe it isn't.  If possible - I'd appreciate some help recovering from
it. 

Apps, OS, etc.: 
MySQL:Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using
readline 5.1
Rails:2.3.8,
OS:CentOS 5.4 updated as of this past weekend

Long story made short.  I have a rails app in development mode with a
significant amount of data.  I created a couple migrations to add a
couple columns and remove a couple more.  After my first attempt to run
the migrations, I realized I'd made a mistake and attempted to revert my
changes with a 'rake db:migrate VERSION=name of migration'. 

Mistake #1:  Oops.  I typed the name of my migration incorrectly, and it
reverted to...  wait for it...  VERSION=0.  That's the bug part - (I
don't think) it shouldn't be reverting to VERSION=0 whenever it has an
error or fails to find a migration...  No, I didn't have an environment
variable VERSION=0. 

Mistake #2:  My bad - I didn't back up the database before applying my
changes.  05:30 AM + meh - simple column change, what could happen...
=~ poop.onstick()

log/development.log seems like it contains all the INSERT INTO actions. 
(crosses fingers)  Has anyone ever used the log file to recreate the
database..?  Am I missing something: is there a better way?

Any help, input, or ideas beyond you should have backed up your DB
would really be appreciated.

Thanks,

Andrew Vliet
1 403 667 3201 (c)
1 403 648 0627 (w)

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

attachment: avliet.vcf

[Rails] Re: Add a filter on the ERB %= ... %

2010-06-29 Thread daphonz
There is a much easier solution to all of this.  Utilize the try()
method that comes with ActiveSupport:

p
%= @post.try(:user).try(:name) %
/p

try() calls a method and catches exceptions, returning nil instead.
Try is added to the main Object class, so even nil objects have the
method, hence your ability to chain them together


-casey

On Jun 29, 5:50 am, Michael Pavling pavl...@gmail.com wrote:
 On 29 June 2010 10:37, Carsten Gehling li...@ruby-forum.com wrote:

  Yup it is a very neat solution, that I will adapt to. Thanks

 No worries. I got it from the Refactoring: Ruby Edition book - they
 call it the introduce null object pattern.
 Well worth being familiar with the book for loads of other very good
 little patterns.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: Possible to recover data from log/development.log files?

2010-06-29 Thread Ar Chron
If you haven't cleared out your log along the way, you should be able to 
parse through that and reconstruct your inserts.

I know I periodically 'archive off' my development.log 
(development.log.thru.20100617 anyone?) just so I have a record 
(especially when trying to diagnose issues).

-- 
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] belongs_to. Association methods don't pass data to DB

2010-06-29 Thread P.A.
Hi.

I have a problem with the association methods which passed to a model
through a belongs_to declaration. Here's an illustration of the issue:

GIVEN:

# migration
class CreateArticlesAndAuthorsTables  ActiveRecord::Migration
  def self.up
create_table :articles do |t|
  t.text :title
  t.integer :author_id
end

create_table :authors do |t|
  t.text :name
end
  end

  def self.down
drop_table :articles
drop_table :authors
  end
end

# articles model
class Article  ActiveRecord::Base
  belongs_to :author
end

# authors model
class Author  ActiverRecord::Base
  has_many :articles
end

WHEN:

 Article.create(:title = 'one').author = Author.create(:name = 'Pavel')

 Article.create(:title = 'two').author = Author.find(:first, :conditions = 
 {:name = 'Pavel'})

THEN

sqlite select * from authors;
 id = 1
name = Pavel

sqlite select * from articles;
   id = 1
title = 'one'
author_id = null

   id = 2
title = 'two'
author_id = null

Why do I have null values instead of ids as foreign keys in the
articles table?

Thanks.

Ruby 1.9.2;
Rails 2.3.8.

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

2010-06-29 Thread Aldric Giacomoni
Hi,
We are trying to fix a test suite to check an app which uses PKI
authentication.
Is there something out there which could make our lives easier? Webrat
and Selenium don't seem to support this right now.

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: Spreadsheet creation

2010-06-29 Thread Spec Ex
Spec Ex wrote:
 Hey guys,
 
 I'm trying to create a spreadsheet with Ruby using the spreadsheet gem.
 I'm able to create a new sheet and add data and everything but I'm
 wondering, is there any way to preserve macros and vb projects in an
 existing xls file then add data to it in a new sheet? Currently, I'm
 opening a spreadsheet with macros and vb projects, adding a new sheet to
 it with my created data...but when I open it, the VB projects, macros
 and conditional formatting is all lost.
 
 Any help would be greatly appreciated!
 
 Thanks!

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] Re: PKI authentication? Webrat, Selenium, restful-auth... ?

2010-06-29 Thread Marnen Laibow-Koser
Aldric Giacomoni wrote:
 Hi,
 We are trying to fix a test suite to check an app which uses PKI
 authentication.
 Is there something out there which could make our lives easier? Webrat
 and Selenium don't seem to support this right now. 

AFAIK, Selenium supports anything that the browser supports.  What 
problems are you having?

 
 Thanks.

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] Search plugin/gem recommendation for search with joins

2010-06-29 Thread Max Williams
Hi all.  It's time to choose a search system for a new app i've been
working on and though i'd crowdsource some wisdom.  I've used
ferret/acts_as_ferret before and encountered some problems which make me
reluctant to use it again.  I know people are using sphinx/solr these
days (and other things i'm sure).

My particular requirements are to do with complex joins:  when i do my
search i'm joining lots of tables together and passing various
conditions to do with the join tables, using a search term (which at the
moment is just doing a LIKE match on a keywords field), sorting by one
of the joined fields, and of course paginating the results.  Obviously,
LIKE searches on a text field isn't very scalable (especially in innodb
mysql which doesn't allow full text indexing) and it's this aspect that
i need to replace with a proper indexed search system.

It was the combination of searching, sorting, joining and paginating
that seemed to cause problems for ferret and i wondered if anyone could
recommend a search system that works well with this sort of usage.

Sorry if that's a bit vague, just looking for some accounts of
experiences really.  Grateful for any advice - max
-- 
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: jquery ajax.submit() help

2010-06-29 Thread Piyush Choudhary
Some urgent help required..
Any one..

On Mon, Jun 28, 2010 at 8:24 PM, Piyush Choudhary 
piyush.choudhary...@gmail.com wrote:

 Hi all,

 I need some quick help in jquery.
 While using jquery ajax.Submit(), we can specify the target div to be
 modified with the template rendered by the corresponding action.
 Is there  way using which we can update multiple divs ( using render
 update) from the called action in ajax.submit()

 I am stuck and for now i am populating a complete page again but its
 incorrect.
 I need to update multiple divs in page at different positions from the
 ajax.submit call.

 Thanks,
 Piyush


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: Search plugin/gem recommendation for search with joins

2010-06-29 Thread Marnen Laibow-Koser
Max Williams wrote:
 Hi all.  It's time to choose a search system for a new app i've been
 working on and though i'd crowdsource some wisdom.  I've used
 ferret/acts_as_ferret before and encountered some problems which make me
 reluctant to use it again.  I know people are using sphinx/solr these
 days (and other things i'm sure).
 
 My particular requirements are to do with complex joins:  when i do my
 search i'm joining lots of tables together and passing various
 conditions to do with the join tables, using a search term (which at the
 moment is just doing a LIKE match on a keywords field), sorting by one
 of the joined fields, and of course paginating the results.  Obviously,
 LIKE searches on a text field isn't very scalable (especially in innodb
 mysql which doesn't allow full text indexing) and it's this aspect that
 i need to replace with a proper indexed search system.

Then don't use InnoDB.  Switch to PostgreSQL, which (among other 
advantages) allows full-text indexing and referential integrity on the 
same table.

I don't see why you need a search plugin here at all.
 
 It was the combination of searching, sorting, joining and paginating
 that seemed to cause problems for ferret and i wondered if anyone could
 recommend a search system that works well with this sort of usage.
 
 Sorry if that's a bit vague, just looking for some accounts of
 experiences really.  Grateful for any advice - max

-- 
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 populate a table with id of selected item from another table

2010-06-29 Thread RichardOnRails
Hassan,

Please hold off on looking at my last, unreasonably large post.  I'm
embarrassed to have posted such a monstrosity.

I found a bunch of tutorials on collection_select,  so I should be
able to discover where I've gone astray in trying to apply that method
in my app.  I'll post back how I solved my problem using those
resources, should I be so fortunate.

Best wishes,
Richard

On Jun 28, 4:42 pm, Hassan Schroeder hassan.schroe...@gmail.com
wrote:
 On Mon, Jun 28, 2010 at 1:06 PM, RichardOnRails

 richarddummymailbox58...@uscomputergurus.com wrote:
  undefined local variable or method `nickname' for #ActionView::Base:
  0x442c8f0
  Extracted source (around line #10):
  10:     %=  f.collection_select(:vendor, :vendor_id, @vendors, :id,
  nickname) -%
  3. I tried a colon in front of nickname in the  f.collection_select
  statement to no avail; besides, the documentation you referred to
  suggested a bareword.

 ? I'm looking at (unframed)

 http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelp...
 with this 'sample usage':

   collection_select(:post, :author_id, Author.all, :id,
 :name_with_initial, {:prompt = true})

 Are you sure you got the *exact same* error using :nickname ?

 If so,  what's the code that creates @vendors ?

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

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



[Rails] Re: belongs_to. Association methods don't pass data to DB

2010-06-29 Thread P.A.
I got it.

It should to break the creation statements onto a few steps:

WHEN:

 one = Article.new(:title = 'one')

 one.author = Author.new(:name = 'Pavel')

 one.save

 two = Article.new(:title = 'two')

 two.author = Author.find(:first, :conditions = {:name = 'Pavel'})

 two.save

THEN:

sqlite select * from authors;
 id = 1
name = Pavel

sqlite select * from articles;
   id = 1
title = 'one'
author_id = 1

   id = 2
title = 'two'
author_id = 1

On 29 июн, 19:30, P.A. shama...@hotmail.com wrote:
 Hi.

 I have a problem with the association methods which passed to a model
 through a belongs_to declaration. Here's an illustration of the issue:

 GIVEN:

 # migration
 class CreateArticlesAndAuthorsTables  ActiveRecord::Migration
   def self.up
 create_table :articles do |t|
   t.text :title
   t.integer :author_id
 end

 create_table :authors do |t|
   t.text :name
 end
   end

   def self.down
 drop_table :articles
 drop_table :authors
   end
 end

 # articles model
 class Article  ActiveRecord::Base
   belongs_to :author
 end

 # authors model
 class Author  ActiverRecord::Base
   has_many :articles
 end

 WHEN:

  Article.create(:title = 'one').author = Author.create(:name = 'Pavel')
  Article.create(:title = 'two').author = Author.find(:first, :conditions 
  = {:name = 'Pavel'})

 THEN

 sqlite select * from authors;
  id = 1
 name = Pavel

 sqlite select * from articles;
    id = 1
 title = 'one'
 author_id = null

    id = 2
 title = 'two'
 author_id = null

 Why do I have null values instead of ids as foreign keys in the
 articles table?

 Thanks.

 Ruby 1.9.2;
 Rails 2.3.8.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: belongs_to. Association methods don't pass data to DB

2010-06-29 Thread Colin Law
On 29 June 2010 17:29, P.A. shama...@hotmail.com wrote:
 I got it.

 It should to break the creation statements onto a few steps:

 WHEN:

 one = Article.new(:title = 'one')

 one.author = Author.new(:name = 'Pavel')

 one.save

 two = Article.new(:title = 'two')

 two.author = Author.find(:first, :conditions = {:name = 'Pavel'})

 two.save

Have a look at
author.articles.build
which will build a new article for an author and save some messing about.

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] Rails session_id is not unique

2010-06-29 Thread AD
We have been experiencing an issue in our environment (Jruby 1.4, Rails
2.3.5, Tomcat 5.5, Java 1.6) where duplicate session_ids are being created
in the sessions table.  We are assuming the only way this can happen is when
2 sessions are created at the exact same time on 2 different machines (we
have 10 app servers running with config.threadsafe! on).  Has anyone
encountered this issue?  It seems the randomness of the session creation
is not unique enough and doesnt account for multiple machines (tomcat uses
the ip of the machine as well i believe).

Thanks
AD

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

2010-06-29 Thread youtube
I've already read this, and still don't understand.

Would I need something like this?

 rewrite %r{/tutorials/(\w+)categories/(\w+)}, '/categories/
CategoryPermalinkHere/tutorials/TutorialPermalinkHere'
 rewrite %r{/tutorials/(\w+)}, '/categories/CategoryPermalinkHere/
tutorials/TutorialPermalinkHere'


Please Help,

I've looked everywhere but just can't figure it out.

Thanks In Advance,

-Joe

Hassan Schroeder wrote:
 On Mon, Jun 28, 2010 at 12:43 PM,  yout...@dev-hq.co.uk wrote:

  So I guess ill want something like

 Why guess? That's what docs are for --

 http://github.com/jtrupiano/rack-rewrite/blob/master/README.rdoc

 There's this thing called 'Der Google', see...  :-)

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

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



[Rails] Re: PDFKIT Gem Example

2010-06-29 Thread geolev
Ryan Bates did a Railscast on this yesterday.

http://railscasts.com/episodes/220-pdfkit

On Jun 18, 4:23 pm, Rails Learner li...@ruby-forum.com wrote:
 Hi Everybody,

 Can anyone give me a small working example of how to use PDFKIT to
 convert a view in rails app to pdf file?

 Any help is much appreciated!

 Thanks!
 --
 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: Is there any way to have observe_field react to the current value of a field also?

2010-06-29 Thread Bob Smith
How would this work with the observe_field later in the page ? This is 
an edit page, so if the field is changed, the page needs to react 
correctly This works fine for a new user, but will it be OK for changing 
an existing user ?

Thanks for the reply

Bob

 div id=church
   % if @household.zip != x and @household.zip != y %
   %= render :partial = church_select %
   % end %
 /div
 
 You need to change the render :nothing in your controller to render an
 empty string or partial to empty the content of the church div when
 appropriate.
 
 HTH,
 Bill

-- 
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: deploy: First Rails App to shared server

2010-06-29 Thread Lake Denman
Well, it looks like you're using rails 2.2.3 in your config/
environment.rb file.

You can either update that version number in the environment.rb file
to match 2.3.8, the rails version you say you have installed on your
host, and deploy.

Or gem install -v=2.2.3 rails on your server and hope for the
best. :)

good luck,

Lake

On Jun 29, 12:43 am, Ali Imran ali.imran.r...@gmail.com wrote:
 I follow all the steps and got this error

 The application has exited during startup (i.e. during the evaluation
 of config/environment.rb). The error message can be found below. To
 solve this problem, please follow any instructions in the error
 message.
 Error message:
 Missing the Rails 2.2.3 gem. Please `gem install -v=2.2.3 rails`,
 update your RAILS_GEM_VERSION setting in config/environment.rb for the
 Rails version you do have installed, or comment out RAILS_GEM_VERSION
 to use the latest version installed.
 Application root:
 /home/realhotr/demo

 On Jun 28, 8:36 pm, Victor S victor.s...@gmail.com wrote:

  If you go to google. you can type: site5 rails deploy and the first
  hit you get is the answer...

  Did you try to do what that post sais? Also try to be perceptive of
  any minute differences in your environment or how you might like to
  make things work for you better... you don't have or if the info is a
  bit outdate, be following things strictly, try to adapt the tutorial
  to what you need. Let me know if the tutorial doesn't do it for you
  still.

  - V

  On Jun 28, 4:34 pm, Ali Imran ali.imran.r...@gmail.com wrote:

   thanks for the reply.

   I read the completely link you send me. and i also looked at the
   site5.com forum and still looking at it but did not find any help to
   deploy the application . I tried all the ways i know...

   On Jun 27, 11:33 pm, Victor S victor.s...@gmail.com wrote:

I deployed on Site5, so it's possible :)

Search their bulletin board for a tutorial, i can't remember the link
off hand, if you have trouble let me know.

If you are developing locally you don't need apache, just go to your
app in the terminal and say$ script/server

This is a pretty good getting started 
guide:http://guides.rubyonrails.org/getting_started.html

But anyway... check the Site5 forum it worked for me, you can try
using the cpanel to start off your rails app, and it will setup a
subdomain for you. if your get that app working, replace the contents
of the folder with your own...

I ssh'ed into site5 and linked the folder created by the cpanel wizard
to my own rails 'public' folder outside the www folder, if i remember
correctly. Theres no need for your rails app to be available to
apache. Then you probably want to look into theirpassengerserver
restart method... where you're supposed to make a file called
restart.txt or something, and put it somewhere, I can't remember
exactly I think I moved it from the default location... again, the
forums are a good resource :) -- then you just ssh again and unix
touch it and bam the server restarts you might not want this
file to be in the www folder either ;)

Good luck,

- V

On Jun 26, 11:28 pm, Ali Imran ali.imran.r...@gmail.com wrote:

 I install locally apache2..
 and i have two hosting accounts i can use any one ...

 i have one with site5.com and other one is godaddy.com...

 what step i need to take now please help me ... its driving me crazy..

 On Jun 26, 12:02 pm, murali dhararao sumud...@gmail.com wrote:

  Hi ,

  Did you deployed application on apache server? is that is running 
  locally?

  On Sat, Jun 26, 2010 at 3:37 AM, Ali Imran 
  ali.imran.r...@gmail.com wrote:
   I installed

   ruby: 1.8.7
   rails: 2.3.8
   gems:  1.3.5

   on the Ubuntu withpassenger 2.2.15

   now i create the first demo application,

   i create a folder on home ruby-demo

   than i created a sites-available

   udo nano /etc/apache2/sites-available/demo

   VirtualHost *:80

   ServerName mydomain.com
   ServerAliaswww.mydomain.com

   DocumentRoot /home/ruby/demo/public

   /VirtualHost

   i am looking for next step .. where to go from here and also 
   please
   help me if i am doing these steps wrong

   i also run the demo project by apache2 server by

   placing application in  /var/www

   and it works fine.

   but how i move to this my shared hosting server
   and run online

   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.comrubyonrails-talk%2Bunsubscrib
e...@googlegroups.com
   .
   For more options, visit this group 

[Rails] Re: can I access session variable in model

2010-06-29 Thread Anand Ramanathan
Hi,

I have a scenario where the session variable is handy in the model - I 
need to be able to get the current value, as it may be changed at any 
time.

I have a delayed_job that runs a long running model activity (calling 
multiple web services, populating the database, etc.) in the background. 
This is triggered when a user selects an item from a list in the UI. 
However, if the user clicks on another item, I want the current 
processing to stop, as I want to keep the delayed_job worker pool as 
free as possible (the more the jobs, the more I am billed by the 
hoster). The only way I can see to achieve this is to set a session 
variable (session[:current_topic_id]) when the user clicks on a topic, 
and then check in each stage of the model action if the current topic is 
the same as the one stored in the session, and abort the long job if 
they are out of sync.

Here, passing in the session variable to the model method wont really 
work for me, I have to pass in the session id and check the variable 
value across the model code.

Thanks
Anand

Pratik Naik wrote:
 Hey David,
 
 Sorry, I didn't mean to quote you ( just pressed gmail reply button ).
 My message was not for you, but for the people using the code :)
 
 On Tue, Jul 29, 2008 at 5:36 PM, David A. Black dbl...@rubypal.com 
 wrote:


 thinking that the method and variable names were being hurled at a
  * Co-taught by D.A. Black and Erik Kastner
 See http://www.rubypal.com for details and updates!

 

 
 
 
 --
 Cheers!
 - Pratik
 http://m.onkey.org

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

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



[Rails] Re: How do you deploy RoR? Newb alert!

2010-06-29 Thread Sur
Hi,

SVN and/or GIT has nothing to do directly with deployment or passenger
but you should study on Source Code Management or Source Code Version
SVN and GIT both are a source code management tools and you can manage
the updates of your source code with them.

SVN though is older yet solid, GIT is relatively newer but more
popular in Rails community. So if need to start with something, I
would say to pick up GIT directly.
Get some proficiency in GIT and so if you just wanna test out things,
you can get yourself a free account on http://github.com to host
public repositories and if you need to keep your code private you
might like to go for a paid account. Though GitHub is the most
respected provider for hosting Git repos, there are some other good
providers for hosting private Git repositories which comes with more
economical plans, viz. repositoryhosting.com

Once you are good with Git... time to deploy on a server.
In Rails, just forget the old school FTP deployments... it's much more
interesting and awesome here once you are familiar with.

 Also, another question is where can I find a very cheap host to upload
 my RoR app/site?  Or what host would you recommend that wouldn't cost
 an arm and a leg?  I see to use Joyent.com it cost ALOT to host with
 them (http://www.joyent.com/services/cloudhosting/) like around $500+/
 mo for 4GB Ram... That's crazy if you ask me... Especially, if you're
 just starting out and want to play around before you get into paying
 more money for a host.

Why would you need 4GB RAM just to jump start your first rails site
(with no live users I suppose). 4GB anyhow is going to cost you a bit
more.
Go for some economical hosting providers, Linode or SpeedyRails etc.
I don't have personal experience with Linode, but SR guys will setup
everything for you ... including.. MySql, Phusion Passenger and
automated deployment with Capistrano you will just need to give
them your repository information (and money :).
Capistrano is a tool for automating your deployment process,
especially for Rails apps.. you can read more about it here 
http://www.capify.org
So, there after, any change you'll make in your code, you just need to
push the changes to the repository and fire just one command from your
application root... most likely this  cap deploy  to redeploy with
the latest changes.


I hope this would help you somehow.


regards,
Sur


On Jun 27, 11:42 pm, Jeremy bathrobewarr...@gmail.com wrote:
 Hi there,
 I'm a newb when it comes to RoR but I have some questions about
 deployment that has eluded me since I heard about RoR 2+ years ago. I
 was hoping someone could shed some light for me on this subject.

 I've read many books on Ruby and Rails, and I've watched many video
 tutorials but after hours of reading up on Ruby and Rails, I am still
 confused about how deployment is done. Mind you, I'm learning this
 stuff on my own without help from a real person, so I'm a little
 frustrated about how difficult it is to deploy a site/app.

 Also, another question is where can I find a very cheap host to upload
 my RoR app/site?  Or what host would you recommend that wouldn't cost
 an arm and a leg?  I see to use Joyent.com it cost ALOT to host with
 them (http://www.joyent.com/services/cloudhosting/) like around $500+/
 mo for 4GB Ram... That's crazy if you ask me... Especially, if you're
 just starting out and want to play around before you get into paying
 more money for a host.

 Anyway, here's what I understand thus far about deployment...
 I can use either SVN or Git to upload my RoR project to a server,
 is that correct? Why can't I just use FTP?  (newb question I know...)

 I've been hearing a lot about Phusion Passenger, but it's a little
 overwhelming.  So just wondering if this is all I need to deploy an
 app?  Would I need git or svn if I used passenger?

 What books would you recommend for learning to upload a Ruby on Rails
 site/app to a server?

 I did a few searches here to find out if i could get an answer for my
 questions but it's a little overwhelming..  I know it's a lot of
 questions so my apologies in advance. Any guidance I can get about
 these topics would be very appreciated and helpful.  Even if it's just
 listing a couple books that specifically target these subjects would
 be great.

 Thanks again,
 Jeremy

 P.S. I work on Mac OSX - Snow Leopard 10.6.4, 3.06 GHz Intel Core2 Duo
 and 4GB memory...  Also, I'm working with the current stable versions
 of Ruby, Rails and gems as of June 27 2010.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: Is there any way to have observe_field react to the current value of a field also?

2010-06-29 Thread Bill Walton
Hi Bob,

On Tue, Jun 29, 2010 at 12:28 PM, Bob Smith li...@ruby-forum.com wrote:
 How would this work with the observe_field later in the page ? This is
 an edit page, so if the field is changed, the page needs to react
 correctly This works fine for a new user, but will it be OK for changing
 an existing user ?

That's what the second part, below, is about.

 You need to change the render :nothing in your controller to render an
 empty string or partial to empty the content of the church div when
 appropriate.

Best regards,
Bill

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

2010-06-29 Thread Hassan Schroeder
On Tue, Jun 29, 2010 at 10:11 AM,  yout...@dev-hq.co.uk wrote:
 I've already read this, and still don't understand.

As I said, it's using regular expressions, and *you* need to figure out
how they work. Find a regex tutorial, open up irb and play around.

Then, or even before, use the examples in the Rack::Rewrite docs to
experiment. It'll take less time to *just try it* than to compose an email.
And at least you'll be able to say here's what I want, here's what I've
tried, here are the results.

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

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



[Rails] Re: Is there any way to have observe_field react to the current value of a field also?

2010-06-29 Thread Bob Smith
Never mind. I just tried it and it works perfectly. Thanks for the help.

Bob

Bob Smith wrote:
 How would this work with the observe_field later in the page ? This is 
 an edit page, so if the field is changed, the page needs to react 
 correctly This works fine for a new user, but will it be OK for changing 
 an existing user ?
 
 Thanks for the reply
 
 Bob
 
 div id=church
   % if @household.zip != x and @household.zip != y %
   %= render :partial = church_select %
   % end %
 /div
 
 You need to change the render :nothing in your controller to render an
 empty string or partial to empty the content of the church div when
 appropriate.
 
 HTH,
 Bill

-- 
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: Add a filter on the ERB %= ... %

2010-06-29 Thread Michael Pavling
On 29 June 2010 15:24, daphonz cdre...@gmail.com wrote:
 There is a much easier solution to all of this.  Utilize the try()
 method that comes with ActiveSupport:

I don't see how that's easier than the guard condition that Colin
suggested - but either way it ignores that the OP wanted to deal with
all the occurrences of the problem in one place, rather than go
tweaking loads of views.

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



[Rails] Rails 3 and ActiveSupport::Callbacks

2010-06-29 Thread Jean-denis Vauguet
Hi.

Is there a way to access an object within callbacks defined with
set_callback (ActiveSupport 3.0.0-beta4, matching Rails 3)?

Use case is as follow:

require 'active_support'

class Foo
  include ActiveSupport::Callbacks

  define_callbacks :handle_response

  set_callback :handle_response, :after do |response|
# play with the response
  end

  # some stuff...

  def list_users
run_callbacks :handle_response do
  # this request returns a response
  @someapi.get(/some/resource)
end
  end
end

# run
Foo.new.list_users

Currently, in place of |response|, I have |object| as the doc suggests,
which is the class object at runtime. AS callbacks are great for
after/before/around independant processing, but can they be used for
data manipulation hooks? If not, is there an alternative to achieve such
an effect?

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: belongs_to. Association methods don't pass data to DB

2010-06-29 Thread P.A.
I was most interested about that methods which are added by belongs_to
declaration not has_many.

Anyway, thanks for help, Colin.

On 29 июн, 20:47, Colin Law clan...@googlemail.com wrote:
 On 29 June 2010 17:29, P.A. shama...@hotmail.com wrote:



  I got it.

  It should to break the creation statements onto a few steps:

  WHEN:

  one = Article.new(:title = 'one')

  one.author = Author.new(:name = 'Pavel')

  one.save

  two = Article.new(:title = 'two')

  two.author = Author.find(:first, :conditions = {:name = 'Pavel'})

  two.save

 Have a look at
 author.articles.build
 which will build a new article for an author and save some messing about.

 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] Referencing a Layout

2010-06-29 Thread doug
My understanding is that Rails generally expects layouts to be files
and any reference to a layout is a path to the appropriate file.
Thus, a layout that is generated at run time and stored only in memory
(as a variable), can only be loaded by first writing the layout to a
temporary disk file and then loading it from there.  Am I correct in
my understanding?

TIA.

  ... doug

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

2010-06-29 Thread Mamadou Touré
Michael Pavling wrote:
 On 28 June 2010 21:45, dieinzige dieinz...@me.com wrote:
 what the hell are u doing, if u have file, u can simplify get link to user,
 
 What if the OP needs users to be logged in to view files? Or complete
 some other approval process. Not much sense having them accessible
 from the public directory in that instance, which would allow people
 to just bypass the security.

I'm having the file displayed now, but the other issue that I'm facing 
now is : I have several files to open, I put them in an array that I 
loop through, but only the last file is opened:

What's wrong ?

arr.each do |form|
  file_name = form + - + vue.inte_no.to_s + - + vue.poas_id.to_s 
+ - + vue.prch_id.to_s + .xdp
 send_file(path_pdf_cpy + file_name,:type = 'application/pdf' , 
:disposition = 'attachment', :filename = file_name)
   end
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Referencing a Layout

2010-06-29 Thread Marnen Laibow-Koser
Doug Jolley wrote:
 My understanding is that Rails generally expects layouts to be files
 and any reference to a layout is a path to the appropriate file.
 Thus, a layout that is generated at run time and stored only in memory
 (as a variable), can only be loaded by first writing the layout to a
 temporary disk file and then loading it from there.  Am I correct in
 my understanding?
 

I believe so.  But why would you ever do that?  Layouts are designed to 
hold the parts of your view that don't change.  If they don't change, 
you shouldn't need to generate them on the fly.


 TIA.
 
   ... doug

-- 
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: Send_data

2010-06-29 Thread Marnen Laibow-Koser
Mamadou Touré wrote:
[...]
 
 I'm having the file displayed now, but the other issue that I'm facing 
 now is : I have several files to open, I put them in an array that I 
 loop through, but only the last file is opened:
 
 What's wrong ?
 
 arr.each do |form|
   file_name = form + - + vue.inte_no.to_s + - + vue.poas_id.to_s 
 + - + vue.prch_id.to_s + .xdp
  send_file(path_pdf_cpy + file_name,:type = 'application/pdf' , 
 :disposition = 'attachment', :filename = file_name)
end

You can't send multiple files in response to one request.  Do you want
to join the pages of the PDF files into one long file?




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: Redirecting old URLs to new permalinked URLs

2010-06-29 Thread Joe
I've tried, but I can't figure out how to replace $1 with a permalink
variable thats in ruby on rails. Im pretty sure regex cannot help me
with this, I need to take the permalink value, and use that in the
redirect.

PLEASE JUST TELL ME AND ILL LEARN, I DONT JUST TAKE THE ANSWER AND BE
DONE WITH IT, I LEARN FROM IT.

Please Help,

Thanks In Advnce,

Joe

On 29 June, 18:44, Hassan Schroeder hassan.schroe...@gmail.com
wrote:
 On Tue, Jun 29, 2010 at 10:11 AM,  yout...@dev-hq.co.uk wrote:
  I've already read this, and still don't understand.

 As I said, it's using regular expressions, and *you* need to figure out
 how they work. Find a regex tutorial, open up irb and play around.

 Then, or even before, use the examples in the Rack::Rewrite docs to
 experiment. It'll take less time to *just try it* than to compose an email.
 And at least you'll be able to say here's what I want, here's what I've
 tried, here are the results.

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

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



[Rails] Re: link_to underlying urls/paths are showing in the actual view

2010-06-29 Thread Matt Royer
Has anyone found a solution to this or is anyone else having this issue?

It's odd to me that Adler and I would be the only ones. Especially since 
I am only using the defaults that Rails 3.0.0.beta4 provides.

I didn't change the default JavaScript files. I have added them using 
:defaults. I don't have any custom JavaScript running. I don't have any 
added gems or plugins in my app yet.

Also, like I stated previously, this only happens when I use FireFox. 
Which is another oddity. Internet Explorer displays this correctly.

Any help on this issue would be greatly appreciated.

Thanks in advance,

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

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



Re: [Rails] Re: link_to underlying urls/paths are showing in the actual view

2010-06-29 Thread Colin Law
On 29 June 2010 21:39, Matt Royer li...@ruby-forum.com wrote:
 Has anyone found a solution to this or is anyone else having this issue?

 It's odd to me that Adler and I would be the only ones. Especially since
 I am only using the defaults that Rails 3.0.0.beta4 provides.

 I didn't change the default JavaScript files. I have added them using
 :defaults. I don't have any custom JavaScript running. I don't have any
 added gems or plugins in my app yet.

 Also, like I stated previously, this only happens when I use FireFox.
 Which is another oddity. Internet Explorer displays this correctly.

 Any help on this issue would be greatly appreciated.

I believe it is a FF add-on that does this, I have seen the question
asked before, though don't remember which one.  Disable all your FF
add-ons  (Tools, Addons and disable them all) and see if it goes away.

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] Passenger: configuration problem

2010-06-29 Thread Ali Imran

I follow the steps to install passenger ,

I installed it in the same way,

I copy the contents on the same location it asked to do,

when i run
passenger-install-nginx-module

I copy paste the contants in apache.conf

which includes

Loadmodule
PassengerRoot
PassengerRuby

I am having a problem how to setup this
please help me where to put this and how to config if my application
name is demo and user name is ali and root directory is home

i am stuck here

VirtualHost *:80

ServerName mydomain.com
ServerAlias www.mydomain.com

DocumentRoot /home/ruby/demo/public

Directory /somewhere/public

AllowOverride all
Options -MultiViews

/VirtualHost

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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] FTP: which FTP is best for Ubuntu to upload rails project

2010-06-29 Thread Ali Imran
I am trying to upload the constants to my shared server but built in
FTP in Ubuntu is not working

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

2010-06-29 Thread doug
 But why would you ever do that?  Layouts are designed to
 hold the parts of your view that don't change.  If they don't change,
 you shouldn't need to generate them on the fly.

What I'd really like to be able to do is to allow for an external
layout.  That is, when another site links to the resource, it could
append a parameter to the URL specifying the URL of an alternative
layout to be used.  Typically the alternative layout would be located
on the host linking *TO* the resource.  I'd have to get the layout
across the network and that's how I wind up with it in a variable.

I mentioned this in another post and from the limited responses that I
received I concluded that almost no one else has any interest in doing
this sort of thing.  I find that a bit surprising and it leaves me
wondering if I am not missing some other more popular way of skinning
this cat.  Anyway, that's the rationale behind my inquiry.  Thanks for
the input.

   ... doug

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

2010-06-29 Thread Philip Hallstrom
  But why would you ever do that?  Layouts are designed to
 hold the parts of your view that don't change.  If they don't change,
 you shouldn't need to generate them on the fly.
 
 What I'd really like to be able to do is to allow for an external
 layout.  That is, when another site links to the resource, it could
 append a parameter to the URL specifying the URL of an alternative
 layout to be used.  Typically the alternative layout would be located
 on the host linking *TO* the resource.  I'd have to get the layout
 across the network and that's how I wind up with it in a variable.

I hope you're going to cache that layout

 I mentioned this in another post and from the limited responses that I
 received I concluded that almost no one else has any interest in doing
 this sort of thing.  I find that a bit surprising and it leaves me
 wondering if I am not missing some other more popular way of skinning
 this cat.  Anyway, that's the rationale behind my inquiry.  Thanks for
 the input.

Why not make your third party partners create a special HTML page and include 
an HTML comment that indicates where the content goes.  Something like...

html
 head./head
 body
   h1My Groovy Layout/h1
   !-- CONTENT --
   divFooter Stuff/div
 /body
/html

Whatever they want as long as that comment is there.

Then you can read in that file, split it on that html comment and assign the 
first half to @top and the second half to @bottom and then have a layout like:

%= @top %
%= yield %
%= @bottom %

I'd probably pick better names for top/bottom to avoid conflicts, but you get 
the idea.

I'm ignoring all of the issues surrounding relative/absolute urls to JS, CSS, 
images and any XSS issues, etc...

And whatever you do... cache it for awhile.  

-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] Re: Referencing a Layout

2010-06-29 Thread Marnen Laibow-Koser
Doug Jolley wrote:
�But why would you ever do that? �Layouts are designed to
 hold the parts of your view that don't change. �If they don't change,
 you shouldn't need to generate them on the fly.
 
 What I'd really like to be able to do is to allow for an external
 layout.  That is, when another site links to the resource, it could
 append a parameter to the URL specifying the URL of an alternative
 layout to be used.  Typically the alternative layout would be located
 on the host linking *TO* the resource.  I'd have to get the layout
 across the network and that's how I wind up with it in a variable.
 
 I mentioned this in another post and from the limited responses that I
 received I concluded that almost no one else has any interest in doing
 this sort of thing.  I find that a bit surprising and it leaves me
 wondering if I am not missing some other more popular way of skinning
 this cat.  Anyway, that's the rationale behind my inquiry.  Thanks for
 the input.

Yiure going about this backwards.  Your site shouldn't be doing your 
consumers' layout work.  Instead, it sshould provide data that your 
consumers can lay out as they please.


 
... doug

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] Passenger: configuration problem

2010-06-29 Thread Norm Scherer




Ali Imran wrote:

  I follow the steps to install passenger ,

I installed it in the same way,

I copy the contents on the same location it asked to do,

when i run
passenger-install-nginx-module

I copy paste the contants in apache.conf

which includes

Loadmodule
PassengerRoot
PassengerRuby

I am having a problem how to setup this
please help me where to put this and how to config if my application
name is demo and user name is ali and root directory is home

i am stuck here

VirtualHost *:80

ServerName mydomain.com
ServerAlias www.mydomain.com

DocumentRoot /home/ruby/demo/public

Directory /somewhere/public

AllowOverride all
Options -MultiViews
  

You need /Directory around here

  
/VirtualHost

  







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

2010-06-29 Thread Marnen Laibow-Koser
Ali Imran wrote:
 I follow the steps to install passenger ,
 
 I installed it in the same way,
 
 I copy the contents on the same location it asked to do,
 
 when i run
 passenger-install-nginx-module
 
 I copy paste the contants in apache.conf

Why are you using the Nginx Passenger module with Apache?  That probably
won't work.

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: Referencing a Layout

2010-06-29 Thread Hassan Schroeder
On Tue, Jun 29, 2010 at 2:50 PM, Marnen Laibow-Koser
li...@ruby-forum.com wrote:

 I mentioned this in another post and from the limited responses that I
 received I concluded that almost no one else has any interest in doing
 this sort of thing.  I find that a bit surprising ...

 Yiure going about this backwards.  Your site shouldn't be doing your
 consumers' layout work.  Instead, it sshould provide data that your
 consumers can lay out as they please.

Heh. Exactly what I said the first time :-)

Consider this scenario:

I go to a site, navigate around, click some link and all of a sudden
the URL in the address bar totally changes to some other site. But
the page appearance stays the same.

Suspicious? You bet. Has phishing written all over it. Me likey?
No. Me gone  :-)

And that's aside from the already mentioned XSS/single-site-origin
issues, relative URL refs, etc.

I would never use such a scheme, nor recommend a client do so...

YMMV!

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

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



[Rails] Re: Mongrel is Terminating Automatically

2010-06-29 Thread laz
I face the same problem with my webrick server. I am new to ROR, so
any thought on why this occurs would be very helpful.

-Laz

On Jun 11, 3:34 am, sumanta sumantacapt...@gmail.com wrote:
 Dear All,

 I am facing a problem - when I am hittinghttp://localhost:3000/login_c
 to enter to our system, webrick/mongrel quiting from command prompt.

 I am getting this error-
 
 C:\Obsmongrel_rails start
 ** Starting Mongrel listening at 0.0.0.0:3000
 ** Starting Rails with development environment...
 ** Rails loaded.
 ** Loading any Rails specific GemPlugins
 ** Signals ready.  INT = stop (no restart).
 ** Mongrel 1.1.5 available at 0.0.0.0:3000
 ** Use CTRL-C to stop.
 C:/Ruby/lib/ruby/1.8/pathname.rb:266: [BUG] Segmentation fault
 ruby 1.8.6 (2008-08-11) [i386-mswin32]

 This application has requested the Runtime to terminate it in an
 unusual
 way.
 Please contact the application's support team for more information.
 
 I am using windows xp service pack2, rails 2.3.5 .
 I already did uninstall and reinstall but no result.
 Please help.

 Thanks in advance.

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

2010-06-29 Thread sjm
Hi Everyone

I have been searching for an answer for this all day, stumbling from
page to page trying examples that don't work!

Anyway, I am trying to run multiple Rails apps sitting behind
Apache2.2.

It is nearly there, apart from the static content (images, etc) is not
delivered anymore (since configuring mongrel with --prefix flag).
Note: this only applies to URLs not generated by Rails, such as those
in CSS files.

I can understand why, for instance the CSS files contain links such as
url(/images/foo.jpg) which work quite happily when mongrel is
delivering only one app and does not need to be configured with --
prefix...

I thought that Apache Rewrite rules would be the answer, however I am
not competent enough in their use to construct them myself yet, I
found some on the Internet but alas this failed.

Short of modifying all the links to include the prefix to match
mongrel, I am at a loss on what to do!

Any help with be greatly appreciated!

Kind Regards,

Steven

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

2010-06-29 Thread Marnen Laibow-Koser
Hassan Schroeder wrote:
 On Tue, Jun 29, 2010 at 2:50 PM, Marnen Laibow-Koser
 li...@ruby-forum.com wrote:

 I mentioned this in another post and from the limited responses that I
 received I concluded that almost no one else has any interest in doing
 this sort of thing. �I find that a bit surprising ...
 
 Yiure going about this backwards. �Your site shouldn't be doing your
 consumers' layout work. �Instead, it sshould provide data that your
 consumers can lay out as they please.
 
 Heh. Exactly what I said the first time :-)
 
 Consider this scenario:
 
 I go to a site, navigate around, click some link and all of a sudden
 the URL in the address bar totally changes to some other site. But
 the page appearance stays the same.
 
 Suspicious? You bet. Has phishing written all over it. Me likey?
 No. Me gone  :-)

See, I don't agree with that objection.  There are plenty if hosted 
services that can be skinned to look like your own site.  That part is 
fine.  But they don't generally use transient layouts like Doug is 
proposing.

 
 And that's aside from the already mentioned XSS/single-site-origin
 issues, relative URL refs, etc.
 
 I would never use such a scheme, nor recommend a client do so...
 
 YMMV!
 
 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 twitter: @hassan

-- 
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 do you deploy RoR? Newb alert!

2010-06-29 Thread Jeremy
Hi everyone,
I have to say that I am very pleased that I have received such great
responses!  I kept expecting that I would get the cold shoulder but
instead I got real answers. I feel I have a solid direction and don't
feel like I'm blindly trying to figure this stuff out. So please
accept my sincerest thank you to all of you for helping me out!

Bob,
I decided to go ahead and buy the book regardless if it's
outdated :-)  I kinda figured the way deployment is done couldn't have
changed too much.

Peter,
Thank you, I appreciate your contribution as well.  Although, it was a
little over my head when you started talking mercurial repositories
but I'm sure I'll understand what that means sometime in the near
future.

Sur,
This helps greatly! You have certainly gone above and beyond what I
was looking for, so thank you for all the time and effort you put into
this thread.  I'm sure all this information will help other newbs as
well when they go looking for an answer.

Thanks again!

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: link_to underlying urls/paths are showing in the actual view

2010-06-29 Thread Anand Ramanathan
Could you try wrapping the controller, action, etc. in a url hash

 %= link_to Here, :url = {:controller = 'home', :action =
'inside_here' }%






On Tue, Jun 29, 2010 at 1:45 PM, Colin Law clan...@googlemail.com wrote:

 On 29 June 2010 21:39, Matt Royer li...@ruby-forum.com wrote:
  Has anyone found a solution to this or is anyone else having this issue?
 
  It's odd to me that Adler and I would be the only ones. Especially since
  I am only using the defaults that Rails 3.0.0.beta4 provides.
 
  I didn't change the default JavaScript files. I have added them using
  :defaults. I don't have any custom JavaScript running. I don't have any
  added gems or plugins in my app yet.
 
  Also, like I stated previously, this only happens when I use FireFox.
  Which is another oddity. Internet Explorer displays this correctly.
 
  Any help on this issue would be greatly appreciated.

 I believe it is a FF add-on that does this, I have seen the question
 asked before, though don't remember which one.  Disable all your FF
 add-ons  (Tools, Addons and disable them all) and see if it goes away.

 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.comrubyonrails-talk%2bunsubscr...@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: Send_data

2010-06-29 Thread Mamadou Touré
Marnen Laibow-Koser wrote:
 Mamadou Touré wrote:
 [...]
 
 I'm having the file displayed now, but the other issue that I'm facing 
 now is : I have several files to open, I put them in an array that I 
 loop through, but only the last file is opened:
 
 What's wrong ?
 
 arr.each do |form|
   file_name = form + - + vue.inte_no.to_s + - + vue.poas_id.to_s 
 + - + vue.prch_id.to_s + .xdp
  send_file(path_pdf_cpy + file_name,:type = 'application/pdf' , 
 :disposition = 'attachment', :filename = file_name)
end
 
 You can't send multiple files in response to one request.  Do you want
 to join the pages of the PDF files into one long file?
 
 
 
 
 Best,
 --

Thanks Marnen,

Unfortunately I have to hav each file on its own, I must not merge them 
in on single file. Is there a way to simulate several requests in order 
to loop through the array ?
 Marnen Laibow-Koser
 http://www.marnen.org
 mar...@marnen.org

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

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



[Rails] Re: How do you deploy RoR? Newb alert!

2010-06-29 Thread Marnen Laibow-Koser
Jeremy wrote:
 Hi everyone,
 I have to say that I am very pleased that I have received such great
 responses!  I kept expecting that I would get the cold shoulder but
 instead I got real answers. I feel I have a solid direction and don't
 feel like I'm blindly trying to figure this stuff out. So please
 accept my sincerest thank you to all of you for helping me out!
 
 Bob,
 I decided to go ahead and buy the book regardless if it's
 outdated :-)  I kinda figured the way deployment is done couldn't have
 changed too much.
 
It probably has.  I don't think Passenger was in wide use at the time, 
and it's now probably the most common choice for deployment.
 
 Peter,
 Thank you, I appreciate your contribution as well.  Although, it was a
 little over my head when you started talking mercurial repositories
 but I'm sure I'll understand what that means sometime in the near
 future.

Mercurial is a version control system -- though it's not in all that 
wide use in the Rails community.  I think most Rails developers use Git. 
 Which version control system are you using?

(Hint: if the answer is none, fix that *today* by installing Git. 
 There is no excuse whatsoever for neglecting version control.)

Also, check out Heroku for very easy Rails deployment. 

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: Send_data

2010-06-29 Thread Marnen Laibow-Koser
Mamadou Touré wrote:
[...]
 
 
 
 
 Thanks Marnen,
 
 Unfortunately I have to hav each file on its own, I must not merge them 
 in on single file. Is there a way to simulate several requests in order 
 to loop through the array ?

Even if there were, the browser would not be able to understand it.  You 
could use several Ajax requests, but if I were your user, I'd be annoyed 
that your website was randomly downloading files without my consent. 
Why can't you just provide several download links for the files?  Or 
create a zip or tar archive?


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

Jeremy wrote:
 Hi everyone,
 I have to say that I am very pleased that I have received such great
 responses!  I kept expecting that I would get the cold shoulder but
 instead I got real answers. I feel I have a solid direction and don't
 feel like I'm blindly trying to figure this stuff out. So please
 accept my sincerest thank you to all of you for helping me out!
 
 Bob,
 I decided to go ahead and buy the book regardless if it's
 outdated :-)  I kinda figured the way deployment is done couldn't have
 changed too much.
 
It probably has.  I don't think Passenger was in wide use at the time, 
and it's now probably the most common choice for deployment.
 
 Peter,
 Thank you, I appreciate your contribution as well.  Although, it was a
 little over my head when you started talking mercurial repositories
 but I'm sure I'll understand what that means sometime in the near
 future.

Mercurial is a version control system -- though it's not in all that 
wide use in the Rails community.  I think most Rails developers use Git. 
 Which version control system are you using?

(Hint: if the answer is none, fix that *today* by installing Git. 
 There is no excuse whatsoever for neglecting version control.)

Also, check out Heroku for very easy Rails deployment. 

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: Send_data

2010-06-29 Thread Marnen Laibow-Koser
Mamadou Touré wrote:
[...]
 
 
 
 
 Thanks Marnen,
 
 Unfortunately I have to hav each file on its own, I must not merge them 
 in on single file. Is there a way to simulate several requests in order 
 to loop through the array ?

Even if there were, the browser would not be able to understand it.  You 
could use several Ajax requests, but if I were your user, I'd be annoyed 
that your website was randomly downloading files without my consent. 
Why can't you just provide several download links for the files?  Or 
create a zip or tar archive?


-- 
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 do you deploy RoR? Newb alert!

2010-06-29 Thread Jeremy
 Hi Marnen,

 It probably has.  I don't think Passenger was in wide use at the
time,
 and it's now probably the most common choice for deployment.

So you're saying Passenger is a good choice for deployment then?  I
still plan to read the aforementioned book, I don't think it would
hurt.


 Which version control system are you using?
(Hint: if the answer is none, fix that *today* by installing
Git.
 There is no excuse whatsoever for neglecting version control.)

Well, I never plan to neglect vc...  that's partially why I created
this thread because I wasn't sure what to use.  I already have Git
installed (which I installed quite some time ago), but I don't
understand how to use it quite yet so that's why I'm reading what I
can about it...  but I need a book that is going to take me through it
via baby steps since I don't have any experience whatsoever using Git,
(or any other vc as far as that goes but Git is what I'll probably use
in the end.)


 Also, check out Heroku for very easy Rails deployment. 

I will def look into that, thank you for the reference.

Thanks again,
Jeremy

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

2010-06-29 Thread Marnen Laibow-Koser
Jeremy wrote:
 Hi Marnen,
 
      It probably has. �I don't think Passenger was in wide use at the
 time,
      and it's now probably the most common choice for deployment.
 
 So you're saying Passenger is a good choice for deployment then?

Definitely. 

  I
 still plan to read the aforementioned book, I don't think it would
 hurt.

Why do you want to read an outdated book?

 
 
     �Which version control system are you using?
     (Hint: if the answer is none, fix that *today* by installing
 Git.
     �There is no excuse whatsoever for neglecting version control.)
 
 Well, I never plan to neglect vc...  that's partially why I created
 this thread because I wasn't sure what to use.  I already have Git
 installed (which I installed quite some time ago), but I don't
 understand how to use it quite yet so that's why I'm reading what I
 can about it...  but I need a book that is going to take me through it
 via baby steps since I don't have any experience whatsoever using Git,
 (or any other vc as far as that goes but Git is what I'll probably use
 in the end.)

I don't know of any books on Git.  But there are plenty of Web 
tutorials. 

Just start using it.  Also use RSpec and Cucumber to do all development 
test-first.  Serious development in 2010 absolutely requires both 
version control and automated tests. 

 

 Also, check out Heroku for very easy Rails deployment.�
 
 I will def look into that, thank you for the reference.
 
 Thanks again,
 Jeremy
-- 
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: rake db:create failing

2010-06-29 Thread Agoofin
I've had an issue with the sqlite driver. What version are you using?
Looking at the RubyForge site, they've released version 1.3.0 of
sqlite3-ruby on June 6th - upgrading this might help

On Jun 28, 3:49 pm, Joe x.lt0...@gmail.com wrote:
 Hi everyone,

 First of all, I'm running Mac OS X Snow Leopard.

 Trying to set up a new SQLite database, but when I run rake db:create,
 I get the following huge message:

 unable to open database file
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 sqlite3_adapter.rb:13:in `initialize'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 sqlite3_adapter.rb:13:in `new'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 sqlite3_adapter.rb:13:in `sqlite3_connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:223:in `send'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:223:in `new_connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:245:in `checkout_new_connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:188:in `checkout'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:184:in `loop'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:184:in `checkout'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 1.8/monitor.rb:242:in `synchronize'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:183:in `checkout'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:98:in `connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_pool.rb:326:in `retrieve_connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_specification.rb:123:in `retrieve_connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/
 abstract/connection_specification.rb:115:in `connection'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:43:in
 `create_database'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:31
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 1.8/monitor.rb:242:in `synchronize'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
 

Re: [Rails] Re: Redirecting old URLs to new permalinked URLs

2010-06-29 Thread Hassan Schroeder
On Tue, Jun 29, 2010 at 1:37 PM, Joe j...@dev-hq.co.uk wrote:
 I've tried, but I can't figure out how to replace $1 with a permalink
 variable thats in ruby on rails. Im pretty sure regex cannot help me
 with this, I need to take the permalink value, and use that in the
 redirect.

 PLEASE JUST TELL ME AND ILL LEARN, I DONT JUST TAKE THE ANSWER AND BE
 DONE WITH IT, I LEARN FROM IT.

Top-posting *and* yelling -- not a particularly appealing combination...

But one last try. Your original example:

http://127.0.0.1:3000/categories/1-css/tutorials/12-test9
http://127.0.0.1:3000/tutorials/12-test9
http://127.0.0.1:3000/categories/1/tutorials/12
http://127.0.0.1:3000/tutorials/12

Sure, you can manually enter rewrite rules for *every one* of your
tutorials and categories, and avoid using regular expressions. Be
my guest. :-)

Or you can start with the simplest example above, and figure out how
a simple regex can give you 12 from /tutorials/12. Write a method
to take that value 12 and return 12-test9. Put that in a rewrite rule.
Try it with a couple of other values. Works? Good. Start on the next
most complex string. Lather, rinse, repeat.

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

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



Re: [Rails] One time shot feed params from development

2010-06-29 Thread Bill Walton
Hi Craig,

On Tue, Jun 29, 2010 at 8:25 PM, Craig White craigwh...@azapple.com wrote:
 I got a confirmation on my development system that should have gone to
 the production system and so I have a 'Post' set of data which I know
 from my development logs that I want to feed to my production system.

 Is there some easy way to do this in the console or do I have to try to
 recreate it with wget or a web browser?


M

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

2010-06-29 Thread Bill Walton
Oops ;-)

On Tue, Jun 29, 2010 at 9:08 PM, Bill Walton bwalton...@gmail.com wrote:
 Hi Craig,

 On Tue, Jun 29, 2010 at 8:25 PM, Craig White craigwh...@azapple.com wrote:
 I got a confirmation on my development system that should have gone to
 the production system and so I have a 'Post' set of data which I know
 from my development logs that I want to feed to my production system.

 Is there some easy way to do this in the console or do I have to try to
 recreate it with wget or a web browser?


curl would be my first choice.

HTH,
Bill

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

2010-06-29 Thread doug
 Why not make your third party partners create a special HTML page and include
 an HTML comment that indicates where the content goes.  Something like...

 html
  head./head
  body
    h1My Groovy Layout/h1
    !-- CONTENT --
    divFooter Stuff/div
  /body
 /html

So, it looks like what you're proposing is more-less a re-invention of
an alternative layout facility.  Notice that if you were to replace
the '!-- CONTENT --' in your code with '%= yield(:layout) %' the
result would be a typical layout.  It's something to consider.  I was
just trying to use the existing layout facility.  I think that
approach might be a bit more robust and it might integrate better.
Thanks for the input.  As I say, it's something to consider.

... doug

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

2010-06-29 Thread doug
 Your site shouldn't be doing your
 consumers' layout work.

I don't think that it is.  What I'm trying to do is to come up with a
mechanism that will allow the consumers to do their own layout work.

  Instead, it sshould provide data that your
 consumers can lay out as they please.

That is clearly the preferred approach.  However, it is also the most
labor intensive.  I see the external layout approach as a lower
quality alternative that might be acceptable in some circumstances.
One of its big advantages is that (but for problematic issue of
reading the layout from the contents of a variable) it is extremely
easy to implement.  I just wish that there were some sort of easy work
around other than taking the brute force tact of writing the data to a
temp file and then reading it from there.

Thanks for the input.

   ... doug

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

2010-06-29 Thread Don French
Sorry about cross posting, but this is where it really belongs.

I tried to use my_class.classify and got MyClas as a result. Tried
others that ended in 'ss' and got the same results.  Tried other
endings and they work. Ruby 1.9.2-preview3 and
activesupport-3.0.0.beta4 is being used.
Is this correct? If so, why?

Tried it with my_clas.classify and got MyCla.  It seems to be
dropping the last 's'

Don French

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, 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: OAI-PMH problem with more than one parameter.

2010-06-29 Thread Max Max
Szymon Maka wrote:
 Walter McGinnis wrote:
 Yeah, wish I could be of more help, but I don't use the ActiveRecord
 wrapper with the OAI gem.  I use another one that ties directly into
 my search engine.
 
 It is very strange to me. Seem that the problem is with parsing the 
 date.
 
 NoMethodError (private method `gsub!' called for Fri Jan 01 00:00:00 UTC 
 2010:Time):
   /usr/lib/ruby/1.8/date/format.rb:1061:in `_parse'
 
 I recommend trying to contact Terry Reese (one of the gem's
 contributors).  Here's his blog, he's helped me in the past:
 
 http://people.oregonstate.edu/~reeset/blog/
 
 Ok, thanks! Will do so straight away
 
 best of all,
 Szymon

The problem here is that the parameter is not a string

Time.parse(2010-06-27 13:44:11) works
Time.parse(myDateTimeObject) throws this error

TypeError ($_ value need to be String (nil given)):
  /usr/lib/ruby/1.8/date/format.rb:1061:in `_parse'
  /usr/lib/ruby/1.8/time.rb:240:in `parse'

Make sure you do

Time.parse(myDateTimeObject.to_s)
-- 
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: Referencing a Layout

2010-06-29 Thread Marnen Laibow-Koser
Doug Jolley wrote:
 Your site shouldn't be doing your
 consumers' layout work.
 
 I don't think that it is.

Do you have a reason for this opinion, or are you just handwaving?

  What I'm trying to do is to come up with a
 mechanism that will allow the consumers to do their own layout work.
 
 �Instead, it sshould provide data that your
 consumers can lay out as they please.
 
 That is clearly the preferred approach.  However, it is also the most
 labor intensive.

No.  It is just as labor-intensive for your consumers to provide a 
layout for you as it is for them to do the layout themselves. There's 
really no advantage for them, and there's a disadvantage for you. 

  I see the external layout approach as a lower
 quality alternative that might be acceptable in some circumstances.
 One of its big advantages is that (but for problematic issue of
 reading the layout from the contents of a variable) it is extremely
 easy to implement.  I just wish that there were some sort of easy work
 around other than taking the brute force tact

tack -- tact is a different word. 

 of writing the data to a
 temp file and then reading it from there.

There is.  Stop thinking in terms of layouts and use Philip's 
approach...

...except that the whole thing is completely infeasible.  How would the 
layout be provided?  It won't fit in a GET query string, and you can't 
supply POST data in a link, so the only way to supply it would be as an 
uploaded file.  And at that point, you can just go back to Rails' layout 
mechanism. 

 
 Thanks for the input.
 
            ... doug


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

Sent from my iPhone
-- 
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: Referencing a Layout

2010-06-29 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote:
[...]
 ...except that the whole thing is completely infeasible.  How would the 
 layout be provided?  It won't fit in a GET query string, and you can't 
 supply POST data in a link, so the only way to supply it would be as an 
 uploaded file.  And at that point, you can just go back to Rails' layout 
 mechanism. 

Oh, on rereading the original post, I see that you were going to use a 
URL, which gets around that particular feasibility problem.  Looked at 
with that in mind, it seems more like an HTML version of the JSONP 
pattern.  But I still think it isn't very useful.


 
 
 Thanks for the input.
 
            ... doug
 
 
 -- 
 Marnen Laibow-Koser
 http://www.marnen.org
 mar...@marnen.org
 
 Sent from my iPhone

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