similar to: RJS - page object in helpers?

Displaying 20 results from an estimated 400 matches similar to: "RJS - page object in helpers?"

2009 Oct 07
2
Rails, flash, function and parameter
Hi, I try do update the flash on my page with ajax. I have this on my layout : <div id="flash_messages"> <%= render :partial => ''layouts/flash'' %> </div> I have this on my ApplicationHelper : def reload_flash page.replace "flash_messages", :partial => ''layouts/flash'' end and I try do that on my controller :
2006 Mar 01
5
rails models, logging and testing
Hello, I am using rails 1.0 and I have following questions. Please help me. [1] How can I do logging in the rails models? I checked the wiki but didn''t find anything which I explained how to do logging in models. [2] Say I have a certain model, when I declare a function in the model, and try to use that function from a view or a unit test, I get an error. For views the error occurs
2010 Aug 17
3
Rails 3 flash message problems
The following code in my application_helper.rb class either eats the flash message or escapes it and does not display properly: # Outputs the corresponding flash message if any are set def flash_messages messages = [] %w(notice warning error).each do |msg| messages << content_tag(:div, content_tag(:p, html_escape(flash[msg.to_sym])), :class => "message
2006 Feb 21
4
Models, Helpers, Modules, etc.
Hello, I am learning rails and ruby and I have some questions about how should I go about doing certain things. [1]Many of my models have some functionality which is common, and instead of duplicating it across models, I want to store it in a single file, and then import the file into the models. Should I do this using modules, and then store them in the `lib'' directory? What is the
2006 Apr 02
2
Problem with edge rails
Hello, When I am trying to run rake migration tasks, I get the error as shown below. I am using ruby 1.8.4 and edge rails. What am I missing or doing wrong? C:\rails\temp1>rake db:migrate (in C:/rails/temp1) rake aborted! no such file to load -- rails_version Thanks for your help. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read my blog at:
2006 Jun 19
2
Autocompleter enhancement feature request
Hello, I have created a ticket for an enhancement of the autocompleter to show the options immediately when the field gets focus. Right now at least one character must be typed for autocomplete to kick in. http://dev.rubyonrails.org/ticket/5435 I have also made some code changes directly in the script Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
2006 Feb 28
1
Cache Magic field for totaling
Hello, Rails provide counter cache field for associations, I want a similar cache for totaling up values (say account_balance = sum_of_deposits - sum_of_withdrawals). I was wondering if rails, already has another surprise in store for me, or is there any plug-in or how-to for doing these kind of things. Thanks. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read the
2006 Apr 03
5
rails migrations - enhanced usage
Hello, When I am writing rails migrations, quite often I make mistake in them which causes the migration tasks to stop halfway with error. This causes lots of problem, because it results in half of the things in migrations changed and other half not. Also, as the schema number is changed, so things cannot be rolled back. Is there any way to make the entire migration action atomic, i.e.,
2006 Feb 16
1
Pagination help/how to
Hello, I want to know how can I paginate a set of records. It seems there is no direct way of doing this, and I am not able to understand the documentation of paginate, so any pointers on how to do this will be much appreciated. To be specific what I want is that the records returned by user.recipes, the recipes of the particular user be paginated. My attempt to do this failed because
2006 Jul 20
1
Model CRUD via web services
Hello, I was wondering if there was any automated (may be scaffolding) way of exposing Model CRUD via web services. I found this ticket for django, but nothing for Rails. http://code.djangoproject.com/ticket/115 Thanks in advance for your opinions and suggestions. Regards. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read my blog at:
2006 May 04
1
Switching to production mode
Hello, I want to start my rails application in production mode. But for some reason in spite of uncommenting this line in ''config/environment.rb'' ENV[''RAILS_ENV''] ||= ''production'' when I run ''ruby script\console'' it says loading development mode. Also, the webrick sends log messages to development.log file instead of
2006 Jun 27
4
Action Mailer - weird rendering issues
Hello, While sending email notifications from ThoughtNotifier, I am getting weird exceptions, which sometimes occur on the production machine, but I haven''t been able to reproduce on my development machine. There should be no error while rendering `thought_notifier/share_notification.rhtml'' template, but if for some reason it is rendering
2006 Feb 04
2
rendering subtemplates
hi, i''ve got main site navigation in the application.rhtml file. the links in this template correspond to the ''index'' page of various controllers. The controllers themselves each have navigation of their own, which i would like to appear in every view for a particular controller in *addition* to the main site navigation. The problem I am encountering is that
2006 Mar 13
1
adding custom cache field
Hello, I needed to add custom cache field for one of my application. I thought I will share the code showing how to do this. This code below creates and maintain a custom cache field, for keeping track of totals. Say, you have accounts, and for each account there are transactions (either deposit/withdrawal), and one will like to keep track of the total balance for an account. So, let there be a
2006 Mar 21
8
How to avoid multiple submits/posts?
Hello, How do I prevent previously submitted form data from being reinserted into the database when the user presses the browser''s Refresh button? On Aughey''s advice in #irc I tried using `redirect_to'' a new `:action'' but this approach doesn''t seems to work. Any idea what might be wrong or how to tackle this problem? Thanks for your help. P.S.- I
2007 Sep 04
2
specing helpers fails on restful routes
Hi, I am trying to spec helper methods in a Rails project, but it seems the specs fail with the error: You might have expected an instance of Array. The error occurred while evaluating nil.<< if the restful routes helper are used either in spec files, or the helper file. What can I be doing wrong? Or how can I fix this. Thanks! -- Surendra Singhi http://ssinghi.kreeti.com,
2006 Mar 07
0
Extend user table/create new table, best practice?
Hello, I am new to arena of web development and am using the user engine. I want to store few more details about the user, so should I extend the user table provided by the user engine and add columns to it, or should I create a new table. I would like to know the best practice in this regard, and opinions of other web developers. Thanks. -- Surendra Singhi http://ssinghi.kreeti.com,
2006 Feb 17
0
Forum Engine
Hello, I am trying to develop an engine for RForum (http://rforum.andreas-s.net/trac/). I am very new to Ruby and Rails, so if you are also doing something similar, then let me know. I am willing to help and contribute. Thanks. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read the latest news at: http://news.kreeti.com
2006 May 03
7
anybody using GoDaddy for hosting ?
Is anybody hosting with GoDaddy.com? I''m about to set up a hosted account for my RoR app and see that they''re now offering RoR hosting. I''d really appreciate hearing from anybody who''s tried them for RoR. Any congrats / complaints / etc. you had / are having would be really appreciated! Thanks, Bill -------------- next part -------------- An HTML attachment
2006 Mar 13
3
"./blah/blah" vs. "/blah/blah"
Hello, Earlier in my rails application, I was using the convention of writing the following to refer to templates and/or views in the view folder. "./blah/blah" But in the Edge rail, it doesn''t work and the page doesn''t shows any output there is no error in the development log as well. But changing the above to "/blah/blah" seems to fix things. Was I