I've just switched from radrails to netbeans. So far, so good. But I have noticed that radrails used to serve up pages a lot faster on localhost. I've left the server on glassfish, what can I do to make it run faster I'm on windows xp
...
Hi,
what is the best way to show a spinner?
I have prepared a div(id="spinner"), that should be visible during loading.
Best regards
...
I have a test in RSpec which compares to long text strings. When the test fails, I get a message like this:
'jobs partial should render the correct format for jobs' FAILED
expected: "Job {\n\tName = \"name1-etc\"\n\tType = Backup\n\tMessages = Daemon\n\tPool = Default
\n\tSchedule = \"schedule1\"\n\tStorage = storage1\n\tClient = \"name...
I have this code
User.find(:all, :limit => 10, :joins => :user_points,
:select => "users.*, count(user_points.id)", :group =>
"user_points.user_id")
which generates following sql
SELECT users.*, count(user_points.id)
FROM `users`
INNER JOIN `user_points`
ON user_points.user_id = users.id
GROUP BY u...
I am implementing a wizard like interface which will help a user configure application settings.
I am using the AASM plugin to guide the user from state to state with the ability to go forward or backward through the configuration. I have implemented a skeleton of this core functionality and it is functioning as expected.
The problem I...
how to call a different controller's action using link_to_remote
:url => {:controller => "Posts", :action => "update"} doesn't work
...
One of the feature I like in RoR is the db management, it can hide all the sql statement, also, it is very easy to change different db in RoR, is there any similar framework in Python 3000?
...
Hello,
how can I use link_to_remote inside of a controller?
I have already included ActionView::Helpers::JavaScriptHelper, but still get the error:
undefined method `content_tag'
Thanks!
...
I'm using Paperclip to allow users to attach things, and then I'm sending an email and wanting to attach the file to the email. I'm trying to read the file in and add it as an attachment, like so:
# models/touchpoint_mailer.rb
class TouchpointMailer < ActionMailer::Base
def notification_email(touchpoint)
recipients "[email protected]...
Hi Guys,
I am have started learning Rails, it was going good until now.
I am using HAML and have this on my index.haml
= submit_to_remote "submit_btn", "Create", :url => {:controller => "queries", :action => "create"}, :method => "post"
= submit_to_remote "exe_btn", "Execute", :url => {:controller => "queries", :action => "execute"},...
The following is the app/models/websites.rb
class Masterpiece < ActiveRecord::Base
validates_presence_of :title, :link
validates_uri_existence_of :link, :allow_redirect => false
end
The second validation is from the plugin Validates Existence of URI plugin
The following is the features/support/mocha.rb file
require 'mocha'
W...
I have a trip that has many residencies. I need a single query that returns all trips where no residency information has been specified. And all trips that match a specified residency.
I can get the first from this query:
SELECT * FROM `trips` WHERE (((NOT EXISTS (SELECT id FROM residencies WHERE trips.id = residencies.trip_id))
Bu...
Hi,
I'm doing some page scraping for a client and need to connect to their
vpn server. So I have the vpn client running on my linux box, and this
creates a new interface, say ppp0. Now, when I run Mechanize/open-uri,
etc. I need to be able to bind specifically to this particular
interface, because the other interfaces are to the intern...
I am accessing a database that I can't change and it has a column named valid defined. Anytime I try to access an attribute, I get this exception:
valid? is defined by ActiveRecord (ActiveRecord::DangerousAttributeError)
The exception makes sense, but since I'm not able to change the database, how can I get around this error?
I tried ...
I am looking for a good solution for a probably typical problem of managing models with HABTM association in Rails.
Let's assume that we have two models -- products and categories:
Products
has_many :categorizations
has_many :categories, :through => :categorizations
Categories
has_many :categorizations
has_many :products, :thro...
I'm creating an API service which allows people to provide a URL of an image to the API call, and the the service downloads the image to process.
How do I ensure somebody does NOT give me the URL of, like, a 5MB image? Is there a way to limit the request?
This is what I have so far, which basically grabs everything.
req = Net::HTTP...
Hi,
I have this funny situation whereby I see my before_filter executing multiple times for one access.
My filter is called auth_user_filter and it logs using logger.info("Yada Yada Yada"). It gets set globally to run before all actions. When I access an action over my browser it prints the following (depending on what call it is)
The...
Hi!
I am updating a page through AJAX using .rjs template. Is there any way to block evaluating javascript in rendered content (something like :script => false for link_to_remote)?
My update.rjs looks pretty much like this:
page.replace_html 'some_div', :partial => 'partial_with_js', :collection => @list
page.insert_html ...
(etc.)
...
Hello.
I would like to know if it is possible to call a method from a model after using find.
Something like after_save, but after_find.
Thank you,
Gabriel.
...
What javascript effect/ui libraries are the best that also have Rails helpers and all that?
Which ones do you use. Seems like people use jQuery with either scriptaculous or yui for the interface elements... Is there anything that's particularly easy or best that's supported in a Rails gem or something similar that you recommend?
...