similar to: If / Else Form layout question.

Displaying 20 results from an estimated 200 matches similar to: "If / Else Form layout question."

2011 May 20
3
How to handle non model data in form?
Hey, I got a form which looks like this: - form_for(@article, :html => {:multipart => true}, :url => articles_path) do |f| = errors_for(@article) .field = f.label :text %br = f.text_field :text .field = f.label :author_id %br = f.text_field :author_id .actions = f.submit But since I don''t want anyone to type in an author id I changed it
2005 Apr 20
4
Error in tutorial or sintax changed?
Hi, In this tutorial http://wiki.rubyonrails.com/rails/show/HowtoUseJoinsWithFindAll it sad: sql =<<SQL SELECT articles.*, authors.name AS author_name FROM articles LEFT JOIN authors ON author_id = authors.id SQL and this return *app/controllers/media_controller.rb:366: can''t find string "SQL" anywhere before EOF* what is wrong? the tutorial or ruby changed? please,
2007 Mar 25
5
Insert text into text area field with RJS
Hi, I''d like to insert/append some default text into a text area after clicking on an image button ''test.png'' in edit.rhtml: <%= link_to image_tag("test.png"), url => { :action => :new_text } %> Action: # article_body is the textarea''s id. def new_text render :update do |page| page.insert_html :bottom, :article_body,
2007 Apr 13
5
undefined method `ferret_index'' for xxx:Class
Hi I am trying to use ferret; the regular search works; but when I use the find_storage_by_contents to highlight the results, I am getting the above error. Please help thanks -- Posted via http://www.ruby-forum.com/.
2006 Jun 11
3
[SUMMARY] Rails Core Weekly June 5 - June 11
Dear list, This weeks RCW has a slightly different format than before. After all, since what we want is less bloat, this RCW is less verbose. Please do let me know what you think off-list. *Interesting stuff on the Rails Timeline* _Fixed and commited to trunk:_ An issue with not null columns in SQLite3 migrations(<a
2008 Jan 15
7
PHP indexing, what's the PHP method for indexscript
Currently I have the following indexscript: pid : unique=Q boolean=Q field=pid postdate : field=startdate author_name: unhtml boolean=XAUTHORNAME field=author author_id: boolean=XAUTHORID field=authorid url : field=url sample : weight=1 index field=sample How can I create the same indexing using PHP? With this, I can get an searchable index, but I have no idea how to set the fields, so that I
2005 Sep 13
5
acts_as_taggable 1.0.4 now gemified!
Hi Folks, The acts_as_taggable mixin is now available as a shiny gem. More details here: http://dema.ruby.com.br/articles/2005/09/13/acts-as-taggable-gemified This release features some cool additions as well. Cheers Dema -- http://dema.ruby.com.br - Rails from a .NET perspective
2006 Mar 08
7
Function could determine the caller action ?
Is it possible to determine which action call the function ? In example, func_test in ApplicationController could determine which action from SiteController is calling her ? in class ApplicationController I have def func_test if ( calling from index ) return "1" end if ( calling from contact ) return "2" end end and in class SiteController def
2006 Jul 18
4
Multiple Layouts - Single Controller
How do I do multiple layouts for a single controller: I am aware I can do... render(:layout =>''mylayout'') for individual actions, however this becomes a multiple render problem. I tried this... layout "mylayout", :except => [:myaction, :myotheraction] layout "myotherlayout", :only => [:myaction, :myotheraction] However that doesn''t
2010 Sep 06
5
how to call rails method from javascript method.
hi I wanna call rails method from the javascript method. It should be ajax call for rails method. please help me. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe
2006 Oct 19
3
joins and table names in ferret
I''m having trouble figuring out how to do Ferret queries across multiple tables as you would in a normal SQL call. For example, let''s say I have two ActiveRecord classes, Book, and Author, where Book has a ''description'' field and Author has a ''name'' field, and where Book has a belongs_to relationship with Author (Book belolngs to Author,
2006 Apr 20
8
2 layouts per .rb page
Hi, Is this possible ive got layout "loggedout_layout", :only => [:login, :logout] but I also want to do somthing like layout "loggedin_layout", :except => [:login, :logout] When the second one is introduced it seems to cancel out the first request, any suggestions how to get around this? Scott -- Posted via http://www.ruby-forum.com/.
2007 Jan 25
4
How to change the menu depending on the controller/method?
Hello, I''m still dtarting with ruby on rails. And I''m trying to have a menu depending on the current controller/method. Here is what I was thinking of (please tell me if there''s a better way to do it): I have a database with menu_groups (corresponding to controllers) and menu_elements(corresponding to methods). Each menu_element belongs to one menu_group. I created a
2006 Mar 27
3
Specify a controller action via attribute in INPUT tag?
I have a pre-existing form with one existing "SUBMIT" tag generated by <%= submit_tag %> I would like to add another <INPUT type="submit" ...> to my form. How do I successfully associate that <INPUT> tag with a different controller action than the default one specified by my <%= start_form_tag %>? Or does this approach even make sense? In RoR, is
2009 Jun 07
6
Missing Template when testing with the Brain Buster Captcha partial
When I run my functional tests, they throw an error with the following message: ActionView::TemplateError: Missing template /_captcha.erb in view path app/views:test/vendor/plugins/brain_buster/views/brain_busters On line #23 of app/views/contacts/_form.html.erb 20: <%= f.label :message %><br /> 21: <%= f.text_area :message %> 22:
2006 Aug 01
8
Decoupled observers for controllers?
In the Rails Recipes book the recipe "Keeping track of who did what" explains how to do decoupled observing of models. In my application I''d like to do a similar thing but watching the controllers. For example, when somebody hits the login method of the Security controller, I''d like to make a note of it. In this case I could observe the User model and watch for
2006 May 23
3
image_tag problem
Hiall, I want to make an image_tag from within a controller in order to be able to present a link (with a status image) in a view. Here is my controller method (in file webca_controller.rb, hence WebcaController) def untouched_status_image_tag image_tag("open", { :alt => "Offen", :title => "Offen", :size => "12x12", :class =>
2006 Jan 12
4
If statement based on a action
Question for you all is it possible to use an action in an if statement? I am using the same form for edit and new and I have a cancel button on the page. This cancel button is built with an if statement that looks right now to see if a parameter exists to define where to go back to if the user cancel. The problem occurs when the user submits the form and there are missing fields by
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys, I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9. Sadly, rails 3 no longer has javascript generators and I''m now forced to do more javascript. For my project, I have selected jQuery as the javascript framework for my rails 3.0.9 app. What I have done to have my app''s deletion link (for each item) trigger an alert box when the deletion
2018 Nov 06
3
[PATCH v2 0/2] p2v: add Shutdown option
This small series for p2v refactors the Reboot menu of the conversion dialog into something slightly more general, and add the possibility to shut the machine down. Lots of work to deal with old GTK versions ... Changes from v1: - fix shutdown command Pino Toscano (2): p2v: turn Reboot button into a Shutdown popup menu button p2v: add a Shutdown action (RHBZ#1642044) p2v/gui.c |