I am using script/console to debug, but when I make some changes to say
a helper and rerun the method, it doesn't reload the new changes.
"reload!" doesn't work - it only updates model changes. Suggestions? TIA
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you ar
I'm running a rake task and it complains there are "Missing gems" even
though they are indeed installed. However from further inspection, it
appears it is not looking in my GEM PATH (/usr/local/lib/ruby/1.8) but
instead is looking in
/usr/lib/ruby/gems/1.8.
my gem env:
RubyGems Environment:
- R
BTW when I do "gem list" the gem appears:
# gem list
al...@ubuntu:~/www/lines$ gem list
*** LOCAL GEMS ***
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
authlogic (2.1.3)
bcrypt-ruby (2.1.2)
crack (0.1.6)
devise (1.0.8, 1.0.7)
devise_in
I have installed the following gem which is in my environment.rb.
However when I try to run a rake task, it gives the error:
environment.rb
config.gem "devise_invitable", :version => '0.2.3'
$ rake mytasks:task
(in /home/allen/www/lines)
DEPRECATION WARNING: Rake tasks in vendor/plugins/paperclip
Disregard, solution found.
--
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-t...@googlegroups.com.
To unsubscribe from this group, send email to
r
I am trying to create an association table using the ":through" option
in "has_many" but not having success. I have created the necessary
migrations of the association tables and run rake db:migrate
I have the following model:
class Group < ActiveRecord::Base
has_many :users, :through => :group
Currently I'm using "acts_as_commentable" which is fine, but I wonder if
there is something better and more robust out there as a replacement. On
my site I allow people to post news articles etc that are commentable.
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
--
You received th
I want to perform unit tests but the model object in question is
actually linked to an external database table. So I don't actually have
the database table in my local database which I need to run unit tests.
Any ideas on how to approach this? I have created a sample fixtures yml
file that has a su
Running the command:
Event.find_in_batches(:conditions => ["gw_out_time + interval '60 days'
> now()"])
is causing a virtual hang. Not even control C will break it. If I remove
the "interval '60 days'" part, it works fine. Note this query works fine
is psql.
Ideas?
Thanks in advance
--
Posted
When i call model_object.to_xml, there is a DateTime field and it's
displayed as such: 2009-08-25T16:32:06Z
Is there anyway to modify the display format to say the format like
Time.now.utc?, i.e. 2009-09-09 03:14:20 UTC
thanks
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~-
Thanks. one thing I noticed is that it's ":class_name" not just ":class"
(2.3.3)
Rick Denatale wrote:
>
> You need to give the association a different name, and a few other
> things
>
> class User
>has_and_belongs_to_many :friends,
> :class => "
I have a User model and in I want to have a
has_and_belongs_to_many :users
Obviously that won't work since the join table will have the same column
names (user_id).
What approach should I take?
thanks
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~-
Found the problem:
You need to put
<%= javascript_include_tag :defaults %>
as the last javascript_include_tag in the layout
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Grou
One thing I forgot to add, I have a nested div actually b/c my layout
has a div. So the above is really
Could this be the problem?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
I have the simple view page:
<%= link_to_remote "Turn on Alert", :url => {:controller => "alerts",
:action => "new"} :update => "test1" %>
Then in my controller I simply do
if request.xhr?
render :text => "AJAX Called"
else
redirect_to :back
end
It's hitting the request.xhr? block as I h
Searching around if there is a good commenting / blog plugin or gem to
use in my app. Would rather use one than reinvent the wheel. Something
like where a user can comment on a specific item in my model and have
the display etc all built in.
Any recommendations?
thanks
--
Posted via http://www.
Sijo Kg wrote:
> Hi
>
> Did you try the example I said. I tested it and working for console
> and server starting (Not passenger)
>
> Sijo
Yeah I got it working. Wish I could see the generated output to a
logfile though. That would be useful
--
Posted via http://www.ruby-forum.com/.
--~--
Sijo Kg wrote:
> Hi
>
>You have to specify where to log for example if want to console
> vcan do like
>
> logger = Logger.new(STDOUT)
> logger.info("Running tasks")
>
>
>
> Sijo
When I do a "script/console" the initializers run. But when I fire up
the web server/rails (passenger) they
I created a "config/initializers/tasks.rb"
In it I have the following is all:
logger.info("Running tasks")
However nothing is logged or run. Am I missing something?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message becaus
LOL thanks. i drank too much last night i guess.
Maurício Linhares wrote:
> You're missing the "each" call.
>
>
> On Fri, Feb 20, 2009 at 4:54 PM, Allen Walker
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You re
This is strange: I'm doing the following in script/console:
>> Contract.find(:all) do |c|
>>
?> if c.use_initial_published_date
>> c.initial_published_date = Date.today
>>
#x27;sku_name').observe('click', function(event){
alert(Event.element(event).innerHTML);
});
Robert Walker wrote:
> Hitesh Rawal wrote:
>> Allen Walker wrote:
>&
This may not be rails specific, but i have a select drop down box and
want the "submit" action fired when the user clicks one of the options
in my drop down select tag box. How do I accomplish this?
thanks
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--
I solved it: Don't put your form tag under a tag. Argh.
--
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 ru
I have the following:
<% form_remote_for :role, :method => :put, :url => {:controller =>
"roles", :action => "update", :id => @role.id\
} do |f| %>
<%= select("role", "default_view", Account::ROLES) %>
<%= submit_tag("Update"); %>
<% end -%>
Controller co
I have the following form with 2 selectbox drop downs:
SelectBox1
SelectBox2
WHen the user changes the selection in SelectBox1, I want SelectBox2 to
be updated to contain a different set of
options. I'm not sure exactly how to do this. If someone could point me
in the right direction, I'd appre
Patrick Doyle wrote:
> On Sun, Dec 14, 2008 at 10:27 PM, Allen Walker <
> rails-mailing-l...@andreas-s.net> wrote:
>
>>
>> {:action=>"wsdl"} /:controller/:action/:id.:format
>> /:controller/:action/:id
>>
>> So it's
I have the following link_to:
<%= link_to("Remove", {:action => "remove_role_from_account", :role_id
=> role, :account_id => @account}) %>
It generates:
http://myserver.com/roles/remove_role_from_account?account_id=1&role_id=5
But this doesn't match the right default route:
{:action=>"wsdl"} /
I have a "has_and_belongs_to_many" relationship between two tables,
meaning I have a join table that contains the two ids of each table.
For simplicity let's call them "foo" and "bar". I want to delete a bar
from a foo but not actually delete the bar itself.
foo = Foo.find(1)
bar = Bar.find(1)
I have a wizard with multiple screens where I essentially populate an
ActiveRecord object. However I DO NOT want to save it to the database
until the last screen and the user clicks save. Meanwhile though, I want
to get access to the object at anytime via the wizard.
So should I simply create the
Still having issues. Funny this is if I deploy on a different host
uploading works fine.
--
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 pos
I have the following upload form:
<% form_for @product_datum, :url => { :action => :create }, :html => {
:multipart => true } do |form| %>
...
<%= form.file_field :uploaded_data%>
<%= form.submit "Upload" %>
In my controller I have a
def create
..
end
For some reason when the user clicks s
I had this working fine before, but now for some reason
<%= observe_field( :sale_sku_id, :url => {:action =>
"update_sales_form"}, :update => :unit_price, :with => :sku_id) %>
Produces nothing on the view side.
I have
<%= javascript_include_tag :defaults %>
at the top of my layouts/applicatio
Mark Reginald James wrote:
> Allen Walker wrote:
>> Ok this worked:
>>
>> <%= javascript_tag
>> "document.getElementById('guarantee_status').onchange()" %>
>
> That suggests your problem was absence of the Prototype
> library, mea
Ok this worked:
<%= javascript_tag
"document.getElementById('guarantee_status').onchange()" %>
Allen Walker wrote:
> Even if I do:
>
> <%= javascript_tag "alert('Hello')" %>
>
> Nothing happens. So it doesn't seem to
Even if I do:
<%= javascript_tag "alert('Hello')" %>
Nothing happens. So it doesn't seem to be executing this javascript
after the dom loads in the brower (so I still can't set the initial
state)
Mark Reginald James wrote:
> Allen Walker wrote:
&g
Mark Reginald James wrote:
> Allen Walker wrote:
>> No such luck again. Here's the generated HTML:
>
> Looking at the Prototype code, observe only calls
> the function if the value has actually changed.
>
> So one way would be to move the observer inline:
>
>
window.attachEvent("onload", olf);
//]]>
Mark Reginald James wrote:
> Allen Walker wrote:
>> Doesn't work. I tried putting the javascript_tag right after the div and
>> outside the form itself. I understand the logic in the code but for some
>
is not
getting called.
Mark Reginald James wrote:
> Allen Walker wrote:
>>
>> page[:balance_div].hide
>> else
>> page[:balance_div].show
>> end
>> end
>> end
>> end
>
> One way is to add the f
I have the following in my view:
<%= observe_field 'guarantee_status', :url => {:controller =>
'testcontroller', :action => 'change_status'}, :with => 'value' %>
Remaining Balance
<%= f.text_field :balance %>
No when I first load this page, I need the change_status method hit on
Philip Hallstrom wrote:
>> end
>>
>> I'm getting a "stack level too deep error". Any suggestions on how to
>> fix and the correct approach to this.
>
> You're calling status from within status so it's recursing forever.
>
> Replace that last status with read_attribute(:status) after perhaps
> re
I'm trying to make a change to a field in the model whenever someone
accesses it and it's incorrect. So I have the following in my
ActiveRecord class:
def status
prev_status = read_attribute(:status)
if end_date < Date.today
update_attribute(:status, "Expired")
end
status
end
I'm get
Ok I got it to work doing:
render :update do |page|
page << "$('sale_unit_price').value = 100;"
end
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk"
In my controller I tried:
render :text => "$('sale_unit_price').value = 100"
no such luck
Allen Walker wrote:
> Ok .. so how exactly should I code this in my controller method? Also
> you are suggesting I should not have the :update option at all in my
> o
Ok .. so how exactly should I code this in my controller method? Also
you are suggesting I should not have the :update option at all in my
observe_form call?
Frederick Cheung wrote:
> On Oct 1, 8:08�am, Allen Walker <[EMAIL PROTECTED]>
> wrote:
>> Well I've tried both
Well I've tried both and it doesn't work. My generated html source for
the form:
Mikel Lindsaar wrote:
> On Wed, Oct 1, 2008 at 2:29 PM, Allen Walker
> <[EMAIL PROTECTED]> wrote:
>> <%= observe_form( :sales_form, :url => {:action => "update_sa
Ok in my view.rhtml:
<% form_for :sale, :url => {:action => 'add_sale', :id => @report},
:html => {:id => 'sales_form'} do |f| %>
...
<%= f.text_field :unit_price, :size => 10 %>
...
<% end %>
<%= observe_form( :sales_form, :url => {:action => "update_sales_form"},
:update => :sale_unit_price) %
47 matches
Mail list logo