Search Results

Search found 9437 results on 378 pages for 'rails newbie'.

Page 133/378 | < Previous Page | 129 130 131 132 133 134 135 136 137 138 139 140  | Next Page >

  • How do I edit .htaccess to allow both rails and wordpress requests?

    - by jakefuentes
    I want to run an instance of wordpress within my rails app. I currently have wordpress files housed in public/wordpress, but I need to configure my .htaccess file to allow both types of requests. How do I do that? currently, .htaccess is: General Apache options AddHandler fcgid-script .fcgi RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)/!$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] ErrorDocument 500 "Application error Application failed to start properly"

    Read the article

  • Rails 3: How to validate that A < B where A and B are both model attributes ?

    - by Misha Moroshko
    I would like to validate that customer_price >= my_price. I tried the following: class Product < ActiveRecord::Base attr_accessor :my_price validates_numericality_of :customer_price, :greater_than_or_equal_to => my_price ... end (customer_price is a column in the Products table in the database, while my_price isn't.) Here is the result: NameError in ProductsController#index undefined local variable or method `my_price' for #<Class:0x313b648> What is the right way to do this in Rails 3 ?

    Read the article

  • How to implement "short" nested vanity urls in rails?

    - by UnSandpiper
    I understand how to create a vanity URL in Rails in order to translate http://mysite.com/forum/1 into http://mysite.com/some-forum-name But I'd like to take it a step further and get the following working (if it is possible at all): Instead of: http://mysite.com/forum/1/board/99/thread/321 I'd like in the first step to get to something like this: http://mysite.com/1/99/321 and ultimately have it like http://mysite.com/some-forum-name/some-board-name/this-is-the-thread-subject. Is this possible?

    Read the article

  • Is it possible to route heroku-rails-app to a subdirectory of my custom domain?

    - by ernd enson
    I want to setup a rails app on heroku that is part of a website. The website which is hosted on a different server explains the usage of the app, shows a tour, plans, contains a blog on related stuff and so on. I want to route to my_domain/app and the app should respond to that url. The custom_domain add-on doesnt allow to enter directories. How can I configure that or how would you realize that scenario?

    Read the article

  • Rails 3 beta 3 -- is it time to start using this for new projects?

    - by TMB
    Is it time to start new projects in Rails 3? I'm nervous about using beta versions but at the same time I really like what they are doing and don't want to deal with legacy 2.3.5 issues with these apps. Is it better to wait these things out, or buckle-up, deal with early adopter issues and get a head start on the future. Thanks for any light you can shed.

    Read the article

  • What's the best way to generate an API reference document using a Rails routes.rb file?

    - by RNHurt
    I am trying to document the API for my Rails application and I can't help but wonder if there is a better way to generate an XML file based on my routes.rb file. I'm envisioning something similar to the output of rake routes but in a more friendly, XML type format. Corey has some interesting ideas about using reflection/introspection on the routes file here but it's not quite what I need. Please tell me this is a solved problem and I'm not the first one to think of this. :)

    Read the article

  • Why so many ASP.NET programmers play with Ruby on Rails after working hours?

    - by ITmeze
    I saw that on so many blogs. Lots of the people that were dealing with ASP.NET tend to play with Ruby on Rails after working hours. And It is just a matter of last one or two years. Why is it like that? Is it because when ASP.NET MVC showed up people become more open-minded - having joy with programming again they realize that some other folks had that many years ago, and they do not want to miss what they currently have?

    Read the article

  • Is there a way to have three way habtm associations in rails / activerecord?

    - by txwikinger
    Often three (or more) way associations are needed for habtm associations. For instance a permission model with roles. A particular area of functionality has many users which can access many areas. The permissions on the area are setup via roles (habtm) The user/roles association is also habtm The permissions (read, write, delete, etc) are habtm towards roles. How would that be best done with rails/activerecord?

    Read the article

  • Moving rails javascript to public while keeping ruby code?

    - by tesmar
    Hi guys, I have a project to move some JS code outside of rails into the public direcotry, but some of it has ruby code embedded, and depends on the values of the variables from the controllers to set some of its code. How can I move it out of the view and still maintain the same structure, or do I need to just rewrite the JS from scratch?

    Read the article

  • Which PHP framework is closest to Ruby on Rails? CakePHP? CodeIgniter?

    - by Mike Duncan
    I'm going to be switching back and forth between Ruby on Rails projects and some as-of-yet undecided PHP MVC framework projects. Which of the PHP MVC frameworks out there (CakePHP, CodeIgniter?, others?) is most similar to Ruby on Rails in that the most conventions, locations, workflows, etc are preserved? I'm looking for the similarity in the way things are done such as directory structures, conventions, etc, not a pros vs cons in speed, extra features, etc.

    Read the article

  • Memcache on ubuntu server lucid and ruby 1.9.1

    - by Thiago
    I'm trying to set up a memcache server on the above setup. I'm getting the following error: /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant MemCache (NameError) from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in `const_missing' from /root/voicegateway/vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb:18:in `<class:MemcacheQueueClient>' from /root/voicegateway/vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb:14:in `<module:Clients>' from /root/voicegateway/vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb:13:in `<module:Workling>' from /root/voicegateway/vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb:12:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /root/voicegateway/vendor/plugins/workling/lib/workling/remote/runners/client_runner.rb:2:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /root/voicegateway/vendor/plugins/workling/lib/workling/remote/runners/starling_runner.rb:1:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /root/voicegateway/vendor/plugins/workling/lib/workling/remote.rb:3:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:380:in `load' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:380:in `block in load_file' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:379:in `load_file' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:259:in `require_or_load' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:425:in `load_missing_constant' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' from /root/voicegateway/config/environments/development.rb:20:in `block in load_environment' from /var/lib/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:386:in `eval' from /var/lib/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:386:in `block in load_environment' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' from /var/lib/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:379:in `load_environment' from /var/lib/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:137:in `process' from /var/lib/gems/1.9.1/gems/rails-2.3.8/lib/initializer.rb:113:in `run' from /root/voicegateway/config/environment.rb:9:in `<top (required)>' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `block in require' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in' from /var/lib/gems/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require' from /var/lib/gems/1.9.1/gems/rails-2.3.8/lib/commands/server.rb:84:in `<top (required)>' from ./server:3:in `require' from ./server:3:in `<main>' But memcache-client 1.8.3 is on the gem list. What's the problem?

    Read the article

  • Avoid loading unnecessary data from db into objects (web pages)

    - by GmGr
    Really newbie question coming up. Is there a standard (or good) way to deal with not needing all of the information that a database table contains loaded into every associated object. I'm thinking in the context of web pages where you're only going to use the objects to build a single page rather than an application with longer lived objects. For example, lets say you have an Article table containing id, title, author, date, summary and fullContents fields. You don't need the fullContents to be loaded into the associated objects if you're just showing a page containing a list of articles with their summaries. On the other hand if you're displaying a specific article you might want every field loaded for that one article and maybe just the titles for the other articles (e.g. for display in a recent articles sidebar). Some techniques I can think of: Don't worry about it, just load everything from the database every time. Have several different, possibly inherited, classes for each table and create the appropriate one for the situation (e.g. SummaryArticle, FullArticle). Use one class but set unused properties to null at creation if that field is not needed and be careful. Give the objects access to the database so they can load some fields on demand. Something else? All of the above seem to have fairly major disadvantages. I'm fairly new to programming, very new to OOP and totally new to databases so I might be completely missing the obvious answer here. :)

    Read the article

  • Returning an integer from a select box - JavaScript

    - by Ross
    Very simply, I want to be able to access the year from the select box as an integer. In my test, my alertbox is telling me the value is undefined. <form name="form1" method="post" action=""> <label>birth year <select name="birth year" id="dueYear"> <OPTION VALUE='' SELECTED>--Year--</OPTION> <OPTION VALUE='2011'>2011</OPTION> <OPTION VALUE='2010'>2010</OPTION> <OPTION VALUE='2009'>2009</OPTION></SELECT> </select> </label> </form> <script type="text/javascript"> var dueDateYear = parseInt(document.getElementById("dueYear")); </script> <button onclick="alert(dueDateYear)">Click Me!</button> All I want it to do, is tell me the year I have selected -- any help would be appreciated, I am a newbie :(

    Read the article

< Previous Page | 129 130 131 132 133 134 135 136 137 138 139 140  | Next Page >