similar to: rhtml templates and syntax

Displaying 20 results from an estimated 10000 matches similar to: "rhtml templates and syntax"

2006 Aug 12
7
Override method in ActiveRecord
Hello, there is a method ActiveRecord::Base#exists? . I would like to override this method in a class ActiveRecord. Could anyone tell me how to do it? TIA -- Posted via http://www.ruby-forum.com/.
2006 Mar 30
13
Trying Agile book, found problem
Pg. 57 of Agile asks you to create a scaffolding by typing in ruby script/generate scaffold Product Admin Instead of generating everything, it only gives me exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ identical
2006 Mar 25
2
Current controller
Hello railists, I have a list of news headers on my index page. I would like to hide this list if current controller is ''news''. I put to main/index.rhtml "<% unless @controller == "news" %> list here news headers <% end %> . This doesn''t work. So, the question is how to get current controller name in template ? Thank You! -- Posted via
2006 Jan 25
9
connection_specification and adapter
Hi, I wish to know, how those class work exactly, where can I find the documentation? or can someone explain to me how a connection is made via those class??? Thanks you very much!!!! Saiho __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
2006 Feb 24
6
Duplicate entry - how to check if an id exist before saving?
How do I check if an entry exists before saving? Someone one told me to use the method find_or_create (or something like that) but it didn''t work because I think the version of rails that we have is not the most recent. I need a way to check if an id exists in the db before saving. Any suggestions? Thank you -- Posted via http://www.ruby-forum.com/.
2006 Feb 14
3
Can Ajax updates more than one <div>?
Hi, I wish to know, is it possible that Ajax can update more than one zone "<div>"???? like : <%= link_to_remote("Title", :update => ''mydiv0'', :url => {:action=>:say_hello} )%> <div id="mydiv0"> to be changed one</div> <div id="mydiv0"> to be changed two</div> When I execute the code, only
2006 Feb 27
6
One to Many example... please!
Hi, I am pulling my hair out trying to work out how to put together what should be a simple app in rails. The app is to CV''s so I have a table of CV''s and each CV can have multiple skills. Skills are in a 2nd table below; CREATE TABLE cvs( id INT not null AUTO_INCREMENT PRIMARY KEY, first_name VARCHAR(30) not null, family_name VARCHAR(30) not null, email
2005 Dec 11
9
LIKE SQL queries in rails
I''m trying to do something like: SELECT * FROM attachment WHERE filename LIKE ''%whatever%''; so my code is: @search = params[:search] @attachments = Attachment.find(:all, :conditions => ["filename LIKE ''%?%''", @search.to_s]) but that''s converting to: SELECT * FROM attachments WHERE (filename LIKE
2006 May 05
7
Testing model: test becomes dependent on previous test
Im having trouble with Testing models. im following the tutorials in the book Agile Web Development with Rails. if i execute the code product_test.rb, i get this error: ============================================================ 1) Failure: test_update2(ProductTest) [test/unit/product_test.rb:30]: <29.95> expected but was <99.95>. 3 tests, 11 assertions, 1 failures, 0 errors
2006 Mar 08
3
Run command via SSH session displaying results via AJAX
I am trying to create a web app that allows me to invoke a command on another server via an SSH session. I am currently doing this as follows: 1) User is presented with a form to enter server, command, username and password. 2) User clicks "Run" and form is submitted to the "run_command" action. 3) The "run_command" action initiates an SSH session using net-ssh
2006 Jan 25
2
Testing a model method - private method?
Hi everyone, I''m trying to test a method in my model: def html_email return "<a href=''mailto:" + self.email + "''>" + self.email + "</a>" end The method works ok. But when I try to test it: assert_equal ("<a href=''mailto:" + people(:staff1_person).email + "''>" +
2006 Jan 09
3
Thomas Fuchs Interview on Audible Ajax
Hi guys, I had the pleasure of interviewing Thomas Fuchs for "Audible Ajax", and thought that some of you may be interested to hear it: http://ajaxian.com/archives/audible-ajax-episode-12-thomas-fuchs-of-scriptac ulous Cheers, Dion Almaer Founder, Ajaxian.com http://ajaxian.com Cleaning up the web with Ajax
2006 Feb 20
6
LoginGenerator - multiple user types...
I have been looking at the LoginGenerator gem. Looks great and can be easily modified. However in my app I have two places where people can login, one is for in my case "employees" the other is for "users". They are seperate tables in my database and have many different fields. I have an admin area located at ./sysadmin/ where only "employees" can login, they
2006 Apr 03
4
Edit in Place in 1.1
Does anyone have a good example or know of some documentation about how to implement "Edit in Place" using Rails 1.1? Like the functionality in Flickr... I''ve googled and googled and can''t find any good documentation. Maybe it''s because 1.1 is so new? Thanks in advance. -Andy
2006 Apr 20
7
AJAX/RJS Updating of Table Rows
I''m trying to update a table row (i.e. replace a <tr></tr>) using AJAX/RJS but of course this cannot be done in IE (works fine in Firefox). I have googled but have not found any solutions, only a lot of discussion. Does anyone have a solution to this problem? Cheers, Nicholas
2006 Apr 04
9
Does ActiveRecord have support for "Boolean" columns?
Hey all -- I''ve been using enumerable char(1)''s with ''y'' and ''n'' values for my Boolean columns in Rails, but it strikes me there should be a better way. How do you setup columns that represent true/false-ness in your schemas on Rails? Wondering what kind of standard approaches there are other than me writing something like class MyEntity
2006 Mar 02
17
can''t get rails to connect to mySQL - HELP!!!!!!!!!
Sorry, but this is really NOT as easy as the tutorials/books make out. I''m really struggling at the first hurdle here. And while I''m not a programmer by design I do know my way around most stuff. And if I can''t get this to work I suspect more people will have the same issues. There seems to be too many variables to address. I have winXP, I have ruby and rails all
2006 Jan 31
4
has_one without inverse belongs_to
I have two models called entity and user. The entities table has a column called users_id that contains the user id of the user that created the entity. In entity I have... has_one :user ... as I want to be able to show the user who created the entity from the entity object. But this produces the following error... Mysql::Error: #42S22Unknown column ''users.entity_id'' in
2006 Jan 09
1
AR: Quoting in Join Model Test
Greetings made men of rails! I am presently writing a new database adapter for rails to bring the OpenBase community on board. In working through the rather extensive AR tests (which I very much appreciate), I have come across a question I can''t seem to answer on my own. In the test_has_many_with_piggyback(AssociationsJoinModel) the result is expected as a quoted integer
2006 Jan 25
11
Executing Ruby code that is inside a string
I would like to put Ruby code inside a string, between <%= %> tags, and have the code inside the tags executed when the string is displayed. Is this possible? -- Posted via http://www.ruby-forum.com/.