similar to: Flash with dynamic data

Displaying 20 results from an estimated 20000 matches similar to: "Flash with dynamic data"

2006 Jul 28
1
How to ajax highlight a flash
Hi, I want to make a flash[] highlighted for let''s say 5 seconds when some action is invoked. In the controller, I have: flash[:notice] = "error" In the layout, I have: <p style="color: white"><%= flash[:notice] %></p> I don''t know how to use ajax with the flash. I tried something like: element.highlight(flash[:notice]) without any
2006 Mar 07
1
Access flash from a model class?
I have a method that returns either a comment stored in the flash (if it exists) or a new comment. It works when I put it in my application controller: def preform_comment if flash[:badcomment].nil? comment = Comment.new return comment else return flash[:badcomment] end end However it would be cleaner to put this in the Comment model, so I tried: def
2005 Aug 06
3
Macromedia Flash Loading Issues
I''ve discovered something very odd about the way Rails is handling Flash media. I am attempting to load a partial that contains the code for a flash adverstisment for the website. It was working ok when the code was in the page, but once I pulled it out to a partial (so I could use it on other pages) it stopped working. <%= render(:partial =>
2006 Aug 07
3
simple if - then question
hi, could somebody tell me the difference between: if not params[:id] flash[:notice] = blabla'' redirect_to(:controller =>"calendar", :action => ''index'') end and: if params[:id] == nil flash[:notice] = blabla'' redirect_to(:controller =>"calendar", :action => ''index'') end the first one
2006 Jul 07
3
dynamically updating a listbox from another listbox
Hi, I would like to be able to dynamically (without reloading the page) change the values from one listbox when a user select items from another listbox. I have a model ''Sector'' which has_many ''levels'' (and of cours, ''Level'' beyong_to ''sector''). I want to show the user two listboxes with the sectors and levels. But
2006 May 11
6
Dynamic data passing thru Rails to Flash
Hi, I am using Flash Dashboard and 3 sets of listbox. When i change my first list box say name i need to dynamically change the second list box and from the second list box when i choose an name i need to change the content according to this in the third list box. How can i pass this datas from database in rails. thanx g.balaji -- Posted via http://www.ruby-forum.com/.
2006 Jan 30
8
Translating a validtion flash
I''m a belgian Rails user (Dutch is my native language). I wondered if it is possible to translate error messages (generated by validators). I know how to create my own error messages: def method content rescue logger.error(...) flash[:notice] = ''My own error message" redirect_to(...) But where can I find the validator''s .rb files, so I can change them?
2006 May 22
15
collection_select default selected value
Hiall, Unfortunately I just can''t find out how to setup a default selected value when using collection_select. My call is like so: <%= collection_select(:consultant, :lastname, @consultants, :id, :lastname, { :selected => @current_consultant.id } ) %> which is not working, I debugged so far that I know that @current_consultant.id contains the correct value. Any tips? cheers
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there, I''ve been trying to paginate over a list of members that all share a tag in common using the acts_as_taggable plugin. The regular way of paginating over a collection doesn''t seem to work with acts_as_taggable. Here''s what my method looks like that takes in a tag name, finds all the members that share the tag and then displays all the members. Nothing too fancy
2006 Jul 12
1
Question re: Computing a field in a DB record
I''m just learning Rails and have encountered a problem trying to set a field in a DB record based on the value of another form input field. Using the scaffold code, the create works as expected and the update (edit) also works. However, one of the DB fields (amount) is supposed to be computer from another (units): if the category field is "Mileage", amount= units *
2006 May 26
5
scriptaculous - auto complete textbox with a drop down
Hi, I''m using scriptaculous to provide an auto complete textbox - and it works perfectly - but I was wondering if there was anyway to let users navigate the choices using the keyboard i.e the curor keys as opposed to having to use the mouse? Apart from that it''s perfect! :) Cheers, Pete -- Posted via http://www.ruby-forum.com/.
2005 Jan 20
1
Asterisk from flash with dynamic voicemail enable/disable?
I would like to create a rock solid asterisk server that comes up no matter what. Ofcourse I can consider hardware raid1 but.... for the cost of a hardware raid controller I can also buy a 2GB compact flash card that doesn't produce any heat or noise and is friendly to the electricity bill and our environment :) 2GB is more than sufficient for a linux distro and an * installation but
2006 Jun 18
3
on change of drop down a textfield emerging
hi, i have a situation where i have a list of options from which a user selects his options if its not in the list he/she selects Others/Not Present and a new textfield should pop up and the data entered there should be considered instead of dropdown. i have done this using javascript/dhtml but i was wondering how this can be done using pure rails i.e using some of the RoR apis?. i would
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs templates to no avail What I''m trying to do is fade an image, change the div with the image to a new image, and then fade the new image back in. How would I go about this in RJS Here''s a simple line from my rjs that I can''t get to work. It is not using callbacks so the
2006 Jun 19
1
How can I tell what fields have been updated?
I''ve scoured the Wiki and gone through the documentation with a fine toothed comb, but I can''t seem to find this answer. I want to keep a history of the changes made to a record, but can''t seem to find out what fields have changed. I''m sitting in the update function, as you can see below... I want to be able to get a list of what has changed so I can add
2006 Jun 04
5
Embedding link_to''s within text fetched from database.
Hi, I have the following problem that I can''t seem to figure out. I want to able to fetch some text from my database record in my controller, and then add two links within the text and then send that back to the view to get rendered so that the two links appear as links and when clicked on, they''d basically call the corresponding action for the link. Would anybody know how to
2006 Aug 01
3
Validation on ActiveRecord destruction
Rails has many built in validation methods to ensure that an ActiveRecord instance cannot be created or updated under certain situations (typically caused by invalid data). However, I can find no methods to govern whether an ActiveRecord instance can be destroyed. Essentially, I wish an error to be raised when a user tries to delete an ActiveRecord without first adhering to a certain set of
2006 May 24
3
using a helper from the console
I''ve got a couple of helper functions in my application_helper file that I would like to run from the console (for debugging). What is the correct way to invoke a helper from the console? _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
2006 Jul 14
5
Ideas for AJAX pagination
Hi, I am looking for ideas on how to remove the last item from a paginated page when a new item is inserted, thus leaving only 10 elements on the page. Currently I have a form that inserts with AJAX, but as expected, each post added to the page just increases the number of posts leaving 11 on a page that should only be displaying 10. I have unique ID''s for each post (e.g.
2006 Mar 09
4
Testing Migrations
Is there some standard way to test migrations? It seems to me that an additional safeguard for migrations would be to test and see if applying the migrations to the test database allows one to reconstruct the structure of the development database. If you can''t, then there is an error in your migrations, most likely because someone hand-modified the database without generating a