Displaying 20 results from an estimated 1000 matches similar to: "rails rjs page object"
2008 Jan 21
7
undefined method error
Hello everyone,
I am following the Practical Rails: Social Networking
sites book. In chapter 7 photo gallery I am getting a
NoMethodError in Pages#show
Showing layouts/_menu.rhtml where line #12 raised:
undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c>
Extracted source (around line #12):
9: <% if is_logged_in? %>
10:
2007 Dec 10
10
Reading Hash/Array
Hi all,
My app is generating a form with several bill_items that should be
updated (fields to be updated are description and net).
The text_field_tag names are bill_item[update][#{id}][description] and
bill_item[update][#{id}][net] (and I added bill_item[update][#{id}]
[id] just in case)
The param received is:
{"commit"=>"Save",
2007 Dec 11
4
Lost in translation - Rails 2.0 Nested Resources, Custom Actions
The shift to the :has_many and :has_one options when defining nested
resource routes has me perplexed. The block format allows me to define
custom REST actions like publish in the example below:
map.resources :users do |user|
user.resources :articles, :member => { :publish => :put }
end
It also allows for multiple levels of nesting if necessary.
What I''d really like to
2006 Jun 30
6
using rjs
Hi
I am relatively new to ruby on rails. I want to use this javascript
bundle:
http://prototype-window.xilinus.com/index.html
How would I call those functions in an rjs file?
example:
win = new Window(''window_id'', {title: "Sample", top:100, left:350})
win.getContent().innerHTML = "<h1>Hello world !!</h1>";
win.setDestroyOnClose();
2006 Jun 27
4
RJS Form Values
Hi,
I have the following code :
<%=link_to_function("? | China", update_page{|page|
page[''tags_en''].value = "China"
page[''tags_ch''].value = "?" }) %>
This updates two text fields with the China and ?. However I want to
append the values, not replace them. So I need something like this :
2008 Jan 21
4
Caching CSS Issue
I have a problem I was hoping someone could shed some light on. I
noticed that with every request to my server, the css file was being
requested. I went ahead and made a static link to the css file so
there is no query string at all, but still I see the requests coming
in with each request. Do I need to do anything else (in the response
header maybe?) to make sure that browsers will cache the
2008 Jan 23
11
Rails 2.0.2 + RJS
Hi
I had ajax commenting on my app, which worked perfectly on Rails
v1.2.6, but does not work the same in Rails 2.02. Basically the
comment gets added, but the visual effects do not work (ie lines 2 + 3
of create.rjs)
create.js
page.insert_html :bottom, ''comments'', :partial => ''comment''
page.visual_effect :appear, "comment_#{@comment.id}"
2006 Jul 20
5
RJS where to put helper method?
Hi,
If I want to have helper method for my rjs, where''s the best place to put
it?
so for example:
--- bla.rjs:
page.replace_html ...
page.visual_effect ...
--- somewhere: (currently I put in application_helper.rb)
def replace_with_effect(page)
page.replace_html ...
page.visual_effect ...
end
--- bla.rjs:
replace_with_effect page
and is there a way to define the helper so we
2008 Feb 11
6
Should I Test My Fixtures?
I have a number of fixtures in my test suite. For example, with
acts_as_authenticated and acts_as_state_machine, I created a number of
users in different account states for use in functional testing.
(Suspended users can not log in, etc)
Is it a good idea to run fixtures through tests to ensure that they
conform to their ideals?
EG: assert users(:suspended_user).suspended?
If so, where should
2008 Mar 28
10
Inheriting from AdminController intstead from ApplicationController
Hi
I would like to do the following:
I have created an admin namespace and the required folders app/admin
views/admin etc. And then I wanted all controllers under app/admin to
inherit from a controller named AdminController which resists under
app/admin/admin.rb instead of inhereting from ApplicationController,
so I could better separate between admin and public section. The
AdminController
2007 Dec 17
2
undefined method `param_posted?'
I upgraded an app to 2.01 and can''t figure out why I am getting a
undefined method `param_posted?'' for #<ControlPanelController:
0xb748ba18>
The controller should be inheriting this.
class ControlPanelController < ApplicationController
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2007 Dec 13
10
Version naming to use in a RoR proyect
Hi everyone,
I would need to know if RoR follow any policy for version naming; I
mean, something like linux´s kernel does or similar.
For instance, kernel uses numbers separated in groups by dots (i.e.
pre 2.6 - AA.BB.CC). These groups mean differents fixtures, bugs
fixed...
I will start a big proyect from scratch with rails and I want to
choose now a standart to use and avoid future problems
2008 Jan 21
13
has_many with different primary key
I''ve got quite the ActiveRecord challenge, any help would be
appreciated.
In my current project Companies can have many reviews.
class Company < ActiveRecord::Base
has_many :reviews, :as => :reviewable
end
However, my company table, I have two different IDs to identify my
company.
id - This is the typical id we use for normal stuff
other_company_id - This is the id we use
2008 May 09
6
Operator Names.
What is this ''=>'' operator called?
Does it have a name?
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2007 Dec 16
2
restful_authentication: update of users' attributes on every page load upon 'Remember me' being enabled?
Hello there,
I just noticed a kinda weird thing: if users log in with the ''Remember
Me'' option enabled, their records in the db get updated everytime the
user reloads a page, because apparently restful_authentication''s code
updates the remember_token_expires_at & remember_token attributes for
each page load (not only once on the actual login (from cookie).
2008 Jan 08
3
What happened to _form.rhtml partial in rails 2.0??
Just wondering if anyone could point me to a good explanation of why
the latest way of doing things does not include using something like
_form.html.erb partials in RESTful rails 2.0?? Why did we move away
from partials, etc??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action,
for example an .rhtml and a .rjs file to handle the view for the same
action?
I suspect not, but this makes me wonder if there a way to call the .rjs
file from within the .rhtml so the statements within it get executed?
Thanks,
Andy
2007 Dec 23
11
return day from date (javascript) ?
Ok, I know this isn''t a Rails problem, but if you could help me out
that''d be brill.
I''ve used JavaScript to create a new Date object containing a date of my
choice...
mydate = new Date("11/24/2007");
//going with Javascript''s mm/dd/yyyy format
now this is good, what i want to do now is put in an integer variable
the number for the day, in this case
2006 May 17
4
.rjs templates undesiered output problem
Hello everyone, I am working with rjs templates in rails, and I''m amazed
of how simple it is to generate code with ajax, however I''am having some
troubles and I can''t seem to find a way to solve''em.
Whenever I put some code in the template, let''s say:
page.visual_effect :highlight, ''sitio37'', :duration => 3
I get the
2008 Nov 22
3
RJS page.update question
How does page.update actually work? I know its a wrapper for
Prototype.update but how does it get the partial in there?
Say I wanted to update a div with the contents of a partial manually
like this.
content = render(:partial => ''whatever'')
page.call "$(''my_div'').update(#{content})"
But his does not work. It keeps giving me weird errors about