[Rails] Re: Restrict application layout for certain views

2015-08-09 Thread Jason Walsh
Dave Aronson wrote in post #1176892: On Sat, Jul 25, 2015 at 3:44 PM, Jason Walsh li...@ruby-forum.com wrote: Is there any way to change / restrict the application layout for certain views? You can do that by specifying the layout in the controller. See: http://guides.rubyonrails.org

[Rails] Restrict application layout for certain views

2015-07-25 Thread Jason Walsh
Hi folks Is there any way to change / restrict the application layout for certain views? For example, I don't want to render the header for a certain view, is there any code such as: % if View != show.html.erb% %= render 'layouts/header' % % end % Thanks in advance Jason -- Posted via

[Rails] Re: Ajax test not working

2012-10-25 Thread Jason Walsh
AndreM wrote in post #1081168: Maybe try in controller: def getDiagram respond_to do |format| format.js end end Hi Andre Tried that - dont get error but renders a blank template. My main concern is why the event isnt firing and showing the alert. -- Posted via

[Rails] Re: Ajax test not working

2012-10-25 Thread Jason Walsh
Frederick Cheung wrote in post #1081170: On Wednesday, October 24, 2012 7:40:24 PM UTC+1, Ruby-Forum.com User wrote: alert(success); }; } This javascript is syntactically incorrect - you're not closing the parens you open just after bind Also if you want to render nothing

[Rails] Re: Ajax test not working

2012-10-25 Thread Jason Walsh
webber han wrote in post #1081214: Jason Walsh wrote in post #1080993: Am having real probs trying to use Ajax with my Rails app. I have set up a test as follows: in javascript file: window.onload = function() { $('#test').bind('ajax:success', function() { alert(success

[Rails] Ajax test not working

2012-10-24 Thread Jason Walsh
Am having real probs trying to use Ajax with my Rails app. I have set up a test as follows: in javascript file: window.onload = function() { $('#test').bind('ajax:success', function() { alert(success); }; } in view: %= link_to test, { :action = :getDiagram }, :remote = true,

[Rails] Construction methods

2012-09-01 Thread Jason Walsh
Hi Is there a method to create child objects after a parent object has been created? eg i have a process class, which when created should contain at least 1 digram class. I have looked at the initialize method but not sure when this is invoked ie when an object is created (ie saved to db) or

[Rails] Reference pointer or Boolean attribute

2012-08-22 Thread Jason Walsh
Hi Just interested in anybody's opinion on the following: I have one model class called Diagram, that contains a number of Node classes (ie 1-many relationship). One of the Node classes must be the start node. Which would be better: 1. Attribute in Diagram class called StartNode containing

[Rails] Re: Passing array of objects to javascript

2012-08-17 Thread Jason Walsh
Dave Aronson wrote in post #1072670: On Thu, Aug 16, 2012 at 6:23 AM, Jason Walsh li...@ruby-forum.com wrote: I am looking for the best way to get an array of objects from the database, pass them to the view in an instance variable, then make the array available to a javascript attached

[Rails] Passing array of objects to javascript

2012-08-16 Thread Jason Walsh
Hi I am looking for the best way to get an array of objects from the database, pass them to the view in an instance variable, then make the array available to a javascript attached to the view. Thanks Jason -- Posted via http://www.ruby-forum.com/. -- You received this message because you

[Rails] Re: Modeling one way associations

2012-06-13 Thread Jason Walsh
Michael Pavling wrote in post #1063859: On 9 June 2012 17:51, Colin Law clan...@googlemail.com wrote: @Michael, perhaps we should work in shifts. Colin :-D Thanks fellas - that did the trick :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Modeling one way associations

2012-06-09 Thread Jason Walsh
Hi I am working on a project where I have a Process object that references a Node object. I have tried adding a node_id column in the Process table and created an has_one relationship in the Process model. When trying Process.node.create(@attr) am getting an error as the sql is trying to update