Displaying 20 results from an estimated 400 matches similar to: "Module loading"
2006 Aug 08
2
Extending rails with plugins
I''ve been looking at bottling some functionality up into a plugin, but I''m
having some problems including it.
The structure I have is:
/app/controllers/admin/base_controller.rb:
class Admin::BaseController > ApplicationController
#snip#
end
/vendor/plugins/myplugin/lib/my_module.rb:
module MyModule
def new_func
"New Function"
end
end
2011 Apr 21
1
Rails 3 Foreign Domain routing - cannot get this to work!
Hello,
I''m trying to build an app (mysuperapp.com) that allows users to create
an account in which a default subdomain (IE: joeshmoe.mysuperapp.com) will
be
created as their homepage. In their profile settings, I also want to give
them the ability to add their own domain name so their homepage now can be
joeshmoe.com. I know this is possible in rails w/ plugins like
subdomainfu
2005 Dec 29
8
First module gives "unknown action"
Hi, I''m using "Agile Web Dev. w/Rails", which is great but has a minimum
on grouping controllers into modules. I''ve successfully generated a
module scaffold, so I have:
app/controllers/admin_controller.rb
app/controllers/admin/things_controller.rb
(And the rest of the scaffold output, which seems normal.) However,
browsing to http://localhost:3000/admin/things/
2013 Mar 20
2
Rspec + Devise + BaseController
Hello there,
I''m creating a base controller for the admin section of a project. All
controllers whitin the admin section will inherit from it.
#####################################################
#app/controllers/admins/base_controller.rb
class Admins::BaseController < ApplicationController
layout "admin_cms"
before_filter :authenticate_admin!
end
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my
products_controller:
require File.dirname(__FILE__) + ''/../test_helper''
require ''products_controller''
# Re-raise errors caught by the controller.
class ProductsController
def rescue_action(e)
raise e
end
end
class ProductsControllerTest < Test::Unit::TestCase
fixtures
2011 Sep 21
5
problem with submit button in rails 3
hi,
i am using <%= s.submit ''Product save'' %>
when i click it, following error appears
" Routing Error
uninitialized constant ProductsController"
could any one provide me solution ?
thanks,
-pab
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send
2006 Mar 07
4
Controllers More Than One Sub-Directory Deep?
Does anyone know how to make Rails aware of controllers that might
exist in directories that exist deeper than one level under the
app/controllers directory? I initially figured just adding additional
scope information might do the trik (i.e. Tabs::Admin::OneController
or Admin::Tabs::OneController), but that does not seem to work.
I''m guessing that I can just manually add these
2009 Sep 29
0
Problem with RESTful resource and ActiveScaffold
Hello everyone,
I am trying to use a RESTful controller for user inside a namespace
using AS and one outside for registration and so on. When i try to
visit the namespaced url I get Unknown action. Once i replace
active_scaffold :users with a def index; end i can the URL.
My routes look like:
map.register "register", :controller => "users", :action =>
"create"
2011 Oct 24
1
JQuery autocomplete example
I was trying to follow along on the github example
(https://github.com/crowdint/rails3-jquery-autocomplete) for building
an autocomplete and ran into a small set of problems. I''m not using
the exact names of models, but I suppose I could. It''s just a dummy
set. For me: Model is Package and attribute is Brand.
I don''t understand what the reference to class
2007 Sep 20
1
undefined method `request' for "products":String ?
Since updated edge yesturday i have had a series of errors related to
undefinded methods for "products":String.
I do have these controllers namespaced.
====
Errors example 1:
undefined method `request'' for "products":String
Extracted source (around line #2):
view:
<tbody>
<%= render :partial => ''admin/products/product'',
2013 Oct 18
3
before_action - performing an action to prevent
class WebsocketController < WebsocketRails::BaseController
private
def authenticate?
unless current_user.token == message[:token]
current_redirect_to ''home/index''
false # that here we need to do to stop the further execution?
end
end
end
class WorldsController < WebsocketController
before_action :authenticate?
def index
2012 Mar 17
8
Agile web development with rails 4th edition adding sizes to the product
Hi I am going through the Agile web development with rails 4th edition
book and I am trying to modify the depot application to allow the
customer to select a size before purchasing a product. What and how
would I have to modify the depot app to do this?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2008 May 04
5
simple Routing Error
Routing Error
No route matches "/user/register" with {:method=>:get}
The URL is http://localhost:3000/user/register
Here is app/views/user/register.rhtml
<h2>Register</h2>
<% form_for :user do |form| %>
<fieldset>
<legend>Enter Your Details</legend>
<div class="form_row">
<label
2006 Mar 22
2
What is wrong in this method??????
Hi,
This is my definition of method "add_to_cart"
=======================
def add_to_cart
count=params[:product][:count]
while count.to_i>=0.to_i
if params[:product][''dem_quantity''+count.to_s]==""
else
@product =
Product.find(params[:product][''product_id''+count.to_s])
print @product.name
2008 Nov 11
1
Admin controller
This is very weird behavior for rails.
1. When I visit my app
http://localhost:3000/admin/base/login
class Admin::BaseController < ApplicationController
def login
render :text => "running"
end
end
2. but when I go here
http://localhost:3000/
I get error because login.html.erb not found
3. even though my route looks like this.
map.root :controller =>
2006 Jun 15
3
Need help creating a clever route
What I want to do is wrap all the scaffolded administrated pages for my
webapp into an admin folder in the controllers and views folders.
So...
/app
/controllers
/admin
issue_controller.rb
article_controller.rb
topic_controller.rb
... etc. ...
/views
/admin
/issue
_form.rhtml
edit.rhtml
list.rhtml
new.rhtml
2006 Apr 04
3
How to use in_place_editor_field ?
Hello, I really don''t understand how to use in_place_editor_field
In my controller :
class Admin::CategoriesController < Admin::BaseController
in_place_edit_for :category, :title
def list
@categories = Category.find_all
end
end
In the view list.rhtml
<% @categories.each do |c| %>
<td><%= in_place_editor_field :c, c.title %></td>
# snip
<%
2006 Mar 17
1
How to update values in database in this form?
Hi,
This is my rHtml page & Corresponding actions & model pages:-
===listform.rHtml=================
<h1>Products List</h1>
<%= start_form_tag(:action => "add_to_cart")%>
<table>
<tr>
<%
i=0
%>
<th>
Product No.
</th>
<th>
Unit Price
</th>
<th>
Available Qty.
</th>
<th>
Demand Qty.
</th>
2008 Aug 15
7
Autotest and subclasses / namespaces
I am writing a controller admin/cities_controller.rb
it inherits from AdminController, so it''s defined like
class Admin::CitiesController > AdminController
Whenever I save the controller file, autotest freaks out:
uninitialized constant Admin::AdminController (NameError)
I''m pretty used to just hitting CTRL-C to get autotest to re-load all
the files, or flicking to
2006 Jun 30
2
how to HABTM with STI ??
Hello all
This is my first post so excuse the basic question. (and any repeats I just
got an email saying this post was too big so I have re-submitted a smaller
version)
I was following the thread on
http://lists.rubyonrails.org/pipermail/rails/2006-May/038988.html regarding
the STI on HABTM for RoR.
I have a very similar problem and was hoping for some help.
I have the