Displaying 20 results from an estimated 1000 matches similar to: "url_for: :overwrite_params went missing"
2005 Sep 11
3
Extending ActiveRecord::Base
Hey everyone,
I''m interested in extending ActiveRecord::Base. I have a special
"easier" find function that I want to include in all classes.
How can I include this in all classes?
Can I just create a model object that does something like this:
class ExtendedAR < ActiveRecord::Base
def self.special_find
...
end
end
and then all my other classes
2005 Aug 16
1
Defining model classes for enumerations
I have several tables for enumerations. They all have the same content:
id, name, position. I''d like to avoid the tedious work of defining a
class for each one explicitly. Not least, in order to avoid clutter in
the model directory.
Here''s what I''ve come up with:
class EnumRecord < ActiveRecord::Base
def self.define_enums(*enums)
enums.each do |spec|
2005 Dec 30
4
High performance queries - RoR, PHP or something else?
Hi everyone,
I''m building an app in RoR that apart from the normal web interface
has a web service. This web service takes a parameter and uses that in
a single database query, and returns the result in a simple XML
format.
This web service needs to be quite fast as it will be used on all
pages of a quite big site with thousands of visitors every hour. I
don''t think caching is
2005 Aug 28
8
Save and delete buttons: POST vs. proximity dilemma
I''m in a dilemma: In order to keep GET requests from deleting objects,
I''d like to use the button_to helper to get "something" that generates
a POST request. Unfortunately, that something is a form and forms can''t
be nested.
I''d also like to place buttons related to the same form close to each
other. At the top are some navigational buttons
2005 Aug 19
13
Enumerations (again): Comments please
Some of my earlier questions may have hinted ever so slightly in the
direction that I''m trying to implement "enumerations". By an
enumeration here I mean a class that has a fixed number of immutable
instances, which in turn have essentially only a name and a position.
Requirements I''ve tried to meet are
- Enumeration instances should only be loaded once from the
2005 Aug 22
8
Observing changes to a text field
I''ve noticed that using several TimedObservers (prototype.js) on a page
to watch for changes to text fields (haven''t tried forms) can have a
non-negligible effect on the CPU cycles used by the browser process.
Nothing dramatic, to be sure, but unnecessary.
Autocompleter.Base (controls.js) follows a smarter strategy to watch for
changes. Currently this functionality is tied
2005 Sep 13
12
PDF views?
I know there''s wiki page on generating PDF[*], but that''s not really
what I want. I don''t need to create arbitrary PDF. What I''d like to do
is create PDF templates and fill in the blanks. Roughly, I''m looking
for functionality akin to the mail merge feature of word processors,
including conditional and repeated elements, say, table rows.
Michael
2005 Aug 04
10
Rails Spin-offs WIKI.
http://rails-spinoffs.bombdiggity.net/index.php?title=Main_Page
guys here is the wiki. Once you register let me know and I''ll give you
full access to the site.
Jon
Jon Whitcraft
Online Services
(317) 492-8623
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2009 May 12
4
has_many :through and scopes: how to mutate the set of associated objects?
I have a model layer containing Movie, Person, Role, and RoleType,
making it possible to express facts such as "Clint Easterbunny is
director of the movie Gran Milano".
The relevant model and associations look like this
class Movie < ActiveRecord::Base
has_many :roles, :include => :role_type, :dependent => :destroy
has_many :participants, :through => :roles, :source
2009 May 19
4
proper way to ensure atomic model changes
Hi!
Say we have a rails active-record-based model called "instance" which
can have different states - STOPPED, RUNNING, STARTING_UP,
SHUTTING_DOWN, etc...
There is a method #start which changes the instance state to
STARTING_UP only if it is STOPPED.
def start
if self.state == STOPPED
self.state = STARTING_UP
self.save
...
end
end
As you understand if we have multiple
2005 Jul 26
6
implement audit trail table
has anyone has any idea how to implement audit trail table for all update /
deletion done on records?
I''m thinking to have corresponding audit trail table to each table, so
everthing before an update or deletion is done, a new record will be insert
into the corresponding audit trail table.
Is there a way to overwrite the save, destroy, method at the application
level? so that I do not
2010 Sep 15
5
OT: Installing static binary of wkhtmltopdf
This is OT but have not been able to get a response elsewhere (stack
overflow and the project site itself) so thought someone here might know or
have some ideas.
First, I am using wkhtmltopdf stand alone without any of the rails gems as I
found that for some reason using WickedPdf or PdfKit my pdf''s did not
generate with active links from the links from those in the html. When I run
2005 Aug 18
8
Extending a js class
It''s been a few days since I posted my last two emails (of which, no one
replied to) so I''ve gone ahead and coded a working slider class as well
as a ''resizeable'' class that allows a user to drag and resize the
element. I also linked these two together as I want to have slider
behavior that can resize the resizeable element. The end result is both
the
2005 May 17
3
validates_associated / error_messages_for
When a validates_asssociated fails...
I get something like
Address is invalid
is there a way, preferably on a per-association basis to have the error
messaage include
the actual error like
Zipcode is too long (max is 10 characters)
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2005 Aug 07
11
HABTM Movable Select Box
Hi,
I found it a while ago, an add-on to Rails for supporting movable select
boxes, but I searched through the wiki and the mailing list and couldnt
find what I was looking for. I was hoping someone might know of or
remember something about the project.
Thanks,
Dylan.
2008 Apr 29
4
Default values for belongs_to and has_one
There really doesn''t seem to be a *declarative* way to define a default
value for belongs_to and has_one associations
class Person < ActiveRecord::Base
belongs_to :address
end
p = Person.new
p.address.city = ''Atlantis'' # Bummer!
Of course, there''s an easy way to avoid this
class Person < ActiveRecord::Base
belongs_to :address
2005 Sep 22
5
Prototype lib : for-each loops and DontEnum
All
I realise that this isn''t strictly the correct place to discuss the
prototype lib but being as scriptaculous is dependent on it I thought people
might have some opinions.
Easier to explain with the example below, copy into a html file and ensure
the path to prototype.js is correct. You''ll see the first example prints an
extra element "extend" when iterating over
2006 Nov 21
1
fix for modularized controller using overwrite_params
Hey guys,
I realized some people have had problems with nested controllers and the
:overwrite_params call. The way I fixed it is like this:
:overwrite_params=>{:controller=>"/#{params[:controller]}"}
I would love to see if other people could improve on this, its not the
prettiest thing.
--
Posted via http://www.ruby-forum.com/.
2005 Jun 29
14
Unobtrusive scripting?
Currently, pages generated by Rails tend to be sprinkled with
JavaScript. This happens, because the various helper methods work only
locally and simply append to the output.
In order to hide the JavaScript away, rendering would probably have to
be changed. A way I can think of is that a page-specific script is
included in the head of the document and JavaScript code is not written
to the
2005 Sep 13
3
Alternatives to Rico LiveGrid?
I''m no friend of paging, but I have to somehow deal with lists of
potentially large numbers of objects. The Rico LiveGrid[*] at first
blush seems attractive, but has some major drawbacks. It doesn''t work
with Safari/Konqueror, not yet anyway. It can only handle fixed-size
tables and requires that widths, including column widths, are
hand-crafted.
I''m looking for a