similar to: Pretty URLs -> Routes

Displaying 20 results from an estimated 1000 matches similar to: "Pretty URLs -> Routes"

2006 Apr 02
1
One to Many Relationship Issues
Hi, I am having issues with a one to many relationship(it never works :-)). Jokes aside, I am getting an error: Mysql::Error: #23000Cannot add or update a child row: a foreign key constraint fails: INSERT INTO adverts (`image_url`, `price`, `title`, `website_url`, `description`, `user_id`) VALUES(''bb'', 22.0, ''aa'',
2006 Jul 21
1
Passing a variable between methods
Hi, I am trying to add search functionality to may application. I am struggeling to pass my query to the controller and then show all my search results in another view. How would I do this? Model: class Advert < ActiveRecord::Base belongs_to :user def self.search(query) if !query.to_s.strip.empty? tokens = query.split.collect {|c| "%#{c.downcase}%"}
2007 Aug 29
2
assign local variable instead of instance variable.
Hello, I have a view that generates a list of adverts with <%= render :partial => ''advert'', :collection => @adverts %> I have the render call described with @controller.template.should_receive(:render).with(:partial => ''advert'', :collection => @adverts) Bu when i was about to describe my partial i got stuck. My partial _advert.rhtml:
2006 Apr 02
5
Showing current user''s information and saving
Hi, I am logging users in and keeping them in session. The problem I am having is showing only a certain logged in user''s information. In the Adverts_Controler: def show @advert = Advert.find(params[:id]) end I am also having issues with saving an advert for an user: def create @advert = Advert.new(params[:advert]) if @advert.save flash[:notice] = ''Advert
2012 Nov 23
2
Samba4 - Bind Config with DHCP
To those who will eb able to assist, Platform: On Ubuntu 12.04 I have used the latest Git version. I have installed isc-dhcp-server and bind9 from the plain apt repositories and have configured DHCP and BIND9 so that DHCP can update DNS entries via the hmac-md5 as so: key rndc-key { algorithm hmac-md5; secret "XXXXXXXXXXXXXXXXXXXX==";} allow unknown-clients; use-host-decl-names on;
2006 Mar 31
1
Ruby 1.8.4 upgrade screws up ActiveRecord
Okay, so I upgraded to Rails 1.1 on my Windows development machine and everything worked fine. Then I went to upgrade to Ruby 1.8.4 from 1.8.2, launched WEBrick and browsed to 127.0.0.1:3000 and here''s what I get: Errno::EBADF in Front#index Bad file descriptor - connect(2) c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/vendor/mysql.rb:108:in
2008 Dec 21
1
flash fails to work on Los Angeles Times website - fix
Hello, I have a 32-bit install of C5.2 on my Intel Centrino Laptop (2005). The Adobe flash plugin works fine in Firefox in all cases except on the Los Angeles Times website http://www.latimes.com. I was baffled by this for a few months, since it works on another 32-bit C5.2 box. When I realized that the only real difference was that the laptop had no LAMP install, and both had the same elaborate
2010 Sep 12
11
Rails 3: finding a record by name in multilingual app
Hello, I upgraded my application from Rails 2 to Rails 3 and ran into a problem. In rails 2 I could use the english name of the record to find it like: Page.find_by_name("Welcome") even though the user chose German as the language (which of course showed the German welcome page. Eversince I switched to Rails 3 (default_locale still :en) I can''t find anything by giving the
2008 Jul 08
3
undefined method `name' ...........
Hi Community.... I''m new in this game, so this might be a easy question, but I have done my google, without result, so I will try this.... I''m learning ROR, and I''m using Patrick Lens ''Ruby on Rails'' book. (This is written for ror 1.x - and I''m using NetBeans 6.1 - ror 2.x - this might be the problem...) But... I have made this
2009 Aug 21
12
What to do before launching v1.0?
I’m launching a rails website, the app is written and works, undoubtedly it’ll be an unmitigated disaster when I launch but none the less I thought I’d least attempt to give myself the best chance of success by asking all the gurus here for some advice – pre launch advice if you like. In an ideal world I’d spend days and hours on all of these things and get it absolutely spot on, but as we all
2011 Jul 28
0
[LLVMdev] llvm-mc build failure
Dawie Joubert <djjoubert at csir.co.za> writes: > Recently (approximately a week ago) Clang and LLVM started to failed at > building. Assuming it was my incompetence, I cleared everything and > started witha fresh checkout (not that I changed it though). I am on > Ubuntu 10.04 LTS 64-Bit. And I configure and compile with CMake. > > The error message I get at approximatley
2006 Jul 17
10
getting the user name
Hi I am new to ruby and trying to obtain the user name in the login index.rhtml where I could display "You have logged in [user name]" How could I do this? I have been trying different options after reading the ruby manual but still throw an error. please help -- Posted via http://www.ruby-forum.com/.
2008 Aug 31
1
strange httpd error page using apache
I get this error page re-direct while opening a local webpage on my server, which carries me to yahoo for the error page filled with adverts. I'd really like to know how this one got here, as I just installed centOS a few weeks ago. http://wwwwh.found-not-help.com/search?qo=www.wayward4now.net&rn=3D9F6PY8wdYwGYX&rg= This just doesn't strike me as Kosher. And, I'm a southern
2011 Jul 27
2
[LLVMdev] llvm-mc build failure
Dear llvm, Recently (approximately a week ago) Clang and LLVM started to failed at building. Assuming it was my incompetence, I cleared everything and started witha fresh checkout (not that I changed it though). I am on Ubuntu 10.04 LTS 64-Bit. And I configure and compile with CMake. The error message I get at approximatley 66% is as follows: Linking CXX executable ../../bin/llvm-mc
2007 Jun 18
2
extending Array class with a method
Hi, Let''s say I have an ActiveRecord::Base class and I want to be able to call a method on an Array of these items. For instance, perhaps there''s a class called Country and another called business, and I''d like to be able to do something like great_white_north = Country.find_by_name(''Canada'') canuck_enterprises = great_white_north.businesses
2008 Aug 30
1
Heist of MagicJack SIP credentials?
While I myself am not a MagicJack user, I'm curious as to whether anyone here has managed to heist their MagicJack account's sip credentials, and use them to terminate calls using asterisk. Apparently it's as simple as sniffing the SIP credentials. If so, said person would enjoy unlimited termination for $20 year while retaining the flexibility of setting their CallerID to a
2006 May 29
4
Prompting user to enter value to feed Find
Hi, While viewing part of a long list of records, the user may want to do a Find of a specific record (for example, find_by_name). The found record is then displayed using the list view. I''ve searched the wiki and couldn''t find a sample or information that will help directly in implementing this function. Any pointers? Thanks! gk -- Posted via http://www.ruby-forum.com/.
2006 Apr 22
3
how do I manually throw a 404?
I''m sure this has been asked before but a quick search on the web didn''t give me any hints.. I''d like to do this: @person = Person.find_by_name throw_page_not_found unless @person Anybody know how to do this, do I have to manually tinker with the response object? -- Posted via http://www.ruby-forum.com/.
2005 May 06
4
Legality Issue & Relaying
Hi All, I'm planning to get a stream running in the next month or two, and will be using ices and icecast. Legality: Further to the last couple of posts regarding legality issue. I notice that the PRC do their licence cost on a percentage of your revenue, seeing as I plan to host no adverts or indeed any commercial aspect I hope to get a licence without actually paying anything. (I've
2006 Mar 02
3
Modifying "Find" to always add a condition?
I''d like to always add a condition to any version of "find" (e.g. Thing.find(), Thing.find_by_name(), Thing.find_by_whatever) so that in addition to whatever conditions are set, an additional condition is set :conditions=>"user_id=#{current_user.id}" I''d like to make sure that a user only sees/edits/creates entries in the database that have the user_id