I have a select Menu with a few options
<p>
<%= f.label :reason %><br />
<%= f.select :reason, Confirmation.reasons.collect {|p| [ p[:name], p[:id] ] }, { :include_blank => true } %>
</p>
The last being id "5" and name = "Other"
If and only if they choose other I want a hidden text_area with a div id = "other" to be shown...
ROR scaffold is useful, but I always find myself removing the respond_to part in the generated controllers.
Is it possible to tell Rails not to generate that part?
...
I'm using the popular restful authentication app/tutorial found here: http://railsforum.com/viewtopic.php?pid=74245#p74245
I have been using the app extensively and everything works great. The only issue that I'm having is that it takes anywhere from 60 seconds to several minutes for the system to process the creation of a new user. T...
I haven't used Rails, but I'm somewhat familiar with it. I'm more familiar with CakePHP. I get the idea that CakePHP is modeled after Rails, and they seem to have a lot in common.
But, basically, I'd like to know if patterning itself after Rails is, or has ever been, one of the goals of CakePHP? I understand it's not a port, but is R...
I have a list of params with names and values like this:
date_2009-09-16 => ["50.00"]
date_2009-09-17 => ["60.00"]
date_2009-09-18 => ["90.00"]
I would like to save a record in my database for each date like this:
|id | date | price|
|1 | 2009-09-16 | 50.00|
|2 | 2009-09-17 | 60.00|
|3 | 2009-09-18 | 90.00|
How do I extrac...
Hi,
I have extended the ActiveRecord::Base class as follows:
lib/activerecord_ext.rb:
class ActiveRecord::Base
named_scope(
:recent,
:conditions => ['created_at > ?', (Time.new - 3.day)],
:order => 'created_at DESC',
:limit => 5
)
end
In config/environment.rb:
require "activerecord_ext"
This works fine unt...
Hi
I am trying to add a filter to a controller that is based on a certain role (using role_requirement) and then on the company_id that each user has.
So basically I need something like this:
require_role "company" ** This is working fine
before_filter :company_required
def company_required
unless current_user.company_id == Compan...
Running:
Apache 2.2.3
Ruby 1.8.7
Rails 2.3.4
Passenger 2.2.5
Error message:
/var/www/derscheidfamily/app/controllers/greetings_controller.rb:14: syntax error, unexpected '/', expecting '\n' or ';'
def app/controllers
^
/var/www/derscheidfamily/app/controllers/greetings_controller.rb:20: syntax error, unexpected '/', expecti...
I want to store emails into a database and then have them displayed properly in Ruby on Rails to the user (ideally with a nicely formatted, collapsible header, attachment support, etc). Is there already a good way to do this?
Right now, I store the emails to the database as a text, but I am struggling with a good way to display them to...
Hi, I just started testing a new rails project, and I want a feature to webthumb the url into image.
And now I want to test this feature.
I'm trying to use the ThoughtBot family - shoulda factory-girl paperclip.
For mocking, mocha.
How can I test this feature?
...
Hello,
I need to have two separate pages on the site I'm planning to build that are very similar that I don't need to introduce new DB tables or models. I would also like to stay RESTful.
If I'm to use the same controller/model I will need to have new methods other than standard index, new, edit...etc which makes it non-restful or I w...
Am trying to simplify the create / edit view for a multi-model controller.
User can dymically add / remove child input fields from the form. (Have followed Eloy's complex form example)
I want to limit the user's ability to set certain attributes across multilpe children..
Suppose I have a child attribute with and I want the user to...
I'm developing an application with Ruby on Rails that I want to maintain for at least a few years, so I'm concerned about the next version coming up soon.
Going from Rails 1 to Rails 2 was such a big pain that I didn't bother and froze my gems and let the application die, alone, in the dark.
On this project I don't want to do that. Fi...
Hello there,
I'm having a little trouble using jQuery in Rails.
I'd like to call the destroy method for a specific list item and then remove it from the list via ajax. My code is pretty simple:
# _web_profile.html.erb - The partial containing the link to destroy:
<%= link_to 'Remove', web_profile, :method => :delete, :class => 'remove...
I have a Rails app that needs to send out emails with a particular (MS Word) document attached. Where is the best place to put that document file?
In general, in my Rails app, if I do File.read("myFile.doc"), what directory or directories will it look in for that file?
...
I'm following this guide, http://www.2dconcept.com/jquery-grid-rails-plugin, to setup a sample jQuery datagrid.
Everything appears to be good, but when I go to http://127.0.0.1:3000/users, I get this:
NoMethodError in Users#index
Showing users/index.html.erb where line #12 raised:
You have a nil object when you didn't expect it!...
var location = { "location" : {
"name" : $("#user_loc_name").val(),
"street_address" : $("#user_loc_street_address").val(),
"city" : $("#user_loc_city").val(),
"province" : $("#user_loc_province").val(),
"country" : $("#user_loc_country").val(),
"postal_code" : $("user_loc_postal_code").val(),
"publ...
I have a User model. If I do:
def my_action
@user = User.new
end
then
<% form_for(@user) do |f| %>
I get
undefined method `users_path' for #<ActionView::Base:0x1b4b878>
Which make sense because I haven't mapped it going map.resources :users... but I don't want to do it this way because I don't need all the resources.
How ca...
Hi ,
I am doing a hobby project to scrape the content of an ASP.net website using Ruby or PHP or Java . For example if the website url " www.myaspnet.com/home.aspx" . i would like to extract the unicode text content from home.aspx and paste it to a notepad . Is there any libraries available in any of the above mentioned languages ...
New to rails...so bare with me.
I successfully installed and set it up searchlogic for basic (keyword) searching. I have the following problem:
@search = Proposal.search(params[:search])
@proposals = @search.all
The above code works properly if I type in a keyword such as "red". It will bring up everything with red keyword. Or if I t...