similar to: Going nuts on ''\n'' to <br />

Displaying 20 results from an estimated 7000 matches similar to: "Going nuts on ''\n'' to <br />"

2006 Jan 10
15
KISS and DRY? Not even close!
Hi all, After working on my first rails app and having handed over some very sophisticated coding from a lot of you guys. My app does what I want it to do, but I''m no where near the end yet, and it seems that the KISS and DRY objectives already went down the drain. It could be lack of knowledge, only doing Ruby on (and) Rails for a month, but I''m stuck on the following:
2006 Jan 15
7
Include extra partial in layouts
Hi all, Does anybody know how to include a partial (next to @content_for_layout) in a layout file? I''m looking for a something like @partial_for_include => ''filename'' in my layout files. So a linked .rhtml file gets picked up from within a layout file. All my layout files (4 at the moment) have a <div class="navright"> tag, so one change in the
2006 Jan 28
3
DRY conflict with "Updated at" "Created at" "Deleted at" in view
Hi all, Are there any helpers or so for listview routines that suppres the three above mentioned columns? I''m currently exploring something like the code below. But it feels like I''m doing Rails'' work. # just for test purposes <div id="debug"> <% for col in Product.columns.map %> <%= col.name %> - <%= col.type %><br/> <%
2006 Jan 10
8
Noob: Child records not saved
Hi all, happily coding along, but it seems a belongs_to record is not saved. # Create some stuff def create_project @contact = Contact.new @project = Project.new(@params[''project'']) @project_contact = ProjectContact.new(@params[''collect'']) @project.project_contact = @project_contact contact =
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all, For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an object @project_contacts with "Name" from table Companies and "Firstname" and "Lastname" from table contacts. Any idea? Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS
2006 Jan 22
3
Formatting input/output of a text box
Hello, What''s the best way to handle formating of a text_area? I have a text_area in my rails app where people can leave comments and I''d like to automatically convert the line breaks into <br /> tags, or just simply wrap a whole paragraph in <p></p> tags. I''m currently doing the following in my comments controller to insert line breaks when the user
2006 Jan 03
3
Can I map 2 tables into one class
Can I map 2 tables into one class? Is there any pattern, e.g. using ActiveRecord aggregation? Thanks Szczepan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060103/fa2aed7c/attachment.html
2006 Jan 15
4
Redcloth gem properly installed ... still errors
Hi all, installed redcloth for using the object.attrib.textilize method in a template. Using 3.0.3 because it supoosedly works the best with rails 1.0.0. Keep getting the undefined method error. Did the require thingy, but no luck What would be the most I''m-a-guru place to put the require btw? Thanx. Gerard -- "Who cares if it doesn''t do anything? It was made with
2006 Mar 31
3
Updating to 1.1.0 crashes webrick on existing apps
Hi all, I''m (well was) running rails on debian. After the update to rails 1.1.0 newly created aps run great. But trying to start webrick for an old one makes me cry (see below). Any docs on how to ''migrate'' existing apps to the up and up? Thanx n Grtz Gerard. => Booting WEBrick...
2006 Jan 01
9
Child record becomes orphan
Hi all, I''ve got these company (has) contacts relational tables. I want to make sure a company can''t be deleted when it still has contacts. (because I can now, which results in nil like errors when listing the contacts ... obviously) Are there any helpers to do so, is Rails aware of this? Or do I need to put in a condition before destroying the company record in question
2006 Jan 04
7
recongizing the current controller in views
alright i am doing a simple self blog in ruby. Now iw ant to be able to determine which controller action i am in inside _form.rhtml. So if i am in new or the creation control than i want to insert the text box for topics else i want to display the topic base on id. (i could do those already, i just need help finding the right if statement.. something like (if currentpage ==
2006 Jan 06
2
IRB hex values
Hi all, Im working on a copy contact info into project method. Nosing aroundwith IRB I see a hex value. Named Contact:0x40ca01cc #<Contact:0x40ca01cc @attributes={"name"=>"GP-net", "id"=>"7", "lastname"=>"Petersen", "firstname"=>"Gerard"}> Why is it there like that and not in a human readable
2005 Dec 30
3
model - controller always one-on-one?
Hi All, Is it necessary to always have a controller per model? Rephrased: Would you end up jumping through hoops in the future if you have a controller called Customer in which you add methods to create new companies as well as new contacts? Thanx Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS
2006 Jan 08
4
ID from child table not handled by AR
Hi all, Im slowly moving forward, but there''s something a miss. I can save some relational records to tables, but only once. For an unknown reason, the primary key (id) of the child table is not automatically increased. (I can only perform one save, (the first records id field holds the value ''0'') and during the next save it says: Mysql::Error: Duplicate entry
2006 Jan 02
5
NoobyQ: how to work with a table of static lookup data??
Hello out there! Nooby question: What''s the "Rails" way to work with tables of relatively static lookup data? Objectively (I''m thinking); I don''t want to hit the DB each time, so for each lookup table, initialize a globally available hash with lable/value pairs... Am I on the right track? How would you do this kind of thing in Rails? Thanks! --
2005 Dec 31
7
Dynamic form? Not really!
Hi guru''s out there, Im happilly coding my first rails app, and all goes well. I find myself manually coding in a particular field all the time (company_id), that relates the contact to a company. The total coding of this form seems somewhat much. Could somebody tell me what Rails power I''m possibly missing and stuborn as I am trying to do myself? I was wondering if the
2006 Jan 04
5
check if a file exists?
Hello all! I have a list of people on a page, and some of this people have pictures of them stored on the web server. So I have an image tag like this on my page: <%= image_tag "/images/people/" + person.pers_id.to_s + ".jpg" %> But not all have a picture, so if the file for pers_id=1899 does not exist, i would like to display a custom image for that guy. How can I do
2005 Dec 23
5
Can''t get data from products into @order
I went throught the "agile web developemnt with rails" and Now I''m trying to ''enhance'' the code with some extra options. When I go to admin/shipping I want to include some data from the products table in with the order info listed. I can''t seem to get this to work. in my partial form I''m trying to add this: <td
2006 Jan 02
9
Generating nice tables
Making tables in templates is pretty easy, except for one minor problem. They tend to be fairly ugly. If you have a model with three attributes, it''s very easy to create an html table that looks like this.. Col1 Col2 Col3 A B D A B E A C F A C G Which becomes difficult to read when you have a lot of repeated data. What I would really like to generate
2006 Jan 04
4
HOWTO: Render partial in div
Hey- I''m using ROR 1.0 and script.aculo.us 1.5.1. I''ve been trying unsuccessfully to render a partial in a DIV, but can''t seem to get the right combination of stuff to make it work. There seems to be a few different ways of going about it. Right now I can render a partial. What do I need to to render the partial in a div? Here is what it looks like so far: #