I am trying to build a search functionality which at a high level works like this.
1 - I have a Search model, controller with a search_set action and search views/partial to render the search.
2 - At the home page a serach form is loaded with an empty search object or a search object initialized with session[:search] (which contains use...
In coding up your view templates you can render a partial and pass an array of objects to be rendered once per object. OR you can use a For blank in @blank loop. How do you decide when to do which? It seems that if you use a partial for every iterable object you will end up having to modify tons of separate files to make changes to poten...
My question really is can you do EVERYTHING in PHP that you can do in (Ruby)Rails/Django(python)? By me just concentrating on PHP (Framworks too) will i be losing out in someway? I prefer PHP but everyone tells me Rails is better?
Any advice?
Thank you in advance ;-)
...
I think I might be misunderstanding something about Rails sessions, so please bear with me, I might not be phrasing my question the best way.
I'm working on an iPhone app with a Ruby on Rails backend. I have a web view which by default goes to the index action of one controller (and uses sessions), and in the background a bunch of API ...
I was wondering if someone can explain how can a rails application be balanced.
Two questions:
Does it even help having separate rails applications reading from the same database in the same dedicated server?
I understand Apache can balance load installing some extra modules? am i right? how can we accomplish this? (please provide exp...
Currently I have a Web API running on Heroku that is constantly writing information we're collecting from other data sources (currently theres about half a GB of data and it's growing very quickly). We're looking to add a reporting system on top of the current database that we can use to extract useful information out of the DB. The pr...
I'm using the standard Rails I18n API to localise some of our views. This is working really well, but we now have a few use cases for regional changes to the en locale.
The API guide mentions that this isn't supported directly, and other plugins should be used. However, I'm wondering whether there's a simpler way to do this.
I alread...
Hello,
I'm wondering about the clever way to do this...
I have methods that return a value when passed an an object as parameter, such as:
<%= average_rainfall(@location) %>
I'd like to use the exact same methods as a nested resource to call via jQuery/Ajax, like so:
.load('/location/8/average_rainfall')
I understand how to define t...
I would like to know, how to upload documents like word, pdf using Rails. Can I use paperclip for it?
...
Take a model with an attribute that is an array of strings. This attribute is serialized to the database.
class MyModel < ActiveRecord::Base
serialize :str_array
end
In the edit view I would like to display a text field for each element of the array allowing the user to view and modify the attributes elements.
...
Hey guys,
I am trying to get a collection of objects based on a conditions. Now normally in C# I would do something like this
employeesCollection.Where(emp => emp.Name == "john");
how can I do something similar in Ruby on Rails (I am trying to map a collection of objects to a select but I only want to map certain objects that match a...
I have been trying to get paperclip working for a few days now with no luck! From what I am aware this error below is related to imagemagick. I have tried to uninstall and install imagemagick both with macports and manually. Also, have Paperclip.options[:command_path] = "/usr/local/bin" set. It's starting to drive me nuts!
Photo /var/fo...
I use link_to_remote to pull the dynamic contents of a partial onto the page. It's basically a long row from a database of "todo's" for the day.
So as the person goes through and checks them off, I want to show the updated list with a line through those that are finished.
Currently, I end up needing to click on the link_to_remote agai...
Newly added description: (sorry for not mentioning)
The ApplicationController.current_account is defined as:
class ApplicationController < ActionController::Base
class << self
def current_account
@current_account
end
def current_account=(value)
@current_account = value
end
end
=========
I encountered ...
Jon-MacBook-Pro:rubygems-1.3.7 jon$ sudo gem install rails
Password:
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SocketError: getaddrinfo: nodename nor servname provided, or not known (http://rubygems.org/gems/activesupport-2.3.8.gem)
...
I am not able to validate passord with ()-=_+ , i.e it should accept these special characters but its not working when i use the regular expression as
`validates_format_of :password, :with => /^[A-Za-z0-9. ! @ # $ % ^ & * ( ) _ - + = ]*\z/`
its only excepting till * but not accepting ()-=_+ in ruby on rails.
...
Using the current rails 2
I want users to be able to create an account from:
traditional signup
twitter
facebook
and then allow them to link facebook and/or twitter and/or traditional signup later.
I read this http://www.themomorohoax.com/2009/02/21/rails-2-3-authentication-comparison
and decided to check out:
Authlogic
Restful ...
Hi, I have used globalize2 to add i18n to an old site. There is already a lot of content in spanish, however it isn't stored in globalize2 tables. Is there a way to convert this content to globalize2 with a migration in rails?
The problem is I can't access the stored content:
>> Panel.first
=> #<Panel id: 1, name: "RT", description: "...
Just to make one thing clear, it's not completely a programming question but a programmer might know what's wrong:
Messed up my gem installation. If I execute "gem list" or any other gem command, I get
/Library/Ruby/Site/1.8/rubygems.rb:956:in `use_paths': undefined method `join' for #<String:0x101786480> (NoMethodError)
from /Librar...
As the title said, I got a problem! i encountered the "RJS Error:[object error]",the code in my application is
page << "#{hidden_print("#{url_for(:controller => 'tables', :action => 'dispatch', :id => id, :pop => true, :print =>true)}")} "
the method hidden_print is
def hidden_print(url)
"window.parent.headFrame.document.all.i...