Displaying 16 results from an estimated 16 matches for "0bv1hcadfprk211z5vl".
2007 Oct 16
2
Where override model attribute names?
OK, so I get that ActiveRecord determines model attributes through
reflection of the table schema. Handy for many cases, but not mine.
I need to override that and provide my own mapping of attribute names
to column names to use the mapped names throughout the application code.
I''ve been poking around looking for where in AR''s hierarchy I can can
inject this mapping, but
2007 Nov 16
4
Newb - variable returns # sign?
Hi Gurus-
I want to return the variety from the species table based on the
active record link to inventory table
class Species < ActiveRecord::Base
has_many :inventories
end
class Inventory < ActiveRecord::Base
belongs_to :species (this is the singular and the plural, so that''s
OK)
end
My inventory_controller looks like:
def show
@inventory =
2007 Nov 29
27
Strip & Sanitize BEFORE saving data
So I''ve googled my brains out, and I see a lot of talk about
TextHelper for views, but next to no discussion about cleaning text
_before_ it is saved.
I figured this had to be asked 4 zillion times, but I''m not finding
anything concrete/obvious.
Using h is fine as a safety catch, but that alone is not acceptable
to me as the means of diffusing the impact of HTML or JS
2007 Nov 21
1
iText, Rails, and OS X
I have the need to take existing PDFs and populate them with data
entered via HTML forms. Data saved to database, entered in to PDF
file, PDF file with data archived, and then distributed va email and/
or download.
The languuage I previous did all my web work in, Lasso, had this
stuff built in, but it appears not to be so with Ruby or Rails.
The latest info I can find on this is a year
2007 Nov 23
2
Capture IP Address to Sessions
What I''d like to do:
Capture the IP addresses of the folks visiting a web site in the
Sessions table.
What needs to be in place (code, model, controller, etc.), where does
it need to go (application controller?), how best to set up the
Sessions table?
Appreciate a noob-friendly outline of what needs to be done.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You
2007 Nov 16
3
Route Information
Is there a method to return a hash of the route configuration based on
a path?
For example:
magic_method(''/my_controller/my_action/my_id'')
=>
{:controller => ''my_controller'', :action => ''my_action'', :id =>
''my_id''}
Thanks!
Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message
2008 Jun 13
3
Alternative to storing ActiveRecord object in session
I''m writing a wizard-like module in my application where, in a series
of steps, the user builds upon an ActiveRecord object, and in the end,
saves the AR object into the database. The ActiveRecord object is
fairly complex, with a has_many association that could potentially get
large, so I don''t want to store it directly in the session. In fact,
having done so already caused a
2007 Nov 03
3
Birthdate validation
Hello everyone,
I''m almost cracking my head trying to do this birthdate validation. It
turns out that I can only accept users with at least 18 years old and
I''m trying to validate it writing this code on my user.rb fil at app/
models
class User < ActiveRecord::Base
validates_presence_of :full_name
validates_presence_of :street_address
validates_presence_of :city
2007 Oct 24
5
Do I have to care about other methods than GET and POST?
Hi all
Sometimes I check in a controller if the method is GET or POST. But
afaik there are other methods - do I have to care about them?
Is the following enough?
if request.get?
...
elsif request.post?
...
end
Or do I have to add also an else block?
if request.get?
...
elsif request.post?
...
else
raise "Boah!"
end
Thanks for infos
Josh
--
Posted via http://www.ruby-forum.com/.
2007 Nov 14
6
a few add_index questions..
on previous apps i hadn''t really worried much about adding foreign key
indexes on my tables just because they''ve been fairly small and i
didn''t really think i needed them.
well, i''m working on something now that has the potential to have a
lot more data, and a lot more foreign keys.
so i have 3 tables... users, projects, and tasks.. should i be using
add_index
2007 Dec 02
0
UTF8 Regex in 1.2.x
So, I''ve been pounding the web for info on UTF8 in Ruby and Rails the
past couple days to concoct some validations that allow UTF8
characters. I have discovered that with the patches applied in Rails
1.2, I can get a little further by doing the following declaring
$KCODE = ''UTF8'' in environment.rb and by adding /u to regex expressions.
The only thing not working
2008 May 13
1
Serializing AR Objects
I need to serialize a composite AR model and save it to a database
field.
Reading up on Ruby''s Marshaling, it seems there could be problems
with the version numbering thing of the default dump/load methods.
As I understand it, Ruby internally marks the serialized data with
the current Ruby language version, and when loading that data, if the
major version is changed, the loading
2008 May 17
1
Scope Confusion - Controller iVars in Modules
I''ve created a module to include in a Controller. Basically it works,
but I am expecting methods in the module to have access to instance
variables from the controller, and that appears to not be the case.
Yet, a simple Ruby example says it should be. I''m not sure what''s
different.
Simple Example:
module ShapeStuff
def set_type
@type =
2008 Feb 12
4
Syntax of session's updated_at field ?
What''s the syntax to acquire the updated_at value of a session stored
in a db?
session.updated_at doesn''t work. can''t find any docs on this.
-- gw
--~--~---------~--~----~------------~-------~--~----~
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
2007 Nov 05
3
link_to & others really necessary?
One of the areas where I think Rails goes too far is in many of the
helpers that (AFAICT) do nothing more than change the syntax used to
write simple HTML tags. link_to and many of the form tags come to mind.
For me, these helpers aren''t that helpful. I find the HTML much
clearer to write and read, I don''t see any added value in the
overhead costs of using code to
2007 Nov 04
6
Missing model error
I am storing a shape object in a session, and somewhere I picked up
that to make sure I can restore the full glory of Shape, I needed
this line in ApplicationController
model :Shape
So, of course, I also have a file /app/models/shape.rb
All was working well, but then I decided I''d rather name the model
MyShape.
So, I
- edited the filename to "my_shape.rb"
- edited