It all depends, as you say, on why you're preloading the images. Most of the
image preloading code looks exactly like the OP's and works fine if your UI
relies on just having the images cached by the browser so they can work in
smooth rollovers or other page effects that rely on image swapping.
Hi,
As you want country name instead of id than pass name field. and in
show method you have to search according to country name instead of id.
As you required admin as prefix. so create namespace and define
routes as
map.namespace :admin do |admin|
admin.resources :countries
Thanks Bala..
periodically call remote worked for me
Thank You very much,
Veena
--
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...@google
RichardOnRails wrote:
> In app\views\expenses\new.html.erb, I (mistakenly) replaced the
> script/generated:
> <%= f.label :vendor %>
> <%= f.text_field :vendor %>
> with:
> <%= f.label :vendor %>
> <% @current_vendors = Vendor.find(:all, :order=>"nickname") %>
> <%= select_tag "list", options_for
John Grimes wrote:
> Post up the output of this command:
> gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.0.beta2, 2.3.5, 2.2.2, 1.3.6)
actionpack (3.0.0.beta2, 2.3.5, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activemodel (3.0.0.beta2)
activerecord (3.0.0.beta2, 2.3.5, 2.2.2, 1.15.
Yes I did, I kind of gave up for now on this. I can't seem to figure it
out.
If you could or anyone could help me out would be great.
Thanks again for the response.
Conrad Taylor wrote:
> On Sun, Apr 11, 2010 at 5:28 PM, Michael Michael
> wrote:
>
>> my gem file already has it, any other solu
Say I have a "Member" ActiveRecord object with a typical integer id
attribute, and a string 'username' attribute.
If I generate routes for members using map.resources :members, then the
output from the edit helper is:
edit_member_path(@member) => "members/23/edit"
My goal is that I really want:
Hi,
As you want to display owner of post next to the post. Use
post.user.name to display owner of the post. I think there is one to
many relation exist between user & post model.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Goog
Thanks Anthony..
But i have changed my logic to display the image..
Now i'm saving the uploaded images in application's public folder
itself..
Anyway thank you very much for your reply..
That article is really useful and helpful..
--
Posted via http://www.ruby-forum.com/.
--
You received this m
Veena,
try periodically call remote instead of observer field.
Thanks,
Bala
On Mon, Apr 12, 2010 at 9:59 AM, Veena Jose wrote:
> Hai Anthony,
> I didn't get the ajax part working.Ths is my code.Can you plz help
> me
>
> layout (home.html.erb)
> ..
> <%= @time %>
> <%= o
Hai Anthony,
I didn't get the ajax part working.Ths is my code.Can you plz help
me
layout (home.html.erb)
..
<%= @time %>
<%= observe_field :time_div, :url => {:controller=>"home",:action =>
:show_time },:frequency => 0.25, :update => :time_div %>
Controller
..
c
Please help. I've tried all i know with no results...
I have an app with a master class using has_many to another class.
When I create a new record with the params showing all fields for
master and the has_many class it seems to work OK. But doing an edit
on the record shows two copies of the has_
I'm trying to move some of my application's code into a plugin,
specifically the part that deals with web analytics. Some of the
features allow the controller to fire events that get displayed in the
views as JS code through a partial or helper. I'm currently doing this
with instance variables, but
Interestingly when editing the records individually no orphaned
records are created. This would appear to have something to do with
the Params hash being returned to the server and the nested fields
for.
The params hash being returned for a bulk update is detailed below:
Parameters: {"listing_i
Hi Joe
Thanks for your elaborate answer. It was useful
Tom
--
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 unsubscr
David,
If you still need some help with this then please provide the user
controller code.
Anthony Crumley
http://commonthread.com
On Sat, Apr 10, 2010 at 12:42 PM, David Zhu wrote:
> i really need help. anyone got a solution?
>
> On Apr 10, 8:51 am, David Zhu wrote:
> > how do i disable it?
>
You might be interested in the Faker gem that will create data for you in
all kinds of formats.
On Sun, Apr 11, 2010 at 4:55 PM, Grary wrote:
> Thanks guys.
>
> What's strange to me is the idea that Rails testing is not
> comprehensive, i.e., there are constants, e.g., zip codes, that you
> will
On Apr 11, 6:26 pm, Frederick Cheung
wrote:
> If you want something to be reloadable you should use
> require_dependency to load it. The main thing though is that a
> plugin's init.rb is not re-run between requests, so the include you do
> on ApplicationController is lost after the first request.
On Sun, Apr 11, 2010 at 5:28 PM, Michael Michael wrote:
> my gem file already has it, any other solutions? I just decided to do
> the package install of mysql to see if i was manually installing it
> wrong, and nope same issue still.
>
>
Michael, did you run the following in the root of your Rails
Post up the output of this command:
gem list
On 12 April 2010 10:28, Michael Michael wrote:
> my gem file already has it, any other solutions? I just decided to do
> the package install of mysql to see if i was manually installing it
> wrong, and nope same issue still.
>
>
>
>
>
> source 'http://
Hi all,
Say I had the following form:
<% form_for @user do |f| %>
<%= f.error_messages %>
<% f.fields_for :friends do |friends| %>
<%= friends.text_field :relationship_to_you %>
<% end %>
<%= f.submit "Submit" %>
<% end %>
Is it possible to access the current object within that field
I have set up the following relationships Rails 2.3.5 and on update I
am finding that orphaned records are generated. Are my relationships
wrong or is there a recommended way to manage these orphaned records
on an update. Code is detailed below:
class User
has_many :management_assignments, :forei
Hello,
Does anyone have any tips for minifying views and layouts?
IE removing whitespace
Thanks ahead
--
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 rubyo
Hello,
I'm sure all of you have done this before,
basically users can post new posts, but i want their names next to the
post.
I have a current_user helper method, but i dont know how to display a
static one next to that one post.
Anyhelp would be appreciated :) thanks
--
You received this me
my gem file already has it, any other solutions? I just decided to do
the package install of mysql to see if i was manually installing it
wrong, and nope same issue still.
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://git
On Sun, Apr 11, 2010 at 4:19 PM, Michael Michael wrote:
> I have yet to find a solution for this issue I have tried multiple
> things that I have found on google, but yet have i found a solution. If
> someone could help me and point me in the right direction I would be
> much appreciated.
>
> Than
I have yet to find a solution for this issue I have tried multiple
things that I have found on google, but yet have i found a solution. If
someone could help me and point me in the right direction I would be
much appreciated.
Thanks.
rake aborted!
uninitialized constant Mysql::Error
** Invoke
On Apr 11, 7:42 pm, Nick wrote:
>
> However, every request other than the first results in this error:
> "undefined local variable or method `acts_as_dashboard' for
> DashboardsController:Class"
> citing line 2 of app/controllers/dashboards_controller.rb :
> 1 class DashboardsController
Thanks guys.
What's strange to me is the idea that Rails testing is not
comprehensive, i.e., there are constants, e.g., zip codes, that you
will use in production that you didn't have access to in testing.
While I appreciate that testing is built on cases and not exhaustive,
I can think of situati
All the validations fail, even though the values in the params[] are
valid. Here is the error in the logs, this is very weird frustrating,
this should be pretty straightforward
rails version 2.3.5
Model =>
class LoyaltyBenefit < ActiveRecord::Base
belongs_to :merchant
validates_inclusi
Grar,
My recommendation would be to not pre-populate with a migration. I would
create a ruby script for that and have developers run that script to get
setup. Then I would run that script in the test/test_helper.rb setup or
where ever is appropriate if I wanted that data available in my tests.
@dirtbug:
I'm somewhat a newcomer myself, but found this article:
http://jeremyhubert.com/articles/debugging-in-rails.html
to be particularly helpful. It shows simple strategies for debugging
views, controllers and models.
Myself, I've gotten good mileage out of judiciously placed calls to
"
Hi Ahmed,
On Sun, 2010-04-11 at 19:05 +0200, Ahmed Abdelsalam wrote:
> Hi,
>
> I want to export some contents from my rails application to MS WORD .doc
> file
>
> Any help?
Google 'rails create word doc'.
Best regards,
Bill
--
You received this message because you are subscribed to the Googl
On Apr 11, 2:42 pm, Nick wrote:
> Hey Frederick. Thanks for the tip. That makes sense. It turns out that
> I didn't completely solve the problem of the plugin reloading, and I
> think what you described is the culprit.
>
> For some reason, ActsAsDashboard::ClassMethods is not being reloaded
> for
Hey Frederick. Thanks for the tip. That makes sense. It turns out that
I didn't completely solve the problem of the plugin reloading, and I
think what you described is the culprit.
For some reason, ActsAsDashboard::ClassMethods is not being reloaded
for each request.
I tried your suggestion of ch
I'm just a rails amateur, but I've been dealing with Prototype stuff a bit
longer and I bumped into this image preloading stuff already.
I don't clearing understand what you want to do while your images are
preloading and also what you want to do once they are preloaded and this is
pretty crucial a
Hi,
I want to export some contents from my rails application to MS WORD .doc
file
Any help?
--
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...
On Apr 11, 2010, at 4:15 AM, ChaosKnight wrote:
>
> On Apr 11, 3:43 am, steve ross wrote:
>> On Apr 10, 2010, at 9:32 AM, ChaosKnight wrote:
>>
>>> Hi, I am still very new to Ruby on Rails, but I'm busy with my first
>>> RoR website, everything went well, until I realized that my images
>>> didn
Steffen wrote:
> I think it depends on the application / website you want to build.
> For me and the applications I built with it, Ext JS and Rails have
> been the perfect combination.
>
> Not sure what you mean with losing a lot of the magic of Rails.
> I'm not a fan of erb/haml, partials and rjs
Great! Thanks a lot, guys!
--
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
Hi there,
how can I convert something like...
future_datetime - past_datetime (which results in a float)
into something like...
"21 days, 2 hours, 53 minutes, 1 seconds" ?
Does RoR have any nifty helper for this ?
Not that I know of, but there's examples out there...
http://www.google.c
On Apr 11, 4:48 pm, Tom Ha wrote:
> Hi there,
>
> how can I convert something like...
>
> future_datetime - past_datetime (which results in a float)
>
> into something like...
>
> "21 days, 2 hours, 53 minutes, 1 seconds" ?
>
Have a look at distance_of_time_in_words
http://api.rubyonrails.
Sorry, somehow didn't see the original message.
Smart RoR,
I love the clean separation of controllers and views you get when
working with Ext JS.
You basically build an API for your app right away. So in case your
app needs an API for third party stuff later, you already have that,
you just need
I think it depends on the application / website you want to build.
For me and the applications I built with it, Ext JS and Rails have
been the perfect combination.
Not sure what you mean with losing a lot of the magic of Rails.
I'm not a fan of erb/haml, partials and rjs.
The true magic for me in
Hi there,
how can I convert something like...
future_datetime - past_datetime (which results in a float)
into something like...
"21 days, 2 hours, 53 minutes, 1 seconds" ?
Does RoR have any nifty helper for this ?
Thanks a lot for any hint!
Tom
--
Posted via http://www.ruby-forum.com/.
Short question: what caching packages are available for Rails?
Details: My application requires data scraped from various web sites.
To date, I've used scripts to fetch the page in question. Since I never
want to hit a web site twice with the same query, I always save the raw
HTML so I can parse
map 'countres/:name', :controller => a, :action => b
class a < ActiveController
def b
params[:name]
end
end
--
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.
T
Hi everyone, I was wondering about an admin section for websites,
would I be better off to separate the admin controllers from the
public exposed controllers? At the moment I do this via a namespace,
but to me it seems more like a duplication...
Is this part of being RESTful?
Can you please tell
Rahul Mehta wrote:
> i have one comment controller to put comment on article
> i have used this form add in my website part or some other
> controller
> put two validation
>validates_presence_of(:name,:comment)
>
> code of other controller
>
>@comment = Comment.new
>@comm
Anthony Crumley wrote:
> Smart RoR,
>
> We went down the ExtJS path and it was a painful one. The widgets can
> provide a nice user experience but it comes with a high price on the
> development side. When you step off the golden path with Rails you lose
> a
> lot of the magic. We are in the p
Hi Samiron,
After looking at your relpy again I have edited the user and business
yml files to the following.
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
Business
one:
id: 1
name: Graham's Bar
user_id: 1
address: 112 O'Connell Street
province: Dublin 1
c
Hi, I am busy with a tourism website and I am almost done, but the
URL's is starting to bug me...
I am still a Rails noob, but I am eager to learn as much as possible.
I already make use of resource
routes, but I want to display the paths like this: /countries/
zimbabwe, and: admin/countries/southa
On Apr 11, 3:43 am, steve ross wrote:
> On Apr 10, 2010, at 9:32 AM, ChaosKnight wrote:
>
>
>
>
>
>
>
> > Hi, I am still very new to Ruby on Rails, but I'm busy with my first
> > RoR website, everything went well, until I realized that my images
> > didn't preload... On previous websites I used
Samiron Rony wrote:
> How did you write your Business and User models?
> What you are trying to do is as simple as a relation between User and
> Business model. And i guess it should be like the following:
>
> class User < AR::B
> has_many :businesses # or
> # has_one :business
> end
>
> cla
So I have the Ninja model which has many Hovercrafts through
ninja_hovercrafts (which stores the ninja_id and the hovercraft_id).
It is of my understanding that this kind of arrangement should be set
in a way that the associative table stores only enough information to
bind two different classes.
Mail version 2.2.0 has been pushed to RubyGems.org.
I have also updated ActionMailer to use Mail 2.2.0 which removes (finally)
all quoting and encoding of mail parts from ActionMailer, the methods in
ActionMailer worked for most use cases, but there were a lot of edge cases
they did not handle wel
Hi Anthony ,
Thanks for reply, its good to know that exception handling in rails is
done like this.
thanks
Rahul
On Apr 10, 2:05 pm, Rahul Mehta wrote:
> Hi Anthony,
>
> <% begin %>
> <%= render :partial => 'custom' %>
> <% rescue ActionView::MissingTemplate %>
> Default
> <% end %>
>
> wh
i have one comment controller to put comment on article
i have used this form add in my website part or some other
controller
put two validation
validates_presence_of(:name,:comment)
code of other controller
@comment = Comment.new
@commentgiven=Comment.find(:all,:conditions
58 matches
Mail list logo