restful route customization
How can i customize restful route urls to friendly urls like stackoverflow ? i have stackoverflow.com/questions/424/ and i want to have stackoverflow.com/questions/424/title-of-the-page ...
How can i customize restful route urls to friendly urls like stackoverflow ? i have stackoverflow.com/questions/424/ and i want to have stackoverflow.com/questions/424/title-of-the-page ...
I have a model that uses the low level validate_on_create method, based on a simple condition I'm adding an error message to the field, e.g self.errors.add(:expiry_date, "is too soon") if self.expiry_date && self.expiry_date < Date.today + 1.week When rendering the view 'new' after a failed save the field isn't picked up by error_mess...
I am planning to travel this weekend (long 23 hour flight) so my mission is that by the time I get off that plane I want to be able to start developing on ROR. I am very well versed in PHP/.NET/Java so I don't think picking up Ruby would be that hard. However, I would like to get some input from those who made the transit from PHP/Java ...
Hi, I'm wondering what the best way is to store user settings? For a web 2.0 app I want users to be able to select certain settings. At the moment is it only when to receive email notifications. The easiest way would be to just create a Model "Settings" and have a column for every setting and then have a 1-1 relationship with users. B...
I am looking for a karma (reputation) plugin or gem for Ruby on Rails. Preferably one that was integrated many of the best practices and research around the topic of community management & development. Any recommendations? ...
NoMethodError in course_templates#index Showing app/views/course_templates/index.haml where line #6 raised: undefined method `new_course_template' for #<ActionView::Base:0x237c3e4> Extracted source (around line #6): 3: - content_for :sidebar do 4: %ul.links 5: %li= link_to "Add a Template", new_course_template(@provider) ...
I'm calling a controller action to do a search with an AJAX request from 2 different pages and want to render a different rjs file based on which page requested the action. I could just make 2 actions to do this but it doesn't seem very DRY when it's the same code in the action just need different rjs as it's displaying the search result...
Hello. I have 2 model classes with different attributes: class User < ActiveRecord::Base end class Subuser < User end When I call the 'new' function within controller: def new @subuser = Subuser.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @hosting } end end and try to access da...
Is there rails equivalents for : Merb::BootLoader.after_app_loads Merb::BootLoader.before_app_loads Merb::Assets::JavascriptAssetBundler.add_callback Merb::Assets::StylesheetAssetBundler.add_callback Thanks, ...
Folks, Want to make sure I understand this correctly. And please disregard the case for inheritance here (SentientBeing), trying to instead focus on polymorphic models in has_many :through relationships. That said, consider the following... class Widget < ActiveRecord::Base has_many :widget_groupings has_many :people, :through => ...
Hi. I have a Rails app where I was doing a general delete dialog with "are you sure" before it gets deleted. That's all fine, but I also have a small ajax on click to remove the block containing all the information. The block gets removed no matter what which makes things confusing. I couldn't seem to find any documentation online on how...
Hi everybody: let me do a bit of "concept mining" here: I am involved in mantaining/extending an application whose functionality is distributed across several servers. For example, we have a machine running the ApplicationServer, another running the DataServer and so on. This application has a Web Interface. The current UI is totally im...
maybe some ruby experts out there can shed some light on how activerecord know to do an insert or update when calling save(). what is the logic behind it? does it check to see if the primary key is blank or something and if so does an insert, if not an update? ...
I have an aggregated attribute which I want to be able ask about its _changed? ness, etc. composed_of :range, :class_name => 'Range', :mapping => [ %w(range_begin begin), %w(range_end end)], :allow_nil => true If I use the aggregation: foo.range = 1..10 This is what I get: foo.range ...
Hello, I'm trying to research how to add a subscription based pay model on an existing site of mine, but am running into a lot of conflicting information and caused me to be a bit lost. All I need is a very simple way to set up recurring billing (per month) by credit card. I just need a simple solution, but am having a hard time findi...
I am writing a migration generator for a plugin I am writing and I need to to be able to find what unique indexes a table has so I can modify existing unique indexes to become a composite unique index. I have been trying to find a way to access what indexes a table has with ActiveRecord. I have only been able to find ActiveRecord::Conn...
Hey. I have some xml on server (http://server.com/my.xml). Here is the example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE current PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <current> <song>Bruce - Inside The Machine</song> <song>02 Duel of the Fates 1</song> </current> ...
I'm working on a rails site that I've inherited and am trying to troubleshooting some sub-optimal model behavior. I have users, songs, and songs_download, each of which is its own model. Here's the relevant line from the users model: has_and_belongs_to_many :downloaded_songs, :class_name => 'Song', :join_table => :song_downloads F...
Hi all. Rails newbie here. I'm trying to get some class methods into named_scopes. My application structure is similar to a blog application with user comments. Each comment model has a score attribute determined by ratings made from other users. I want to be able to have a named scope that returns the top ten users with the largest tota...
I want to use a CI (Continuous Integration) Server for my Ruby on Rails Application. If the application were in Java, I should use Hudson CI Server. What is the best solution in Ruby on Rails? ...