Dear Rails groups,
thank you for all the previous helps in this group, and me being a newbie is
getting more comfortable with rails and now I finish most of the scaffold
modification without much problem. My question is(I know it''s
absolutely basic questions but I''m a real outsider :~( ) I have been
developing in my own pc, now my office ''s other people will test on it,
if all other office pc is connected to a microsoft server, how does they type
the address to see mine? I have been using http:localhost:3000 in my own
machine. and I think we are use dynamic ip , what address should other people
type? or where I can figure out ip? And is there any free way (my boss
doesn''t want to spend any money...so I use RoR as a open source :D
)such that I can make people to type, for example, http://intranet or something
more simple than http://192.xxx.xxx.xxx:3000?
Another questions is since there will be more people using it, will that create
problem if people are updating at the same time even though they are doing
different thing? For example, one using is filling out his timesheet and another
project manager is signing his timesheet at the same time? If so, anyway to
prevent that?
Thand you.
rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org 写道:
Send Rails mailing list submissions to
rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.rubyonrails.org/mailman/listinfo/rails
or, via email, send a message with subject or body ''help'' to
rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
You can reach the person managing the list at
rails-owner-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Rails digest..."
Today''s Topics:
1. Re: London on Rails (Chris Korhonen)
2. Re: Everyone wants a RoR framework (M. Edward (Ed) Borasky)
3. Acts as list with STI (Fran?ois Beausoleil)
4. ActiveRecord and Threads (Ryan Daigle)
5. Re: Re: Fear of Commitment (Christopher Singley)
6. Re: global variables (Fran?ois Beausoleil)
7. Re: London on Rails (Matthew Denner)
8. Suggestions for new view renderer - CodePieces (Jan Moli?)
9. different session cookies in app (G?bor SEBESTY?N)
10. Double Render Error: Reason? (Vamsee Kanakala)
----------------------------------------------------------------------
Message: 1
Date: Thu, 25 Aug 2005 15:29:20 +0100
From: Chris Korhonen
Subject: Re: [Rails] London on Rails
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID:
Content-Type: text/plain; charset=ISO-8859-1
Two of us Brighton Rails/AJAX folk posisbly up for it, let us know the details!
On 8/25/05, Nicholas H.Tollervey wrote:> OK, I''m in also depending on schedule.
>
> David Plans Casal wrote:
>
> >
> > On 24 Aug 2005, at 23:25, Dom wrote:
> >
> >> Nicholas H.Tollervey wrote:
> >>
> >>> Given, say at least five people, a trip to China town for
noodles on
> >>> rails would be fun.
> >>>
> >> Sounds good, I''ll come. Circumstances permitting of
course.
> >
> >
> > Same here, depending on schedule.
> >
> > Are we talking the Friday or Saturday? Joshua?
> >
> > David
> >
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
------------------------------
Message: 2
Date: Thu, 25 Aug 2005 07:33:24 -0700
From: "M. Edward (Ed) Borasky"
Subject: Re: [Rails] Everyone wants a RoR framework
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID: <430DD6B4.5010807-2WxwdZd67h7R7s880joybQ@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Actually, I have needs for something resembling "R on Rollerskates".
That is, either a full-scale web application framework like Ruby on
Rails implemented in the R language rather than in Ruby, or some way of
running R subservient to Ruby on Rails.
Taking the first approach, is there anything special in the *semantics*
of Ruby that made/makes Rails easier to do in Ruby than it would in
Perl, Python, PHP, Tcl/Tk or any other "modern scripting language"? R
has everything a "modern scripting language" has. R does have an
object
system, although it''s quite different from most others. R can be
extended with C, C++, and, given its scientific nature, also with
Fortran! R has its own package management system, R has interface code
for most common databases, R has libraries that can handle
Perl-compatible regular expressions, CGI, HTML and XML, etc. R is open
source.
The one hitch in this is that R for Linux/UNIX/BSD/XWindows and R for
Microsoft Windows are two quite different implementations, constructed
and maintained using completely different tool sets, having completely
different user interfaces, etc. There is a common semantic core between
the two, of course, and one can build R as a DLL on Windows and a shared
library on Linux. So making a Windows version of R on Rollerskates can
probably be done, though it isn''t something I''d want to spend
*any* time on.
The second approach looks far easier. In any event, where I''m going
with
all of this is that R contains intensely advanced statistical capability
(can you say "data mining on steroids"?) that I have no desire or
intention to re-implement in Ruby.
M. Edward (Ed) Borasky wrote:
> R on Rollerskates?
>
>
--
M. Edward (Ed) Borasky
http://www.borasky-research.net/
http://borasky-research.blogspot.com/
http://pdxneurosemantics.com
http://pdx-sales-coach.com
http://algocompsynth.com
------------------------------
Message: 3
Date: Thu, 25 Aug 2005 10:39:34 -0400
From: Fran?ois Beausoleil
Subject: [Rails] Acts as list with STI
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID: <430DD826.3050203-IQIa899fVSs@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi !
I have the following:
class Estimate
has_many :items, :class_name => ''EstimateLine'', :order
=> ''position''
end
class EstimateLine < ActiveRecord::Base
belongs_to :estimate
acts_as_list :scope => :estimate
end
class EstimateProductLine < EstimateLine
end
class EstimateCommentLine < EstimateLine
end
When I try to insert a comment and a product, I get an invalid SQL
statement:
ActiveRecord::StatementInvalid: #23000
Duplicate entry ''9252-1'' for key 2: INSERT INTO estimate_lines
(`estimate_id`, `product_id`, `quantity`, `type`, `comment`, `position`)
VALUES(9252, 104, 1, ''EstimateProductLine'', NULL, 1)
If I look at my table, I can see the comment, at position 1. Notice
ActiveRecord is trying to insert at position 1 again. If I check the
log, I can see where Rails is searching for the bottom element to
increment the position column:
EstimateCommentLine Load (0.000000) SELECT * FROM estimate_lines WHERE
estimate_id AND (estimate_lines.type = ''EstimateCommentLine'' )
ORDER BY
position DESC LIMIT 1
SQL (0.000000) INSERT INTO estimate_lines (`estimate_id`, `product_id`,
`quantity`, `type`, `comment`, `position`) VALUES(9226, NULL, 0,
''EstimateCommentLine'', ''Ropelight
Sculptures'', 1)
EstimateProductLine Load (0.000000) SELECT * FROM estimate_lines WHERE
estimate_id AND (estimate_lines.type = ''EstimateProductLine'' )
ORDER BY
position DESC LIMIT 1
You can see where EstimateCommentLine Load and EstimateProductLine Load
are done, ActiveRecord ensures the type is the same as the current
class, and not the class where the acts was defined... So I tried
changing my scope to:
''estimate_id = #{self.estimate_id} AND type =
\''EstimateLine\''''
But that doesn''t help, as ActiveRecord now tries to find type =
''EstimateLine'' AND type =
''EstimateProductLine'', which always returns 0...
So, how do I get myself out of this bind ? Should I just fold
everything up into a single class, or should I patch my ActiveRecord to
correct this problem ?
Thanks !
Fran鏾is
------------------------------
Message: 4
Date: Thu, 25 Aug 2005 07:40:40 -0700 (PDT)
From: Ryan Daigle
Subject: [Rails] ActiveRecord and Threads
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID:
<20050825144040.13040.qmail-VMAXsN/egqeA/QwVtaZbd3CJp6faPEW9@public.gmane.org>
Content-Type: text/plain; charset=iso-8859-1
I''m having an issue where code that works in a single threaded model is
throwing a wierd exception when I spawn my own thread. Here is the code in
question:
relationship = Relationship.new(:src_entity => @entity,
:created_by => @entity.created_by,
:target_entity => target_entity,
:relationship_type => rel_type)
And the error that is thrown is this:
/usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations/association_proxy.rb:93:in
`raise_on_type_mismatch'': Entity expected, got Entity
(ActiveRecord::AssociationTypeMismatch)
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations/belongs_to_association.rb:25:in
`replace''
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations.rb:628:in
`src_entity=''
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations.rb:621:in
`src_entity=''
As you can see, it expects a class of type "Entity", and it has a
class of type
"Entity" - so I don''t know what the problem is.
Again, this only occurs when I spawn a new thread like so:
indexer = EntityIndexer.new(entity)
Thread.abort_on_exception = true
Thread.new(indexer) do | entity_indexer |
entity_indexer.index
end
The "entity" argument that''s passed into the new is
what''s available in the
above code snippet as "@entity".
def initialize(entity)
@entity = entity
end
Can anybody point me in the right direction, I''ve been banging my head
on this
for hours and don''t know enough about ActiveRecord or Ruby threading to
intelligently troubleshoot this.
Any help would be much appreciated.
-Ryan
------------------------------
Message: 5
Date: Thu, 25 Aug 2005 09:43:12 -0500
From: "Christopher Singley"
Subject: Re: [Rails] Re: Fear of Commitment
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID:
Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8
Thanks again for helping.
In config/database.yml, I set ''adapter: mysql''. I have no idea
why Rails
is spitting out
error messages about committing my data, since the table in question is a
MyISAM table.
What can I do to troubleshoot this problem? I am baffled.
I''m sure there''s something obvious that I''m
overlooking...
TIA
On Thu, 25 Aug 2005 01:08:33 -0500, Mark Reginald James
wrote:
> You say you''re trying to commit transactions, but they''re
only
> supported for InnoDB tables, not MyISAM tables.
------------------------------
Message: 6
Date: Thu, 25 Aug 2005 10:46:13 -0400
From: Fran?ois Beausoleil
Subject: Re: [Rails] global variables
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID: <430DD9B5.2000309-IQIa899fVSs@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hello Adam,
Adam Denenberg said the following on 2005-08-25 10:22:> I have an array that I want accessible to all controllers/views that
> looks like this:
What you need is to really define a constant, like this:
AdminTypes = %w(locations clusters computers).freeze
Then, in your views and controllers, you can refer to this top-level
constant as AdminTypes.
The way you were doing it was defining an instance variable in the top
level execution context, which is an object, but is not the same object
as when your controller is executing.
Hope that helps !
Fran鏾is
------------------------------
Message: 7
Date: Thu, 25 Aug 2005 15:52:53 +0100
From: Matthew Denner
Subject: Re: [Rails] London on Rails
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID:
<430DDB45.6090803-rdkfGonbjUS6Ep1eQ8kGe/TXAc8U3UkmXqFh9Ls21Oc@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Chris Korhonen wrote:> Two of us Brighton Rails/AJAX folk posisbly up for it, let us know the
details!
I might be able to do it too.
And I''m in Brighton as well so if there''s a few people down
here I''d
like to meet up sometime.
Matt
------------------------------
Message: 8
Date: Thu, 25 Aug 2005 17:01:23 +0200
From: Jan Moli?
Subject: [Rails] Suggestions for new view renderer - CodePieces
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID:
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-2
Hello,
I have a suggestion for a new view renderrer.
Why? Because there are people for whom DRB is not the easiest way_of_doing %>
I don''t think DRB renderrer is bad; just for me with 5 dioptries is
less
readable :-)
Moreover:
You usually get a code with a css, not 100% what you expected. You''re
absolutely not able to
use rxml which, of course, would be nice. So you do your work somehow and
when you''re almost
done, your boss say: Client doesn''t want this, he wants that. This is
repeating
and after that the code becomes full of hacks (because the project MUST
be done as soon as possible, which today means till tomorrow (and
recursively :->) ).
My solution is "CodePieces".
The view consists of two files: One file is a driver script written in
ruby and the second contains pieces of (html) code
in yaml file. Pros?
a) Because the driver script contains view-logic and the YAML file is a
code "repository" only,
you don''t need to rewrite whole template anymore. Just replace the
yaml file and let the
driver script untouched. Moreover the driver script is reusable.
(I make a difference between application logic and view logic,
controller does the application logic,
view logic are foreachs and ifs)
b) YAML file can do only two types of calls: recursive call to another
piece of code or
helper call and is not chatty as DRB.
d) You don''t need many partials files, the yaml file consists all
partials.
e) Every html coder can easily edit yaml file and understands it.
f) It''s simple and powerful. (You can see at http://eeasy.1984.cz what
I think of XML GML TML BML stuff :-> )
The best way how to explain my ideas are examples. This is the way how it
should work,
today I do it using regular expressions which is limitting. I''m going
to
write a real parser
and store parsed templates in a cache (it should be as fast as DRB or
faster).
But I want to read your opinions first. What do you think about it?
jan molic
1. Example - minimum. Usually used at the beginning when you want to create
"working" prototype of a site.
----------- YAML -------------
body: |
This is body.
----------- RUBY -------------
show( ''body'' )
2. Example - using bracket tags. Bracket tags are usually used for
printing values which are passed through the driver script.
No, there''s no way how to print view object''s variables
directly ( i.e.
{ @var } ). You can use helper call instead (see below).
----------- YAML -------------
message:
Name: { name }, Date: { date }
{ text }
list-item:
{ text }
body: |
{ list-items }
{ messages }
----------- RUBY -------------
hsh = {}
hsh[''messages''] = get_each( ''message'',
@messages )
hsh[''list-items''] = get_each( ''list-item'',
@list )
show( ''body'', hsh )
3. Example - simple helper calls. You can use simple (simple!) helper call
inside brackets.
You aren''t expected to use many helpers in yaml files, but there are
some
cases when passing
all values through driver script wouldn''t be comfortable - for instance
passing all localized
strings or URLs. You can use helper call to get view object''s variable
directly
but it''s not recommended. The syntax is " { helper: argument list
} ".
----------- YAML -------------
message:
{ loc: name }: { name }
{ loc: date }: { date }
{ loc: listing }
This variable is passed directly from the view object: { var:
@text }
4. Example - brackets inside brackets. In this example
we pass only ''actual_page'' variable from the driver script.
Body class
will be set depending on it automatically.
----------- YAML -------------
# define classes of body tags
body_class-homepage: normal
body_class-news: normal
body_class-services: threecols
body:
This is body.
----------- RUBY -------------
show( ''body'', { ''actual_page'' =>
@actual_page } )
5. Example - pieces of code recursive calls.
In daily use: This is really powerful.
----------- YAML -------------
item:
{ text }
# define default list styles
list-style-1: { items }
list-style-2:
{ items }
# define list styles for pages
list-style-homepage: { list-style-1 }
list-style-news: { list-style-2 }
list-style-services: { list-style-2 }
list-style-products: { list-style-2 }
body:
{ list-style-{ actual_page } }
----------- RUBY -------------
hsh = {}
hsh[''items''] = get_each( ''item'', @list_items
)
hsh[''actual_page''] = @actual_page
show( ''body'', hsh )
6. Example - using yaml not only as string repository.
Sometimes variables are not connected to controller
but only to a view and therefore should be placed in view.
For example menu items order.
----------- YAML -------------
# define the order of items in the menu
menu-items:
- it: homepage
- it: services
- it: news
menu-item:
{ it }
menu:
{ menu-items }
body:
{ menu }
----------- RUBY -------------
items = get( ''menu-items'' )
menu_items = get_each( ''menu-item'', items )
render( ''body'', { ''menu'' => get(
''menu'', menu_items ) } )
------------------------------
Message: 9
Date: Thu, 25 Aug 2005 17:09:06 +0200
From: G?bor SEBESTY?N
Subject: [Rails] different session cookies in app
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID:
<89806C8B-5B9E-46A7-8E59-57E638AB28A7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed
I have a webapp with its own admin interface. One app with two entry
points. Is it possible to use other session cookie name for admin
interface or I should split it to two apps?
G醔or
------------------------------
Message: 10
Date: Thu, 25 Aug 2005 20:43:36 +0530
From: Vamsee Kanakala
Subject: [Rails] Double Render Error: Reason?
To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Message-ID: <430DE020.3020103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi all,
I''m trying to follow the Rails book, and I''m the testing
chapter.
I was trying to run the code in the page 149 and a DoubleRenderError
shows up at the ''get'' line in the following code:
def test_index
get :index
assert_response :success
end
I''ve read about DoubleRenderError, but they talk about
redirect_to, but not about get method. How can I solve this?
TIA,
Vamsee.
------------------------------
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
End of Rails Digest, Vol 11, Issue 336
**************************************
---------------------------------
DO YOU YAHOO!?
雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails