Displaying 20 results from an estimated 300 matches similar to: "multiple views, and some routers"
2007 Mar 14
11
path vs. url
When using named RESTful routes, when should one use the
generated ..._path helpers, and when the ..._url helpers? Say I did
this in routes.rb:
map.resources :users
Where should I use users_path, new_user_path, etc., and where should I
use users_url, new_user_url...?
Thanks!
Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to
2009 Jan 16
16
Testing arbitrary post action parameters
I am working on our (newly renamed) authentication feature. The current
scenario is:
Scenario: Non-administrators should not set administrator ability
Given I have no users
And I add a user named "admin" as an administrator
And I add a user named "myuser" as not an administrator
When the user named "myuser" authenticates
And the user
2009 Mar 11
3
[rspec, rails] Restful Routes in controller specs
Hi,
how is it possible that I can use the restful routes helpers (e.g.
new_user_path) in controller specs? I browsed the source code but I
couldn''t find the magic. I''m just curious and would appreciate any
hint...
thanks
Andi
2012 Sep 18
4
"best practices" for Rails serving RESTful JSON services for use by AngularJS, Ember.js, etc.
I''ve been writing a gem to implement and extend common controller
functionality so that Rails can be used with Javascript frameworks like
AngularJS (which we are using), Ember.js, etc. in such a way that the user
doesn''t have to tweak a a bunch of rails g controller boilerplate code to
provide services for use in these frameworks that in turn would require
various changes to
2008 Feb 01
4
Help with link_to_remote
Hi!.
Is there a way to call to another controller with link_to_remote?
Something like this:
<%= link_to_remote "Tests", {
:controller => "tests",
:action => "tester"
}
%>
Salu2...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2007 Apr 11
13
View Specs Fail with "protected method render"
I''ve got rspec and zentest installed as well as the rspec rails plugin, and
my model/controller specs all pass and work well. I can''t seem to get views
to work though - 100% of the specs fail with:
NoMethodError in ''/users/show.rhtml should render attributes in <p>''
protected method `render'' called for
2009 Dec 23
8
Where did this value in a form come from?
Newb here.
I have a form and a value that is being displayed ... and I have no idea
where the value came from.
I have done a
<%= debugger; '''' %>
in the form and, indeed, the debugger stops at the statement.
I have tried to trace through the code to see where the value came from
... and I gave up.
So ... what in Rails initializes the fields of a form?
--
Posted via
2008 Nov 26
1
Clearing form fields for a popup
I am using prototype to create modal popups for my login and register
pages, but the fields are populating with the data from certain
variables. For example, I have a show page that finds a user like
so:
@user = User.find(params[:id])
and my form uses:
<% form_for :user, :url => users_path do |f| -%>
so it is populating the form with the data from @user. Should I
rename the @user
2013 Apr 12
1
What is the meaning of the method to_param?
Hey!
Foe example i have next code:
test "should update user" do
put :update, id: @user.to_param, user: @input_attributes
assert_redirected_to users_path
end
What return id: @user.to_param?
--
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 unsubscribe from this group
2010 Dec 02
8
CanCan issue when being very specific
So I got CanCan and Devise working well. I have two types of users:
Admins and Nonadmins. Admins can edit all of Nonadmins profiles.
The problem is, every user (either Admin or Nonadmin) belongs to an
Account or Organization. Admins should only be able to edit users from
their own Account or Organization. I was able to do that too.
The problem is, I can''t display the Create New User
2012 Jun 09
7
ActiveRecord::AssociationTypeMismatch in UsersController#update
Hi
Im trying to link my User model to a Teams model. I seem to be getting
the following errors. Any help would be great as Im just new to RoR
Thanks
error
ActiveRecord::AssociationTypeMismatch in UsersController#update
Team(#2183395560) expected, got String(#2174675960)
app/controllers/users_controller.rb:67:in `update''
app/controllers/users_controller.rb:66:in `update''
2012 Sep 17
1
require current_password to update user information
Rails newbie here, I have been stuck on this for two days and can''t figure
out why its not working.
I want users to confirm/verify themselves by entering their current/old
password before any information is updated.
This is what My user_controller update action looks like
I''m currently using rails 3.2 with the basic has_secured_password
authentication that comes with it.
def
2010 Jun 23
0
Rails 3 - AJAX Response
Hi,
I need help with some AJAX in rails 3.
So basically, I have a select option in my index page for my User
model. This select option is a form that modifies the user''s type. The
" :remote => true " works and the type is changed when hit the submit
button. But, nothing happens in the browser. The user is updated.
I''m actually not sure where to put either my JS /
2008 Mar 24
2
link_to_remote and restful routes/urls
is there a way to access a restful resource with mike''s new
link_to_remote helper?
something like:
<%= link_to_remote h(user.name),
:update => "div_id",
:url => user_url(user) %>
of course, that doesn''t work.
i have also been trying things like:
:url => controller.asset_host +
2010 Jan 29
3
testing controllers using cucumber
Hello,
Is there any way to test controllers using cucumber.
I was doing it with rspec but since cucumber''s description is good how
can i proceed testing it with cucumber?
For e.g.
I have a scenario of user creation like
Feature: User Scenarios
Scenario: Successfull creation of user
Given a new user
When the user fill all the mandatory details
Then that user should get
2006 May 21
3
find with belongs_to -> belongs_to -> belongs_to
I have 3 tables
keywords (keywords attached to a file)
files (info about the file)
paths (path for the file)
[This is a legacy database, so I can''t change this]
keyword belongs_to file and file belongs_to path. Users need to be able
to search the keywords, but they only have access to certain volumes, so
the results need to be limited by the path. I also need to show paging,
2011 May 17
6
Nested Resource w/ Collection
Hi guys,
In my routes file I have the following nested resource:
resources :users do
collection do
get ''posts''
end
end
However, when I visit this URL: http://localhost:3000/users/posts, I get this error: "The action ''posts'' could not be found for UsersController"
In my UsersController I have the following:
class
2007 Oct 12
13
How to maintain Form State between Postback ?
Hi all,
I''ve trying to look for answers for my problem but so far couldn''t
find one, hopefully you can tell me what to do.
This problem is so ubiquitous to Web Development, pertaining the fact
that the web is stateless, i.e. how to maintain form''s state between
postback.
Basically, I have a form with some validations run for some of the
fields, whenever the user submit
2010 Jul 13
1
NoMethodError in UsersController#show
So I am getting the error
NoMethodError in UsersController#show error
undefined method `feed'' for nil:NilClass
{"authenticity_token"=>"zalkdfsjfksjd;lfs;lfksdkf/2tPzo=",
"login"=>"session",
"password"=>"admin",
"commit"=>"Log in"}
Why is login being set to "session"? Instead of the
2006 Aug 17
0
redirect_to POST?
Is it possible to automatically direct someone to a POST? Whenever a
user comes to my site, I''m automatically creating a user in the DB for
that person, however I''m also trying to stick to REST principles
otherwise. My idea was to have a before_filter :check_user that checked
to see whether this user existed or redirected to a POST users_url() to
automatically create the