Hi,
I have a text field that gets its updated value from a javascript
function. So I don't want the user to enter anything into the field. But
I want the value to be part of the parameters when the form is
submitted.
The problem is that when I use :dissable = true on the text field its
value is
In this case, you'll have to use :readonly = true, not disabled.
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Fri, Feb 27, 2009 at 6:07 PM, comopasta Gr
rails-mailing-l...@andreas-s.net wrote:
Hi,
I have a text field that gets its
On Feb 27, 2009, at 2:56 PM, Ga Ga wrote:
Rob Biedenharn wrote:
On Feb 27, 2009, at 11:42 AM, Rob Biedenharn wrote:
match_part =
self.class.
Rob Biedenharnhttp://agileconsultingllc.com
r...@agileconsultingllc.com
Sorry, if you look at the docs, sanitize_sql is a protected class
On Feb 27, 7:23 pm, Gavin ga...@thinkersplayground.com wrote:
what do you have in the date_clicked() function now?
Hi Gavin,
I had the same idea:
function datum_geklikt (geenDatum)
{
var doc = window.content.document;
alert('jep');
doc.getElementById( 'dagid').disabled =
On Feb 27, 2009, at 2:47 PM, northband wrote:
Hi -
I would like to use gsub() to strip decimals with trailing zeros from
a string. My string looks like this:
--
19.0 / 482.600 mm
--
I would like to end up with this:
--
19 / 482.6 mm
--
Anyone have a regular expression that can
I've noticed that several of my models contain the same set of
named_scopes (ones for active, various access levels, etc.). I was
thinking to avoid the duplication I'd try to pull that coat into a
common file either included or extended from within my models.
I created a module, but that didn't
I originally used a with_scope, but that doesn't play nicely with
will_paginate.
On Feb 27, 3:14 pm, Maurício Linhares mauricio.linha...@gmail.com
wrote:
At your model, override the find method:
class SomeModel ActiveRecord::Base
class self
def find(*args)
with_scope(
Yeah thanks a lot Maurício!
Cheers!
--
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
Matt: Thank you for your reply. I have put this in the environment.rb
file and my app fails to start?
config.gem 'cyu-ar_mailer', :lib = 'ar_mailer', :source =
'http://gems.github.com'
Thanks
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
When you tried using a module, did you try it like this? ie. putting the
calls to named_scope inside self.included ?
module MyScopes
def self.included(base)
base.send :named_scope, ... params ...
Another option might be to make a plugin with your named scopes in them.
SH
Awesome - this is a start - I'll take it from here.
Thanks!
On Feb 27, 4:14 pm, Rob Biedenharn r...@agileconsultingllc.com
wrote:
On Feb 27, 2009, at 2:47 PM, northband wrote:
Hi -
I would like to use gsub() to strip decimals with trailing zeros from
a string. My string looks like
No, I didn't try that but that worked perfectly. Thanks for the tip.
On Feb 27, 4:34 pm, Starr Horne st...@chatspring.com wrote:
When you tried using a module, did you try it like this? ie. putting the
calls to named_scope inside self.included ?
module MyScopes
def self.included(base)
Hello Evan,
I've posted a similar question few days ago (
http://groups.google.com/group/rubyonrails-talk/t/813041902727d8e0?hl=en
). Unfortunately there weren't any answers yet. So, by now I recommend
you to take a look at the rails-authorization-plugin from
Writertopia (
Adriano,
Thanks for pointing out your post. I'm looking at the Authorization
plugin now.
After several more hours of research I've found a couple of resources
that might help you, as well.
A good, comparative overview of lots of authorization plugins
Hello, i am running OSX 10.5 leopard with installed rails 2.2.2 at /
usr/bin/. Having wanted to try rails 2.3, i created a gems directory
at $HOME/gems and used 'export GEM_HOME=$HOME/gems'. Then i gave a
'gem install rails --source http://gems.rubyonrails.org and installed
rails 2.3 at
Thanks people! The script worked me just fine!
On Jan 20, 9:49 pm, ginty itsgi...@gmail.com wrote:
Outstanding thanks for the replies guys!
Phil your script fixed it for me, cheers!
On Nov 29 2008, 2:58 am, PhilW p...@slightly-cracked.com wrote:
On Nov 11, 5:29 am, Mathematician
I might do something like this just to play w/ a 2.3 rails app:
$ cd play
$ git clone git://github.com/rails/rails.git
Initialized empty Git repository in /Users/cdemyanovich/play/rails/.git/
...
Resolving deltas: 100% (73189/73189), done.
$ ruby rails/railties/bin/rails dummy
create
I'm currently trying to connect rails to a legacy SqlServer database. System
is windows XP and my attempts to connect with activerecord sql adapter and
ADO.rb file failed miserably (I wrote a mail about it before)
So it seems like odbc adapter is more recent compared to sql adapter and
probably
On Fri, Feb 27, 2009 at 12:10 PM, jstark jsst...@gmail.com wrote:
Is there a way to run rails 2.3 instead of 2.2.2 ? i
would not like to uninstall rails 2.2.2.
You don't need to uninstall rails -- here's my system output from
`sudo gem list --local rails`
*** LOCAL GEMS ***
rails (2.2.2,
If observe_field isn't going to call more than once, but you could try
observe_form instead?
%= observe_form :new_item, :function = 'datum_geklikt()' %
I know it's not ideal but instead of passing arguments true and false
to the function, have the function determine the current value of the
i tried % form_for :advertisement, @advertisment, :url = { :action
=
create }, :html = { :multipart = true } do |f| %
but the result is the same !
will on clicking the submit button automatically call the create
function?
how can i know weather it is called or not
So what's the solution to that Fred ? I would have to load question also
when I load the subquestion ? That would mean doing a different query twice
for extracting the same object. Or is there any other way around ?
On Sat, Feb 28, 2009 at 5:15 AM, Frederick Cheung
frederick.che...@gmail.com
Hello everyone i have created a online Music composer that built in
rails I was wondering what others in the communty think about it
www.literature2music.com
thanks for the feedback
Gabrielg1976
--~--~-~--~~~---~--~~
You received this message because you are
Is it possible to define a model that is not backed by a database
table and still relate other models to it? Will relations between
instances of these models persist?
For instance, say I have a Cat model that does not inherit from
ActiveRecord and an Owner model that does. Can I assign a
Here's how it could look like - http://pastie.org/402767
And having five pages with almost the same markup is always wrong, you
don't even need to be looking for DRYing up your code.
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Sat, Feb
No.
Unless you roll your own solution or persist the cat at the database
in a way or another.
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Sat, Feb 28, 2009 at 12:27 AM, Evan evancha...@gmail.com wrote:
Is it possible to define a model
I don't know if you can get there just w/HM=T, but you can fake out the last
link w/a custom method. This is working for me:
class Article ActiveRecord::Base
belongs_to :feed_entry
end
class FeedEntry ActiveRecord::Base
belongs_to :feed
has_many :articles
end
class Feed
Thanks, I'll work through your example.
I'm not sure that I follow your second comment. I understand that
having duplicate markup is not desirable, but is there another way I
should be approaching this?
On Feb 27, 9:35 pm, Maurício Linhares mauricio.linha...@gmail.com
wrote:
Here's how it
And what about cases where I need the model attribute names to be
different? For instance, in one case I might print item.name, but in
the other, item.title. And since this markup will be similar to the
front-end display (non-admin), is there a good way to set the link_to
to be either :admin or
On Fri, Feb 27, 2009 at 11:50 PM, ericindc ericmilf...@gmail.com wrote:
And what about cases where I need the model attribute names to be
different? For instance, in one case I might print item.name, but in
the other, item.title.
Make all models that are going to be used by that template
My routes.db
ActionController::Routing::Routes.draw do |map|
map.resources :advertisements
map.root :controller = home
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
--~--~-~--~~~---~--~~
You received this
Muy bien. Ya he conseguido que funcione. Espero que ésto te ayude.
En el controlador:
def mi_accion
@pager = ::Paginator.new(Mi_tabla.count, 5) do |offset, per_page|
Mi_tabla.find(:all, :limit = per_page, :offset = offset)
end
@page = @pager.page(params[:page])
end
El
Hi,
I have the following class architecture:
class Container ActiveRecord::Base
has_many :containments, :order = 'position'
has_many :parent_containments, :as = :containable, :class_name =
'Containment'
has_many :containable_items, :through = :containments, :source
Ok, I follow having all models respond to title, but why would
implementing the model's to_s method be a better approach? Is it
just for consistency, always expecting to_s to return what the partial
should display? How is that any different that expecting all models
to answer to title?
Thanks.
ericindc wrote:
I'm working on fixing up the code in my first Rails application and
have come around to DRYing up the views and partials. For the most
part, I'm satisfied with the DRYness of the application, but I have
5-6 partials that display nearly identical XHTML, just with different
So, here's how this turned out. It seems that I had two versions of
openssl installed on my system - one old one (from fink?
macports? ...) in /usr/[bin include lib] and the other newly built
from source in /opt/local/[bin include lib].
I was building all systems from source with config
suppose if the junction model is ProfileUser You can define like
Profile.rb
---
has_many :profile_users
has_many :users, :through = :profile_users
User.rb
---
has_many :profile_users
has_many :profiles, :through = :profile_users
profile_users.rb
belongs_to :user
You can only go through has_many associations.
Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/
On 28/02/2009, at 4:54 PM, Preethi Sivakumar rails-mailing-l...@andreas-s.net
wrote:
Hi,
I'm using has_many and through relationship between two models
Profile and
101 - 138 of 138 matches
Mail list logo