similar to: path vs. url

Displaying 20 results from an estimated 6000 matches similar to: "path vs. url"

2008 Jan 17
4
multiple views, and some routers
Hi, I''m new to Rails (just a Java Programmer tired of having to configure a lot of xml''s and mapping classes just to make a simple page (...)) anyway, I''m experiencing some problems with routers, i''ve created a new project using Rails 2.0 and created a scaffold for users. so i have the following: users/new.html.erb ... (and the other pages created by the
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
2008 Mar 31
10
Problems with *_path() and *_url() helpers when using Publisher
Hello, I am running into issues using *_path() and *_url() helpers the Facebooker Publisher framework. I encounter the following error when using these helpers while *inside of a partial*: undefined method `default_url_options'' for ActionView::Base:Class I''ve seen a few other people speak about this issue, yet I haven''t seen any resolution on the mailing list yet.
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
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up!
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 Sep 03
5
Eager load associations in Oracle problem with more than 1000 records
I think Rails 2.1 introduced a bug when eager loading of associations with Oracle. In 2.1 ActiveRecord loads the included table with a big ''IN'' query: ''where association.id in (1, 2, 3, 4...)''. The problem is that Oracle has a hard limit of 1000 values in an IN clause. I get this error: ''OCIError: ORA-01795: maximum number of expressions in a list
2011 Feb 15
5
Path and Url
Hello everyone, what''s the real difference between root_url and root_path in Rails, for example. Apparently both lead to the same route in the application. Thanks! -- 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
2006 Sep 05
1
Named routes and current_page? incompatibility
Hi, I have some named routes defined e.g. map.public and wish to use link_to_unless_current() to disable link. However, as I''ve seen from forum discussions and the API doc, the issue lies with the fact that the named_route_url() method generated by a named route does not default to only_path = true like url_for. Therefore, the current_page? within link_to_unless_current() will not
2006 May 24
22
Components going out of style?
I see in the new Agile Rails 2nd edition that components are going out of style? Is this so? has anybody abandoned the idea of components for helpers? Specifically I''m considering a menu sytem for a website that depends heavily on the users permissions to decide which menu options a user would need to see. I thought that components, since they have the logic in the controller and
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
2006 Jul 30
8
Method_missing from Ruby for Rails book
I''m having a problem getting this example from the book to work: class Cookbook attr_accessor :title, :author def initialize @recipes = [] end def method_missing(m, *args, &block) @recipes.send(m, *args, &block) end end cb = Cookbook.new cb << recipe_for_cake cb << recipe_for_chicken beef_dishes = cb.find_all {|recipes| recipe.main_ingredient ==
2006 Jul 17
14
REST Relationship Models
I''m trying to figure out an elegant way to do this: I have the following three tables: people, employer, employees And consequently the following three models: class Person < ActiveRecord::Base end class Employer < ActiveRecord::Base has_many :employees end class Employee < ActiveRecord::Base belongs_to :person belongs_to :employer end I want to be able to say:
2006 Jul 12
6
So what is REST? I don''t get how it fits in Rails
Does someone have an actual example of this? I saw DHH''s slides where he said that you could have your app automatically respond with HTML, XML, atom, whatever. So far I''ve found tons of discussion on REST and CRUD in Rails, but I haven''t seen anything that actually shows me what it all is. There''s simply_restful, which apparently makes things easier...I
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''
2006 Jul 31
2
[UPDATE] More info on RubyConf 2006 registration
Hi -- Registration for RubyConf 2006 is still scheduled to open on August 2, in the early evening Pacific (US West Coast) time. Also, there''s more info at http://www.rubycentral.org/conference (e.g., the fact that this year we''re only taking credit cards, etc.). David P.S. Any LA area Rubyists around? I''ll be there this week doing Rails training. --