I'd like my website to have URLs looking like this:
example.com/2010/02/my-first-post
I have my Post model with slug field ('my-first-post') and published_on field (from which we will deduct the year and month parts in the url).
I want my Post model to be RESTful, so things like url_for(@post) work like they should, ie: it should gen...
I wrote a web application in ROR, but I want it supports web service, so that I can do the same things on non-web application platform. What should I do to add web service ability to my web application... ...or I need to reinvent my application, to write a separate web service independently?
...
Hi
(Disclaimer: I am very new to rails)
This plugin looks like it will be a great fit for my app, but I am
having a hard time getting it to work. I am using it with authlogic, I
am not sure if that is the problem, but it seems like it may be.
When I try an access a page that my admin role should have access to I
get this:
Processing C...
I have isolated the problem in the second block of code below (if you don't want all the details): I can create new users from the account model. I can't assign those users roles from the accounts model. I am using fields_for, this method does not work when I attempt to assign the role_ids to the roles model. My db is set up in the follo...
I see posts from all sorts of time period talking about pre-built authentication plugins such as restful authentication - but looking at it, it seems that it wasn't updated since April 2008.
So I ask, what is the most current pre-built authentication plugin for rails 2.3.5?
Thanks!
...
I have an HTML element in a form with name product[prod_name]
how do get access to its value in my action using params
...
(Rails newbie)
Hello!
I am feeling like I am reusing a lot of my code and I feel there has to be a better way to do this... (I am sure there is...)
What I have is a Settings page, where you can create categories and procedures (which belong to a category).
index Settings action:
def categories_and_procedures
@prefs = @current...
Hi,
Hopefully someone can point me in the right direction. I have a en.yml file
en:
hello: "Hello world"
activerecord:
models:
recipe: "Recipe"
attributes:
recipe:
title: "Recipe title"
errors:
models:
recipe:
attributes:
title:
blank: "{{attribute}}...
Hi,
What is a good book to learn about web server architecture? I am a beginner Rails developer and want to go beyond Ruby. For example, I want to know what exactly a 'Mongrel cluster' is, rack-middleware, HTTP, etc. Is there a good book (or more than one) which covers this?
Thanks.
...
Hi I would like to understand how are the error messages displayed in ruby on rails, more importantly how is the order determined in which the error messages are displayed on the page.
Thanks for your time.
...
Hi I am keen on setting up a Linux box to play around with Rails, No-Sql, Mono C#... and opensource projects!
I am keen on learning Ruby on Rails and don't have a Mac so I think for now the cheapest option is to install a Linux distro on my computer. I am also keen on trying out MongoDB
I am a complete nube to Linux and am wondering if...
*Note to view all code, follow the link
I am creating new "accounts". Each new Account have_many :users. Users have_and_belong_to_many roles. I am trying to assign EXISTING roles to new users, in the new account form. Typically an easy process however...
The have_and_belong_to_many association between Users and Roles implies that user...
I'm trying to follow along with the thread on implementing an achievement system (located at http://stackoverflow.com/questions/885277/how-to-implement-an-achievement-system-in-ror), and am running into a TypeError when the object is saved and the method awarded? gets called. The error looks like:
TypeError (can't dump anonymous class C...
I am using jquery on my html page and want to have an onchange event on a collection_select.
If I add <%= javascript_include_tag :defaults %> then my jquery code does not work.
Basically I have a collection_select as follows:
<%=collection_select(:product, 'prod_name', @prods, :id, :prod_name,
{:prompt => 'Select Product'},{:onchan...
I'm pretty new to rails and haml.. and I can't get this to work right.
I have this partial (_head.html.haml):
!!!
%html
%head
%meta{'http-equiv' => 'Content-Type', :content => "text/html; charset=iso-8859-1"}
= stylesheet_link_tag 'main'
%body
And then in my application.html.haml:
= render :partial => 'shared/head'
#wrap...
I'd like to store some persistent data for each browser (user settings), and don't want to require a login to use the site. What's the bset way to achieve this?
I've considered two approaches:
Store the info in the session cookie. The problem with this approach is that I would need to set the expiration time on the session cookie, ...
I have a drop down. whenever user changes it to a particular field. I want to go back to the server (send the selected id) and get a response back. Response back will basically be 1 or 2
If it is 1. then I want to disable an element with id one
if it is 2. then I want to disable an element with id two
How can i achieve this using jque...
In rails + jQuery I am trying to make a get request back to the server when an option in the dropdown box is changed. I use the following jquery code:
$("#product_prod_name").change(function(){
$.get("/page/volume_or_quant", "id="+$(this).val(), function(result) {
alert(result)
})
})
now this is giving an error: Missin...
Hello
I am doing my first project in ruby on rails and I need to display a set of radio buttons, which values are taken from a database table. It should behave exactly like a selection list. But due for usability reasons I need it in a radio buttons format.
In my project I use the select collection which also allows me to display in the...
I'm creating a digg-like site using Ruby on Rails that ranks the item (based on this algorithm). I'm using the will-paginate gem list the items in pages.
The problem is, will-paginate only allows me to insert ':order =>' based on the table data. I would like to make will-paginate to sort by a number which is calculated using a function ...