On Mon, Sep 29, 2008 at 6:45 AM, Tim K. <[EMAIL PROTECTED]> wrote:
> So I'm using nested routes for a users model that has measurements and
> journals... like this:
>
> map.resources :users do |users|
> users.resources :journals
> users.resources :measurements
> end
>
> This of course builds ro
Can anyone recommend any book for Rails 2.0?
I have read "Agile Web Development with Rails - 1st" and i loved this
book.
I wonder if there is any good guidance for Rails 2.0.
Thank you!
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received
Ramon - Fetching the current_user in the Journals controller doesn't
solve the issue, unless I'm misunderstanding you. The current_user is
set to in instance variable called @user so @user.id would be equal
to :user_id within the route. When I call @journals I'm using the
relationship to grab the
I'm using the normal Substruct authorization methods: each subdomain not
only load the appropriate database (and every admin has his own password for
his db), but alsocreate a different session and things stay clean and work
(so far)!
On Mon, Sep 22, 2008 at 11:38 PM, Ayyanar Aswathaman <
[EMAIL P
puts Time.year.now-40
puts Time.year.now-80
it is another solution if u dont want upgrade your rails.
Y Reinhart AP
Teapoci.Blogspot.com
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
I've never done this but I'll give my 2 cents anyway:
1) With nested routes, you are always still looking for the user - you
fetch it in the Journals controller and that's where you can evaluate
it. What you can do is fetch the current_user unless the current_user
is an admin or whatever
2) Abou
<%= contact.calendar_date_select :birth_date, {:size => 10,
:label => 'Birthday',:year_range => Time.now.year-65..Time.now.year} %>
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
So I'm using nested routes for a users model that has measurements and
journals... like this:
map.resources :users do |users|
users.resources :journals
users.resources :measurements
end
This of course builds routes as something like:
/user/:user_id/journals/:id
/user/:user_id/measurements/:
I'm sorry if I misunderstood the purpose of your plugins then. I've come
across your site several times before through Google searches (on RoR
and SaaS) and from the descriptions, the focus seemed really on the
billing aspect.
That being said, I don't buy the "common sense" argument when desi
Hey everyone.
Is there an FTP gem/plugin that allows you to browse and manipulate an
FTP account just like AWS-S3 does with Amazon's S3 buckets?
Thanks,
Ramon Tayag
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "R
Thank you very much. 100% what I needed. So, session[:member] = nil
kills the session each time name action is processed.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Phillip Koebbe wrote:
> One way, though maybe not the best depending on your needs, is to send
> an email to [EMAIL PROTECTED], such as [EMAIL PROTECTED]
>
> Peace.
is it iphone ([EMAIL PROTECTED])? or
is it for ordinary cell phone ?
--
Posted via http://www.ruby-forum.com/.
--~--~-~-
Phillip , my inventory_controller.rb:
class InventoryController < ApplicationController
def index
@albums=Album.find(:all)
@cart=find_cart
end
def add_to_cart
itemType=params[:itemType]
productId=(params[:id]) #parameter passed in from "add to
cart" s
Is it of any concern that more and more take up the JQuery banner? Why
didn't they pick Prototype and Scriptaculous? Seems like we jumped on
the REST bandwagon pretty quick but we hold to P&S in face of its ever
growing popularity and adoption. Is Rails leadership tied to P&S on a
more emotional l
Dan Manges wrote:
> def subscriber_salaries
> subscribers.map(&:salary).sum
> end
That's inefficient. If you measure your application and find it will cause a
bottleneck, you must put the sum, and the addition, on the database side. That
crunches the numbers while they are much closer
Now of course I'm having trouble with the default fields in edit. I've
changed edit.html.erb so that editing an existing claim works.
Here's my edit.html.erb
Edit Claim's Information
<%= "Enter claim number #{h(@claim.claim_number)}'s information." %>
<% form_for :claim, :url => claim_path(p
Hi Dave,
You can use methods from the Enumerable module to get a list of
salaries and calculate the sum. Try something like this:
def subscriber_salaries
subscribers.map(&:salary).sum
end
That will loop over each subscriber, build an array of the salaries,
and then calculate the sum. I
All,
I put the before_filter in my inventory_controller and it worked...didn't
see that it doesn't belong in the Cart.rb file. Thanks for the help!
Cheers
Jon
On Sun, Sep 28, 2008 at 4:03 PM, Jon Liu <[EMAIL PROTECTED]> wrote:
> Heinbull,
>
> I tried to use the before_filter in my Cart Model.
Heinbull,
I tried to use the before_filter in my Cart Model...mind you it's not an
actual sql table, it's just a class I created. From looking at reference
tools it looks like before_filter is usually used for actualy table
models but I tried it any way and I got the error "undefined method
b
Phlip wrote:
> dschruth wrote:
>
>> What if salary is not really a column in the database?
>>
>> What if it's a variable which is just a function of two other database
>> columns?
>
>Subscriber.calculate( :sum, :salary,
> :select => 'compensation + perks AS salary',
Hey Rails devs,
We're in Slovenia (southern Europe) and sometimes we get very slow
speeds when pulling from the official Rails repository (GitHub). Speed
can drop down to under 20 KiB/s, and the top I've seen is around 300.
I've created a mirror on repo.or.cz from which we get a constant ~450
Ki
dschruth wrote:
> What if salary is not really a column in the database?
>
> What if it's a variable which is just a function of two other database
> columns?
Subscriber.calculate( :sum, :salary,
:select => 'compensation + perks AS salary',
:cond
On Sun, Sep 28, 2008 at 5:01 AM, SpringFlowers AutumnMoon
<[EMAIL PROTECTED]> wrote:
> it seems that there is no parameter for the function h() (html_escape())
> to indicate the character encoding being used?
>
> for PHP, its htmlspecialchars() function has a dozen encoding possible,
> such as UT
Hey Dan,
Got another question about this.
What if salary is not really a column in the database?
What if it's a variable which is just a function of two other database
columns?
For example what if 'salary' is a variable defined in the Magazine
object but it's either 'gross_income' or 'gross_pa
>From experience I would use a before_filter to load the cart for you
controller...
Something like:
before_filter :initialize_cart
private
def initialize_cart
if session[:cart_id]
@cart = Cart.find(session[:cart_id])
else
@cart = Cart.create
session[:cart_id] = @c
I have a credentials_controller and Credential model. The Credential
model is an STI structure with a number of classes inheriting it. For
example:
class CredWebsite1 < Credential
When I try to do the index command in the credentials controller, it
gives the error undefined method
--
Remember to attach :html => { :multipart => true } to your form_for
declaration for both the new.html.erb and edit.html/erb
On Sep 7, 1:14 am, bingo bob <[EMAIL PROTECTED]> wrote:
> Paperclipis nice but its not working on theupdateaction.
>
> Well, to be exact, I can attach new picture records vi
Oh well. I just love those programming mistakes that make one appear
like a total n00b because they are so basic one doesn't even stop to
think about their possibility of occurring.
Thanks Fred, it's working now :-)
/ Vahagn
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~-
On Sep 28, 10:31 am, dlc <[EMAIL PROTECTED]> wrote:
> Hi
>
> I am starting to work with rails and like to build a very basic cms.
>
> I was using scaffolding.
> Page title:string permalink:string body:text.
>
> What I like to do is create a menu out of the database entries
> permalink.
> Those s
On 26 Wrz, 01:00, Hubert Łępicki <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Can you access any other sites using http from within your
> controllers?
yes, I can so it is not rails problem, thank you - i will examine
remote server why it is not responding to every request
> I see you are using Window
Thank you for replies.
> Have you looked at what #{ARGV} evaluates to?
> would ARGV.join(" ") help?
Yes, this works well with a call like:
system (or sh) ("'rails' #{ARGV.join(' ')}")
but not with:
`"'rails' #{ARGV.join(' ')}"`
sh: 'rails' prova -d mysql: not found
I tried different forms
You can use http://www.rubular.com/ to test and find the regex you
need.
On Sep 28, 2:08 pm, MarcRic <[EMAIL PROTECTED]> wrote:
> Hi Abhishek,
>
> Take a look on this article:
>
> http://marcricblog.blogspot.com/2008/08/bitwising-ruby.html
>
> More specifically, the last example.
>
> On that cas
Hi
I am starting to work with rails and like to build a very basic cms.
I was using scaffolding.
Page title:string permalink:string body:text.
What I like to do is create a menu out of the database entries
permalink.
Those should link to the fitting pages.
So i modified my index.html.erb from
Both suggestions did exactly what you said. 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 ruby
Thank you very much Frederick,
this has opened my eyes. Then, my mistake was to believe that I need ""
for interpolation in ``.
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
I just wanted to answer that, but you posted it faster than me
hehehehe :D
--
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 grou
Ok, i solved it :)
i have to use:
link_to_remote 'update', :update...
and in the action simple:
render :partial...
greetings :)
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Googl
On Sep 28, 4:20 pm, Max Dev <[EMAIL PROTECTED]> wrote:
> Thank you for replies.
>
> > Have you looked at what #{ARGV} evaluates to?
> > would ARGV.join(" ") help?
>
> Yes, this works well with a call like:
>
> system (or sh) ("'rails' #{ARGV.join(' ')}")
>
> but not with:
>
> `"'rails' #{ARGV.jo
---
OR ANOTHER OPTION
---
1.
2.def update
3. @score = Score.find(params[:id])
4. respond_to do |format|
5.if @score.update_attributes(params[:score])
6. flash[:notice] = 'Score was successfully updated.'
7. format.html{redire
You are in not rule of your routes.rb, because the error said that cant
process ID=10
I suggest you do it :
1.
2.def update
3. @score = Score.find(params[:id])
4. respond_to do |format|
5.if @score.update_attributes(params[:score])
6. flash[:notice] = 'Score was su
Hi Abhishek,
Take a look on this article:
http://marcricblog.blogspot.com/2008/08/bitwising-ruby.html
More specifically, the last example.
On that case I just consider words. You will need to adapt it to your
needs.
Regards.
On Sep 27, 11:05 am, "Abhishek shukla" <[EMAIL PROTECTED]> wrote:
>
Hey,guys
I wanna matrix test with rspec but rspec_matrix isn't available
So,helpme,3Q
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk
On 28 Sep 2008, at 13:30, Vahagn Hayrapetyan wrote:
>
>
> The problem is that the user.recently_reset? in the Observer returns
> nil.
>
> When I test def recently_reset? interactively in the console (testing
> the User model), it works as intended. So the user model works
> correctly
> and the
Hello,-
does anyone have a good idea of how to trace a fault in the following:
I have a User model (user.rb) with these methods:
def create_reset_code
code = User.get_random_string(10) #working class method
self.password_reset_code = code
self.save(false)
@reset = true
#Noti
Hey all,
i simple try to update a partial in my index file.
(it contains two partials, and i want to update one of them)
But when i use, render :partial => it shows the partial but without
the rest of the layout (navigation / footer...)
if i use page[...].replace_html, it shows me the AJAX
IF IT IS STILL IN 1 DIRECT PROCESS, YOU CAN DO IT :
def member
@member = params[:member] || ''
member = @member
name
end
def name
name_id = @member
end
IF IT IS STILL IN DIFFENRENT PROCESS, YOU CAN DO IT :
def member
@member = params[:member] || ''
member = @member
How can I pass @member varible from def member to def name and insert it
into name_id? These methods are in the same controller.
def member
@member = params[:member] || ''
member = @member
end
def name
name_id = @member
end
--
Posted via http://www.ruby-forum.com/.
--~--~-~
Hello,
I am trying to expire fragments (or at least trigger their expiration)
from a daemon that's running in the background.
The daemon is updating all kinds of important lists every few minutes
from the background.
So I have to find some way to DO or TRIGGER the fragment caching from
this dae
I haven't played around with it myself, but this might be a place to
start:
http://activewarehouse.rubyforge.org/rails_sql_views/
mfairchi wrote:
> Hello,
> I have a legacy database in sqlserver 2005 that I am not allowed to
> change. I have tried using a view, as I have read it works for
> o
On Sep 28, 6:39 am, Max Baroi <[EMAIL PROTECTED]>
wrote:
> So patient_number is an attribute of the patient that owns the claim,
> not an attribute of the claim itself.
I think it's your use of the :index option that is giving you the
current output instead of the second variant. For the third
would ARGV.join(" ") help?
Ruby is using to_s behind the scenes. Calling to_s on an array returns
the values concatenated together in a string
>> [1,2,3].to_s
=> "123"
On Sep 27, 9:35 pm, Max Dev <[EMAIL PROTECTED]> wrote:
> I have a script with which I want to create a rails app.
>
> Then not
On Sat, Sep 27, 2008 at 9:18 PM, Ryan Bigg <[EMAIL PROTECTED]> wrote:
>
> I don't think Rails supports UTF8 yet... but I could be wrong.
The default charset for action renderings is UTF-8 since Rails 1.2.
-Conrad
--~--~-~--~~~---~--~~
You received this message b
On 28 Sep 2008, at 05:18, Ryan Bigg <[EMAIL PROTECTED]> wrote:
>
> I don't think Rails supports UTF8 yet... but I could be wrong.
Actually it should handle utf-8 just fine. Rails 1.2 added a whole
bunch of stuff to augment ruby's somewhat lackluster support. What
does h do to utf-8 string
On 28 Sep 2008, at 02:35, Max Dev <[EMAIL PROTECTED]>
wrote:
>
> I have a script with which I want to create a rails app.
>
> Then not something like:
>
> $ rails -d mysql name_app
>
> in terminal, but from the script.
>
> In the script I get the app name, database etc.
> After some operation
54 matches
Mail list logo