Displaying 20 results from an estimated 2000 matches similar to: "Can't actualize variable session"
2005 Dec 15
6
Navigation menu
I have a navigation menu that contains a link per controller in my
application.
This menu is the same for all controllers, but I want this behaviour:
<a>Users</a>
<span>Statistics</span>
and
<span>Users</span>
<a>Statistics</a>
depending on the page you''re currently on.
I''ve put a <render :partial =>
2006 Jul 22
4
Accessing the controller name in your views?
I need to know what controller and action the user is currently in
to do various things in my layouts/application.rhtml file. Isn''t
there is a better way than:
<% if params[:controller] == "whatever" && params[:action] ==
"whatever" %>some html<% end %>
I know in the controllers you can just use controller_name, but that
is not provided
2007 Oct 23
9
Running rails specs outside of the normal project tree
I want to create a spec/regressions directory with various
regressions (for my rails project). I tried the following:
describe LoginController, "regression for user creation when
steves_sister does not exist", :behavior_type => :controller do
controller_name :login
before :each do
@params = {
"commit"=>"Create Account",
2006 Jan 23
5
Variable Scoping Problem
I am having some problems with variable scoping.
I need to be able to set a variable that is accessable by other methods
within the class (or instance) (i.e not global).
An example is 2 pages that change a class variable:
class AjtestController < ApplicationController
def initialize
@@variable = "init"
end
def show
@display = @@variable
@@variable = "change 1"
2006 Jun 01
9
access model from controller
Hello,
Rather new to RoR, so I''m not sure about the terminology and such :-/ .
My question is: how could I know the model which is associated to a
controller?
For example:
- controller class is TestController, which is a subclass of
ApplicationController
- associated model class is Test
How could I write some code in a method of ApplicationController to
dermine the current
2007 Jul 24
4
spec''ing helpers that use controller
Hi all,
I''m in the process of creating rspecs for my helpers. One of the
helpers in app/helpers/application_helper.rb looks like this:
def page_name
@page_name || "Define @page_name in
#{controller.controller_name}::#{controller.action_name}"
end
The rspec is simply:
it "should something" do
page_name
end
2007 Mar 19
3
controller_name with dynamic controllers
I''m writing a controller which should only be inherited from,
something like the generic crud controller seen here: http://
geekonomics.blogspot.com/2006/07/crud-and-shared-controllers.html
Now, in my spec, I would like to create a controller which inherits
from the generic CRUDController, without actually creating the
controller. This controller is *only* for testing.
How can I
2006 Apr 27
3
Routing problem
Hi,
I am having a routing problem and can''t figure out why its happing. I
have added the following line in my routing.rb file.
map.connect ''name/:id'', :controller => ''controller_name'', :action =>
''action_name''
When I use http://domain.com/controller_name/action_name/id then it
works fine on the local machine using webrick
2006 Feb 27
2
list of countries, states, cp, etc.
I''m doing a registration form.
I saw many registrations forms which asks you for a country and it lists
all the countries of the world, and when you select a country the form
is actualized with all the states or provinces, and when you select a
state/province then the form is actualized with all the cities.
I''m looking to do something like that, is there a free service or pay
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 Nov 28
8
view specs with partials
When I first learned about the View specs I was very excited. I
still am. However, I haven''t found them useful yet for one reason.
They throw the following exception when ever a view renders another
view, which is very common.
ActionView::TemplateError in ''Event View message''
No rhtml, rxml, rjs or delegate template found for spec/rails/
view_spec/_info
2006 Apr 11
4
wrong number of arguments (2 for 1)
Hi,
Im having trouble figuring out how to query my database in ruby and
i''m hoping someone can help me out.
I''d like to find all my departments that match a permalink passed from
the url. The department must also match a particular category, also
passed through the url.
I have written the following code. But unfortunatley I get an error
"wrong number of arguments (2 for
2012 Feb 11
3
Regain play analysis patches
Earl Chew wrote:
> That being said, I think my patch leaves us better off than before !
I agree. We will add it as it is and then tweak futher as needed.
Earl, would you be able to update your patch so that it applies
against the current git master?
Cheers,
Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2011 Feb 21
2
self.prepend_view_path - am I missing something
I have an app that varies its content based upon the domain from which
it is being accessed. Some of the domain characteristics are
supported in the model but it is easier varying static text in the
views and then sharing the form templates via partials etc.
Rails 2.3.10 and looking at the documentation at
2007 May 08
4
help with rspec''ing controller
Hi,
I''m a rspec newbie. I''m having trouble with rspec''ing a simple
controller to Create a record.
I''ve tried a couple of approaches and still get errors:
Mock ''remedy'' expected :save! with (any args) once, but received it 0
times
-or-
Mock ''Remedy'' received unexpected message :save with (no args).
Here are my two
2007 Apr 11
10
DRYer controller specs
So, I''ve been following the recommendations for controller specs here:
http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks
Most notably: a single expectation per specify block; the setup block
contains only stubs; mock expectations each get their own specify
block. (I''m still using 0.8, so I haven''t gotten the describe/it
goodness yet.)
I
2006 Jul 14
3
Accessing the Model class from Controller
Hi,
I wonder if there''s an easy way to access the associated Model class
from its Controller. Something that would allow me to write snippets
like the following:
class PeopleController < ApplicationController
def some_method
person_model_class =
self.some_method_to_retrieve_the_person_model_class()
end
end
Cheers,
Marco
--
Posted via
2006 Apr 25
16
case statements in views...strange error on OSX
I have a simple case statement in one of my views. This works fine on my
windows machine. Move to the mac and I get: "parse error, unexpected
tIDENTIFIER, expecting kWHEN".
I have not changed anything but cannot resolve the issue. my view has
this in it (simplified for test)
<% case controller.controller_name -%>
<% when "accounts" -%>
<h3>worked
2012 Feb 17
3
Regain play analysis patches
Earl Chew wrote:
> I'm a little reluctant to introduce another compiled program when there are
> so many other options that will work well enough out of the box.
>
> Here are two ideas:
>
> 1. Use bc(1) to compute the raw samples
> 2. Use perl(1) to compute the raw samples
>
> To generate raw unsigned samples using bc(1) for example:
>
> samplerate = 1000;