Search Results

Search found 3 results on 1 pages for 'mrbrdo'.

Page 1/1 | 1 

  • REST Rails 2 nested routes without resource names?

    - by mrbrdo
    I'm using Rails 2. I have resources nested like this: - university_categories - universities - studies - professors - comments I wish to use RESTful routes, but I don't want all that clutter in my URL. For example instead of: /universities/:university_id/studies/:study_id/professors/:professor_id I want: /professors/:university_id/:study_id/:professor_id (I don't map professors seperately so there shouldn't be a confusion between this and /professors/:professor_id since that route shouldn't exist). Again, I want to use RESTful resources/routes... Also note, I am using slugs instead of IDs. Slugs for studies are NOT unique, while other are. Also, there are no many-to-many relationships (so if I know the slug of a professor, which is unique, I also know which study and university and category it belongs to, however I still wish this information to be in the URI if possible for SEO, and also it is necessary when adding a new professor). I do however want to use shallow nesting for "administrator" URIs like edit, destroy (note the problem here with Study since it's slug is not unique, though)... I would also like some tips on how to use the url helpers so that I don't have too much to fix if I change the routes in the future... Thank you.

    Read the article

  • Rails layouts per action?

    - by mrbrdo
    I use a different layout for some actions (mostly for the new action in most of the controllers). I am wondering what the best way to specify the layout would be? (Consider like I am using 3 or more different layouts in the same controller) I don't like using render :layout = 'name' that much. I did like doing layout 'name', :only = [:new] but it turns out I can't use that to specify 2 different layouts (e.g. if I call layout 2 times in the same controller, with different layout names and different only options, the first one gets ignored - those actions don't display in the layout i specified). I'm using Rails 2.

    Read the article

  • Omit attribute name from validation error message (at start of it)?

    - by mrbrdo
    I write code in English but I'm currently doing a site which is fully translated to another language (validation error messages included). However, I have a problem because validation error messages always seem to include the name of the attribute the error is on at the start of the error, e.g.: Title Prosimo izpolnite naziv fakultete. I want to get rid of the Title at the start, like so: Prosimo izpolnite naziv fakultete. Any help is appreciated. I would rather see if this can be solved without installing any 3rd party plugins. If it's possible to provide translations for attribute names, that would be a cool solution too, but I would still like to know how it can be done both ways (omit or translate).

    Read the article

1