Super explanation and thank you very much
On Jan 3, 8:46 pm, Rick DeNatale wrote:
> On Sun, Jan 3, 2010 at 4:27 AM, acreadinglist wrote:
> > Can someone clarify what type of object is returned from a find
> > (:select => ...) statement that only selects a subset of the records
> > columns?
>
> >
I recently had to do some work populating a model from complex virtual
attributes. However, I also wanted to be able to leverage the
validations framework to be able to add descriptions of errors that
existed in virtual attribute values. I'm wondering how to avoid
duplication between the code that
This is not a real app. so stuff your perversion and top posting.
I got this from RailsCasts
http://railscasts.com/episodes/35-custom-rest-actions
On Jan 3, 1:07 pm, Marnen Laibow-Koser wrote:
> Ron Green wrote:
> > The correct answer is:
>
> > map.resources :pages, :collection => {:home => :get,
Ooh_Gravy wrote:
> So answering my own question, is this ok or is there a cleaner way to
> do it?
>
>
> <% index = 1 %>
> <% @recipe.steps.each do |step| %>
> <%= index %>: <%= step.step %>
> <% index += 1 %>
> <% end %>
>
>
> Thanks a lot.
You can use the OL (orde
Same backtrace without line breaks (hopefully):
---
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:417:in
`load_missing_constant'
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing'
On Jan 3, 5:33 pm, Matt Jones wrote:
>
> Historically, models in subfolders have caused problems, but they
> should work now. Can you post a complete stack trace for either of
> these errors?
>
> --Matt Jones
Hi Matt,
here's the full backtrace:
/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/a
maybe it is expecting this??
{:review => {:site_id => 10005}}
On Sun, Jan 3, 2010 at 6:45 PM, Vincent P wrote:
> I have a RESTful :new method to present a form. I have implemented
> this new method to use a params value params[:site_id]. For example,
> the URL to this form would b
I have a RESTful :new method to present a form. I have implemented
this new method to use a params value params[:site_id]. For example,
the URL to this form would be : http://localhost:3000/reviews/new?site_id=1005
Now I need to test this new method. How do I put in the params value
in the test?
I finally figured out that I need to pass these things through
params.
Thanks.
On Dec 31 2009, 11:48 am, "Easebus" wrote:
> Thanks Robert. Unfortunately, I already implemented the site model not
> using REST and the review model as REST but standing alone not belonging to
> another REST model.
Ahh
Jason - Thank you - If i understand your problem in correctly - you
wanted to turn the value into the database into a non-zipcode format
to allow for people to search without including the leading zero?
Also - thank you for the information about zero being a leading diget
for zip codes.
On
Leonardo Mateo wrote:
> On Sun, Jan 3, 2010 at 4:10 PM, steve wrote:
>> Does any one know how to setup SQLserver with ruby1.9. �It was working
>> on an earlier version and now nothing works! �I have installed the
>> gems dbi ,dbd-odbc and activerecord-odbc-adapter and can connect in
>> straight Ru
On Jan 2, 8:21 pm, Corin wrote:
> Hi all,
>
> I'm using the latest rails 2.3.5 and put some models in subfolders like
> this:
>
> models/my/details/texts.rb
> models/my/details/attributes.rb
> ...
>
> The models themselves are defined like this:
>
> class My::Details::Texts < ActiveRecord::Base
I ended up solving the problem using Philip's solution (thanks).
Curtis, thanks for the recommendation, but zero is a valid leading value for
some zip codes, so only doing a range of 1-9 wouldn't be as tight of a check
as I would've liked.
Thank you all for your help and replies.
---
Jason Soo
"I
be more explicit in your reg exp
ie the first numeric must be [1-9]
On Sun, Jan 3, 2010 at 1:36 PM, Jason Soo wrote:
> Regex fails on validation even.
> Plus just saying reg exp is not very helpful. I'm not sure how to trap the
> call before it reaching sql (assuming that is the best way to do
Sry for the trick but i had to do it.
I just wanna wish everybody that takes a little or more of their time
to help out, a noob or an expert, but especially the first ones, Happy
New Year and NOTHING BUT THE BEST IN THE NEW YEAR.I really appreciate
all the help i get from this wonderful and giving
On Jan 3, 2010, at 12:02 PM, jsoo wrote:
> Hey
>
> I'm running into an small issue with searching a zip codes table,
> where some zip codes contain 1 or more leading zeros. This problem
> could be fixed with some database level hacking -- but I'd rather
> attack the problem in rails.
>
> Zip cod
Regex fails on validation even.
Plus just saying reg exp is not very helpful. I'm not sure how to trap the
call before it reaching sql (assuming that is the best way to do it) which
is really what I'm trying to figure out.
Sidebar:
validates_format_of :zip_code, :with => /\A[0-9]{5}\Z/i,
fai
reg exp
On Sun, Jan 3, 2010 at 3:02 PM, jsoo wrote:
> Hey
>
> I'm running into an small issue with searching a zip codes table,
> where some zip codes contain 1 or more leading zeros. This problem
> could be fixed with some database level hacking -- but I'd rather
> attack the problem in rails.
Hey
I'm running into an small issue with searching a zip codes table,
where some zip codes contain 1 or more leading zeros. This problem
could be fixed with some database level hacking -- but I'd rather
attack the problem in rails.
Zip codes are stored in the zip code table with leading zeros dr
I just can't seem to figure this out. I can do this no problem using
each_with_index and iterating through an array set up in the
controller's "New." But that only allows me to finite number of
records. I'd like for the user to be able to dynamically pick the
number records just by clicking "Add
On Sun, Jan 3, 2010 at 4:10 PM, steve wrote:
> Does any one know how to setup SQLserver with ruby1.9. It was working
> on an earlier version and now nothing works! I have installed the
> gems dbi ,dbd-odbc and activerecord-odbc-adapter and can connect in
> straight Ruby. However, using rails wi
I am new and looking for some documentation about the OS evironment
(variables) set and used by Ruby, Gems, and Rails. I want to understand
how to configure and troubleshoot installations and integrations with
other services HTTPD, SQL etc..
What Paths are required?
What other environment variabl
Franco Sellitto wrote:
> Hi
>
> The ROR 2.0.2 templates have now the .html.erb extension (the .rhtml is
> the old one).
> In order to solve your problem you have two solutions:
>
> a) modify the generator script directly on your gem directory (not
> recommended)
>
> or
>
> b) copy your genera
Forgive this mis targeted email, I didn't know where else to send it
to be truthful. I am building an application using Ruby on Rails, I
need to know what SMS based service Highrise is using or something
similar. Anyone have experience sending sms messages from Rails? I
would love a link to a good
Does any one know how to setup SQLserver with ruby1.9. It was working
on an earlier version and now nothing works! I have installed the
gems dbi ,dbd-odbc and activerecord-odbc-adapter and can connect in
straight Ruby. However, using rails with database.yml nothing works!
I hosed everything and
Ron Green wrote:
> The correct answer is:
>
> map.resources :pages, :collection => {:home => :get, :about
> => :get, :contact => :get }
>
> and then the link_to becomes:
>
> <%= link_to 'About', about_pages_path%>
This is a bit of a perversion of map.resources. You probably want to
just consi
The correct answer is:
map.resources :pages, :collection => {:home => :get, :about
=> :get, :contact => :get }
and then the link_to becomes:
<%= link_to 'About', about_pages_path%>
On Jan 2, 9:41 pm, Thais Camilo wrote:
> And how about your Page Controller, did you change it to About Controlle
You would want each_with_index.
<% @recipie.steps.each do |step, index| %>
<%= index %>: <%= step.step %>
<% end %>
A little cleaner, and handles updating the index for you.
-Steve
On Sun, Jan 3, 2010 at 12:47 PM, Ooh_Gravy wrote:
> So answering my own question, is this ok or i
On Jan 3, 5:14 pm, jm wrote:
> Post Load (0.4ms) SELECT * FROM "posts" INNER JOIN "posts_tags" ON
> "posts".id = "posts_tags".post_id WHERE ("posts_tags".tag_id = 1 ) AND
> (("posts"."published" = 't') AND ("posts_tags".tag_id = 1 )) ORDER BY
> posts.created_at DESC
This is probably the que
On Jan 3, 5:39 pm, RubyonRails_newbie
wrote:
> Yes - it's installed:
> already installed: acts_as_ferret (svn://projects.jkraemer.net/
> acts_as_ferret/tags/stable/acts_as_ferret). pass --force to reinstall
>
> When I tried to start it:
> script/ferret_server -e production start
>
> the server
So answering my own question, is this ok or is there a cleaner way to
do it?
<% index = 1 %>
<% @recipe.steps.each do |step| %>
<%= index %>: <%= step.step %>
<% index += 1 %>
<% end %>
Yes - it's installed:
already installed: acts_as_ferret (svn://projects.jkraemer.net/
acts_as_ferret/tags/stable/acts_as_ferret). pass --force to reinstall
When I tried to start it:
script/ferret_server -e production start
the server returned: -bash: script/ferret_server: Permission denied
Hmmm
2010/1/3 RubyonRails_newbie :
> Hi there,
>
> after recently deploying my app, I have noticed that the search
> results are not being displayed...
>
> When I look in my app, I also notice that the apps content (search
> criterea) is not being indexed, so I dont have an index folder being
> created.
Bit more info -
looking at the ferret log file it says this:
[user] DRb connection error: druby://localhost:9010 -
#
this tells me i've not configured something, but i'm still unsure how
to resolve this...
Any help appreciated...
Thanks again
On 3 Jan, 17:09, RubyonRails_newbie
wrote:
> Hi t
Thanks for the replies. Unfortunately, neither of the solutions
worked. I tried each on their own with no luck, and then I combined
the two suggestions and still no luck. Here is what I have for the
named scope in my Post model as of now:
named_scope :recently_published, :conditions => { :publish
OK, thanks. What I wanted to do was this:
<% @recipe.steps.each do |step| %>
<%= step.id %>: <%= step.step %>
<% end %>
but that would now result in:
* 1: This is the first step
* 3: This is the second step
So I now ne
Hi there,
after recently deploying my app, I have noticed that the search
results are not being displayed...
When I look in my app, I also notice that the apps content (search
criterea) is not being indexed, so I dont have an index folder being
created.
I read on a google post that it may be tha
On Jan 3, 4:37 pm, radu puspana wrote:
> user.each do |correct_user|
> expected_password = User.encrypted_password(password, correct_user.salt)
> if correct_user.hashed_password == expected_password
> idx = user.index(correct_user)
>return user[idx]
> end
> end
This is
problem solved!!! thx to me :)
On Jan 3, 6:37 pm, radu puspana wrote:
> First, A Happy New Year to you all
> Second :
>
> this is my login action form the admin controller:
> def login
> if request.post?
> user = User.authenticate(params[:name], params[:password])
> if user
>
First, A Happy New Year to you all
Second :
this is my login action form the admin controller:
def login
if request.post?
user = User.authenticate(params[:name], params[:password])
if user
if user.banned_status == "true"
flash.now[:notice] = "We are sorry.You can
On Sun, Jan 3, 2010 at 4:27 AM, acreadinglist wrote:
> Can someone clarify what type of object is returned from a find
> (:select => ...) statement that only selects a subset of the records
> columns?
>
> If I have an object Foo with attributes A and B, and call find(:select
> => "A"), is the obje
Gravy,
If I now delete the second step and add another I now have id's 1 and 3. id
> 2
> has been 'consumed' which means that a simple loop using the id's to
> generate an html list won't work.
>
Answering both of your questions, that's how the DB works. It has an
internal sequence, which it inc
Awesome! :)
Pepe, thanks for letting us know about it.
Gotta love RoR community, thanks Raimonds, kudos!
[]'s
Rodrigo Dellacqua
On Sun, Jan 3, 2010 at 9:01 AM, Raimonds Simanovskis <
raimonds.simanovs...@gmail.com> wrote:
> Original Oracle adapter is not maintained anymore since Rails 2.0 when
Chris/Eric,
Thanks both of you.
Well, what happens is that I was using RubyMine which promptly asks you, if
you want to install gems that are missing or just install gems from their
interface.
It ends up that RubyMine doesn't correctly install the gems. When I tried to
list the available actions
On Jan 3, 12:35 pm, Ralph Shnelvar wrote:
> Cookies can have expiry dates set long in the
>
> > future, but sessions are handled with cookies that are set to only
> > last until the browser quits (not the same as just closing a window).
>
> Let's say that I'm using Firefox and I open multiple i
Original Oracle adapter is not maintained anymore since Rails 2.0 when
it was taken out of Rails core.
Therefore always please use oracle_enhanced adapter (http://github.com/
rsim/oracle-enhanced) which I maintain to be compatible with latest
Rails releases and which we use in many production appl
OK, so my previous errors seemed to be due to a Windows environment
issue. Now I'm back on my Mac things are all working.
Anywaythanks for the help and pointing in the direction of those
screencasts. I found Ryan's updated nested form example on Github
(complex-form-examples) and it's just wh
Hi Ralph,
start here:
http://guides.rubyonrails.org/action_controller_overview.html#session
Regards,
Nicolai
--
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 uns
Cookies can have expiry dates set long in the
> future, but sessions are handled with cookies that are set to only
> last until the browser quits (not the same as just closing a window).
Let's say that I'm using Firefox and I open multiple instances of
Firefox ... so do all the instances of Fire
Alright, so I fixed my problem, and wanted to post it here for anyone
else that might be having the same issue. Basically, I just prefixed
my model classes with two colons, like so:
@node = ::Node.new
This forces the namespaced controller to look for the model in the
standard model directory.
On
Hi,
On 3 Jan., 00:21, Frederick Cheung wrote:
> On Jan 2, 9:50 pm, "wdic...@googlemail.com"
> wrote:
>
> > my Game#pconfig_src method will not be called.
> > But if I change the method's name to 'pconfigsrc' and the symbol's
> > name accordingly, then it is called.
> > Why?
>
> Well when the met
Hello,
I'm using the spreadsheet/excel gem to generate an excel sheet that I
want user to be able to download it once it's generated. Please take a
look on the below code:
@contacts=Contact.find(:all)
if @contacts.size>0
file="#{Date.today}_Report.xls"
workbook=Spreadsheet:
On Jan 3, 9:27 am, acreadinglist wrote:
> Can someone clarify what type of object is returned from a find
> (:select => ...) statement that only selects a subset of the records
> columns?
Foo.find always returns instances of Foo. That instance may have extra
attributes, it may have fewer attrib
Can someone clarify what type of object is returned from a find
(:select => ...) statement that only selects a subset of the records
columns?
If I have an object Foo with attributes A and B, and call find(:select
=> "A"), is the object that's returned still a Foo object? Is it a
new Foo object?
And how about your Page Controller, did you change it to About Controller?
In your first implementation you've used Pages Controller to create your
About page. If you didn't change it to and About Controller you can to do
something loke that:
map.resources :pages, :member => { :about => :get }
[
On Jan 3, 4:46 am, Ralph Shnelvar wrote:
> The *Agile Web Development with Rails* book has an explanation of
> sessions that I am having trouble following.
>
> Does anyone know of another good discussion of how Rails manages
> sessions.
>
> Specifically, in Firefox and and Internet Explorer ...
Marnen Laibow-Koser wrote:
> Ritchie Young wrote:
>> On Jan 3, 3:47�pm, Marnen Laibow-Koser wrote:
>>
>>> > One other thing why PostgreSQL?
>>>
>>> Lots of reasons. �Performance, extensibility, adherence to the SQL
>>> standard...MySQL is inferior in nearly every respect.
>>>
>> Ok, but what if y
Ritchie Young wrote:
> On Jan 3, 3:47�pm, Marnen Laibow-Koser wrote:
>
>> > One other thing why PostgreSQL?
>>
>> Lots of reasons. �Performance, extensibility, adherence to the SQL
>> standard...MySQL is inferior in nearly every respect.
>>
> Ok, but what if you wanted to take advantage of some e
On Jan 3, 3:47 pm, Marnen Laibow-Koser wrote:
> > One other thing why PostgreSQL?
>
> Lots of reasons. Performance, extensibility, adherence to the SQL
> standard...MySQL is inferior in nearly every respect.
>
Ok, but what if you wanted to take advantage of some existing managed
infrastructure,
59 matches
Mail list logo