Javier Quarite wrote in post #1041505:
On Wed, Jan 18, 2012 at 6:09 AM, angel david li...@ruby-forum.com
wrote:
`method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.1/lib/action_dispatch/http/parameters.rb:10:in
`parameters'
What comes before this?
Javier
Hi Javier..
Using: RSpec, Shoulda, Paperclip (including matchers)
Example Model
class Example ActiveRecord::Base
has_attached_file :attachment
validates_attachment_presence :attachment
validates_format_of :attachment_file_name, :with = /\.(png|jpe?g)$/
end
Example Test
require 'spec/helper'
ActiveRecord allows an association to be extended, as in:
module FindWeeklyExtension
def weekly(start)
where(created_at :t1 and created_at :t2,
:t1 = start,
:t2 = start + 7.days
)
end
end
class Author
has_many :posts, :extend = FindWeeklyExtension
Hi there,
I wonder if anybody else is experiencing this kind of issues, I'm
running failry small application in development environment and I'm
experiencing REALLY unacceptable performance issues. Below is summary
line from development log for my slowest edit action, which is just a
nested form:
On 18 January 2012 23:38, muhammad singgih zulfikar ansori
m.singgih...@gmail.com wrote:
oh sorry, here i attach the complete errors from test:
[snip]
ActionController::ActionControllerError in LineItemsController#create
Cannot redirect to nil!
Rails.root:
On 19 January 2012 03:12, Daisy Di li...@ruby-forum.com wrote:
Dear All,
There are two tables one is redemption_list,columns are:
id(int),item_id(char(15)),points_required
the other one is redemption_location,columns are:
id(int),loc_id(char(3)),item_id(char(15)).
On 19 January 2012 04:19, Daisy Di li...@ruby-forum.com wrote:
Dear all,
there are two tables ,one is product, one is location,
product has many location, and location belongs to product, all the
setting in the models i have done, now in the views/show.html.erb, i
want to display the product
Hello,
I've recently migrated my application to Rails 3, and I encounter problems
with the new system of SQL-caching.
I have a 'category' action on my PostsController that I access through a
standard *:controller/:action/:id* route (
www.my_app.net/posts/category/something), and runs a query to
no one?
--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to
On 30 December 2011 10:54, Damien Knight li...@ruby-forum.com wrote:
Hi,
I recently changed to rails 3 and the chainability for relations(i.e.
.where(xxx).order(xxx))
so here's my question: can i use scopes in my includes to avoid
1+n-query problem?
i have:
class A ActiveRecord::Base
@Colin and @Mike, thank you both, particularly, mike , for the part about
devise integration. To wrap up, I would like your opinion whether there any
flaws or major disadvantages to my structure.
I dropped the organizations table since I think its redundant. This leaves
me with the following
I have Admin class User class and a polymorphic Profile class
class Admin ActiveRecord::Base
include ActiveModel::Validations
has_one :profile, :as = :profitable
accepts_nested_attributes_for :profile
validates_associated :profile
class User ActiveRecord::Base
include
On Thu, Jan 19, 2012 at 3:24 PM, Erwin yves_duf...@mac.com wrote:
I have Admin class User class and a polymorphic Profile class
class Admin ActiveRecord::Base
include ActiveModel::Validations
has_one :profile, :as = :profitable
accepts_nested_attributes_for :profile
Hi,
I am new to programming and following Chris Pines book. There is an
exercise in the book to write a method similar to .sort that will
arrange an array of string in alphabetical order. I will paste the
exercise:
OK. So we want to sort an array of words, and we know how to find out
which of
Thanks Peter .. just a typing error in my post , actually it's well
written in the models : has_one :profile, :as = :profitable ( even
if profitable would make $$)
the params sent from the form submit are OK
{.. admin={area_id=1, canAdministrate=0,
canManageProject=0, canShootVideo=0,
On Jan 19, 2012, at 10:39 AM, Loren wrote:
Would you be please so kind to take a look at my code and tell me what
am I doing wrong?
You're making this far, far, far more complicated than it needs to be. Hint 1:
you only need two arrays, sorted unsorted, all the shuffling in out of
I've added two before filters in one of my controllers like so:
before_filter :filter_one
before_filter :filter_two
The first filter (:filter_one) always fires, but the second filter
(:filter_two) never does. Anyone know how to make both filters always
fire?
Thanks.
-Dan
--
Posted via
On Thu, Jan 19, 2012 at 10:23 AM, Dan King li...@ruby-forum.com wrote:
I've added two before filters in one of my controllers like so:
before_filter :filter_one
before_filter :filter_two
The first filter (:filter_one) always fires, but the second filter
(:filter_two) never does. Anyone know
what version of rails are you using? on 3.1.3 all three of these fire fine for
me in my application controller...
before_filter :must_login
before_filter :must_be_member
before_filter :must_be_admin
jordan
On Jan 19, 2012, at 1:23 PM, Dan King wrote:
I've added two before filters
Could it be that your first filter is preventing the request from reaching
your second filter?
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To view this discussion on the web visit
Hi,
I'm having an issue with some routes in my apps, the apps are the same
app the only difference is that I use one for testing and the other for
production stored in different directories lets say 'test' and 'prod'.
The applications work with phusion passenger and their work in a virtual
host.
On 19 January 2012 20:42, art tav li...@ruby-forum.com wrote:
Hi,
I'm having an issue with some routes in my apps, the apps are the same
app the only difference is that I use one for testing and the other for
production stored in different directories lets say 'test' and 'prod'.
The
On 19 January 2012 20:58, Colin Law clan...@googlemail.com wrote:
...
I hesitate to reply because I do not fully understand what you are
doing so anything I say may be rubbish. However I believe that the
url generated by a commit action of a form (which I think is what you
are referring to)
Colin Law wrote in post #1041687:
On 19 January 2012 20:42, art tav li...@ruby-forum.com wrote:
form action=/controllerName/ method=post
I hesitate to reply because I do not fully understand what you are
doing so anything I say may be rubbish. However I believe that the
url generated by a
On 19 January 2012 21:50, art tav li...@ruby-forum.com wrote:
Colin Law wrote in post #1041687:
On 19 January 2012 20:42, art tav li...@ruby-forum.com wrote:
form action=/controllerName/ method=post
I hesitate to reply because I do not fully understand what you are
doing so anything I say
All,
I have numerous places in my codebase like this:
redirect_to :action = 'schedule_by_uid_and_run_date', :uid =
@schedule.first.train_uid, :year = @date.year, :month = @date.month,
:day = @date.day
I'd like to replace the :year, :month and :day parameters with a hash
containing the
Thirdly, and this is the bit I don't understand and so hope to learn
more, why are you specifying the controller name in the action and why
the ../ or / on the front?
The ../ or / at the beginning are used for being certain that the url
it's created from the root of the application, I found
Hello!
I am using the standard (scaffolded), REST routing. I need to pass
external values to my new action for a certain model, and let the
user complete the other fields in the standard form_for.
My initial idea has been to simply amend the URL like this:
.../foos/new?size=4weight=2
Then in
On Thu, Jan 19, 2012 at 4:19 PM, PierreW wamre...@googlemail.com wrote:
I am using the standard (scaffolded), REST routing. I need to pass
external values to my new action for a certain model, and let the
user complete the other fields in the standard form_for.
My initial idea has been to
Hey all,
When running a cucumber test, I get this:
Internal Server Error
Mysql2::Error: Lock wait timeout exceeded; try restarting transaction:
INSERT INTO `users` (`address_1`, `address_2`, `address_3`,
`can_receive_sms`, `city`, `completed_terms_on`, `country_id`,
`created_at`,
I just installed 1.9.2 on my 2nd machine, but after I installed I checked
the version with ruby -v and it sent me 1.8.7
Here's the terminal output...anyone know what's wrong (I have RVM
installed):
Francescas-MacBook-Air:~ fkrihely$ rvm install 1.9.2
Fetching yaml-0.1.4.tar.gz to
doh! For anyone who is silly like me,
After install put
rvm use 1.9.2
in the command line
and voilla
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
On Thu, Jan 19, 2012 at 10:24 PM, Francesca Krihely france...@10gen.comwrote:
I just installed 1.9.2 on my 2nd machine, but
On Thu, Jan 19, 2012 at 10:27 PM, Francesca Krihely france...@10gen.comwrote:
doh! For anyone who is silly like me,
After install put
rvm use 1.9.2
in the command line
and voilla
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
Sometimes its helpful to close the
Dear all,
i want to enter quantity ordered in the textfield on product page,
then click view location, to view the location of the product ,then
choose the location and submit to make a reservation, but i want to know
how can i pass quantity ordered from product page to location page.
Thanks
--
34 matches
Mail list logo