Search Results

Search found 5 results on 1 pages for 'miquel'.

Page 1/1 | 1 

  • Remove .php extension (explicitly written) for friendly URL

    - by miquel
    htaccess to remove the .php extension of my site's files. RewriteEngine on RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ $1.php [L,QSA] Now, if I go to my site www.mysite.com/home works fine, it redirects to home.php but the URL is still friendly. But if I write this URL: www.mysite.com/home.php The home.php is served, and the URL is not friendly. How can I avoid this behavior? I want that if the user writes www.mysite.com/home.php, the URL displayed in the URL bar be www.mysite.com/home

    Read the article

  • Rails - inheritance hierarchy of classes where an subtipe can play two roles

    - by Miquel
    I need to model Owners and Rentees in an application, so you have stuff that is always owned by someone and can be rented for someone else. I first approached this problem with Single Table Inheritance because both types of person will share all attributes, so you would have a model called Person associated to a table people with Owner and Rentee inheriting from Person. The problem is that Single type inheritance discerns subtypes using a field type and therefore a record in the table can represent either an Owner or a Rentee but not both at the same time, while in the real context you can have an Owner which is renting something from another Owner and therefore that person is at the same time an Owner and a Rentee. How would you approach this problem? Would you use separated tables fro owners and rentees? Is there any other type of table inheritance in Rails?

    Read the article

  • Rails - inheritance hierarchy of classes where a subtype can play two roles

    - by Miquel
    I need to model Owners and Rentees in an application, so you have stuff that is always owned by someone and can be rented for someone else. I first approached this problem with Single Table Inheritance because both types of person will share all attributes, so you would have a model called Person associated to a table people with Owner and Rentee inheriting from Person. The problem is that Single type inheritance discerns subtypes using a field type and therefore a record in the table can represent either an Owner or a Rentee but not both at the same time, while in the real context you can have an Owner which is renting something from another Owner and therefore that person is at the same time an Owner and a Rentee. How would you approach this problem? Would you use separated tables for owners and rentees? Is there any other type of table inheritance in Rails?

    Read the article

  • Regular Expressions Cookbook Is in The Money—Win a Copy

    - by Jan Goyvaerts
    %COOKBOOKFRAME%You may have heard some people say that most book authors never get any royalties. That’s not true because most authors get an advance royalty that is paid before the book is published. That’s the author’s main incentive for writing the book, at least as far as money is concerned. (If money is your main concern, don’t write books.) What is true is that most authors never see any money beyond the advance royalty. Royalty rates are very low. A 10% royalty of the publisher’s price is considered normal. The publisher’s price is usually 45% of the retail price. So if you pay full price in a bookstore, the author gets 4.5% of your money. If there’s more than one author, they split the royalty. It doesn’t take a math degree to figure out that a book needs to sell quite a few copies for the royalty to add up to a meaningful amount of money. But Steven and I must have done something right. Regular Expressions Cookbook is in the money. My royalty statement for the 3rd quartier of 2009, which is the 2nd quarter that the book was on the market, came with a check. I actually received it last month but didn’t get around to blogging about. The amount of the check is insignificant. The point is that the balance is no longer negative. I’m taking this opportunity to pat myself and my co-author on the back. To celebrate the occassion O’Reilly has offered to sponsor a give-away of five (5) copies of Regular Expressions Cookbook. These are the rules of the game: You must post a comment to this blog article including your actual name and actual email address. Names are published, email addresses are not. Comments are moderated by myself (Jan Goyvaerts). If I consider a comment to be offensive or spam it will not be published and not be eligible for any prize. If you don’t know what to say in the comment, just wish me a happy 100000nd birthday, so I don’t have to feel so bad about entering the 6-bit era. Each person commenting has only one chance to win, regardless of the number of comments posted. O’Reilly will be provided with the names and email addresses of the winners (and those email addresses only) in order to arrange delivery. Each winner can choose to receive a printed copy or ebook (DRM-free PDF). If you choose the printed book, O’Reilly pays for shipping to anywhere in the world but not for any duties or taxes your country may impose on books imported from the USA. If you choose the ebook, you’ll need to create an O’Reilly account that is then granted access to the PDF download. You can make your choice after you’ve won, so it doesn’t influence your chance of winning. Contest ends 28 February 2010, GMT+7 (Thai time). Chosen by five calls to Random(78)+1 in Delphi 2010, the winners are: 48: Xiaozu 45: David Chisholm 19: Miquel Burns 33: Aaron Rice 17: David Laing Thanks to everybody who participated. The winners have been notified by email on how to collect their prize.

    Read the article

  • How to use form_tag to update params

    - by Tryskele
    I have been struggling with a problem in Rails for a couple of days and still could not find the solution. Could you help me with that? Problem: I have a search box that puts a :search_string entry in the params structure. I use a form_tag for that and it works fine. <% form_tag :controller=> 'items', :action => 'find' do %> <%= text_field_tag :search_string, params[:search_string] %> <% end %> The problem is when I want to add and update other params key-value (in another view), for instance :start_date, to filter the search_string result. Here is the code snipped that I use in the view: <% form_tag :controller=> "items", :action => "find", :params => params do %> <%= hidden_field_tag :date_start, '2010-04-01' %> <%= submit_tag 'April' %> <% end %> <% form_tag :controller=> "items", :action => "find", :params => params do %> <%= hidden_field_tag :date_start, '2010-03-01' %> <%= submit_tag 'March' %> <% end %> When I first click on "April" submit button, then the params is correctly passed to the controller (i.e. there is a params[:start_date]='April'). However when I try to click "March" button afterwards, the params[:start_date] is not updated. I definitely think this is a stupid newbie mistake, but I cannot figure out how to properly use the form_tag. Could you tell me if I am doing something work? Otherwise, could you advise me which is the best way to update the params using form_tag's ? Thank you very much in advance. Miquel

    Read the article

1