I've begun diving into Django again and I'm having trouble finding the parallel to some common concepts from my life in C#. While using .NET MVC I very often find myself creating a base controller which will provide a base action implementation to take care of the type of stuff I want to do on every request, like retrieving user informat...
Sorry if the title is not enough to understand what i am asking about.
I am rails developer and i used multiple lines of <% %> in my views but now i realized that it's not best practice so i came here and like to you all excellent guys what is the correct way in ROR?
For example if i required to something like following
<% user =User....
Hi I am little new to SharePoint. Here is my question
How can we make different views for administrator VS logged in user. For instance I need to display the
quicklaunch only to admin and not for user. And user should not see site actions tab.
How can we set this. Please can anyone come up with solution or any blog that we can refer?
...
I have seen the iPhone equivalent of this question here and I'm wondering...
is there an equivalent for bringSubviewToFront: for OS X development? I need something to send an NSImageView "to front".
...
Is there a standard way to check if a view layout exists from within a Controller in Rails? I'm trying to allow the user to determine the layout, but it needs to exist first.
...
Hi there,
I have a preferences activity where I can change the language and the theme of my application. From there I return to the previous activity via the Back key, and I want to recreate the activity.
I've managed to do that by reinitializing the layout in onResume and also calling onRestoreInstanceState from there. All the views ...
What I would like to do is use the Context module to insert $body_classes of my choosing based on a Taxonomy Term condition. Fine, that's what the Context module is for. Seems simple enough IF your content/page source is a node that is involved with the appropriate Terms. However, I have a page generated by Views that has the appropri...
Hi trying to make a Registration page with Ruby on rails using the tutorial found here
http://rails.francik.name/week4.html
having trouble getting the page to work after adding
<h1>Register</h1>
<enter code here%= error_messages_for :user %>
<% form_for :user do |f| %>
<p>
<%= f.label :screen_name %>:
<%= f.text_field :scree...
I am using the location module and views module for a postcode search, which works fine in a page display using views.
However I want the user to be able to enter their postcode into a block on the homepage and clicking submit my module sends them to the page created in views and the postcode is set as a session S_SESSION['postcode'] b...
Hi all,
I have a relatively simple problem. I have a model named Item which I've added a status field. The status field will only have two options (Lost or Found). So I created the following array in my Item model:
STATUS = [ [1, "Lost"], [2, "Found"]]
In my form view I added the following code which works great:
<%= collection_sele...
I've created a view that selects all nodes of type "shoot". But I want it to select all nodes of type "shoot", EXCEPT for the first entry. So, if the normal result is:
Node 1
Node 2
Node 3
I want
Node 2
Node 3
Node 4
Is that possible?
...
Hi all,
I'm looking to implement preview functionality in my posts scaffold. All I need to do is allow a user to enter information in the new view (/posts/new) and then replace the submit button with a preview button.
Once the preview button is clicked, the user is routed to the preview page (probably /posts/new/preview). If the user w...
Hay, I have come to a point where i need to pass certain variables to all my views (mostly custom authentication type variables).
I was told writing my own context processor was the best way to do this, but i am having some issues.
My settings file looks like this
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_proces...
Hi,
I'm struggling to read an int from the hidden field on aspx page.
<input type = "hidden" id = "myIntegerId" name = "integerId" value= "<%: Model.MyObjectId %>" runat = "server" />
The value is definately on the form, I can see it in the debugger and print it with <%: %>
When I read the form values in the controller, instead of ...
Hello,
How can i pass data from one partial view on another on the same page?
i want a situation where the second partial view will be refreshed once the first one sends data to it.
the partial views are on the same page.
thanks
...
I installed installed Events (calendar) module, and am able to add events and view events using event and event/list paths, however documentation talks about a default view being provided. I don't have this view and I searched through event module to find it (searched for "$view = new view" in install and elsewhere). Is this available in...
I find myself writing a lot of code in my views that looks like the code below. In this case, I want to add some explanatory HTML for a novice, and different HTML for an expert user.
<% if (ViewData["novice"] != null ) { %>
some extra HTML for a novice
<% } else { %>
some HTML for an expert
<% } %>
This is presentation logic, so it ...
For the title field,I want to return node.title,but what I tried is not working:
return array('og' => array('name' => 'og',
'join' => array('left' => array('table' => 'node',
'field' => 'nid'
),
'right' => array('field' => 'nid'
),
),...
Hi,
I'm trying to add a pre-filled 'add reply' form to a view of nodes. Reply is a content-type (reply) with certain fields that need to be prefilled based on what is in the view. This way a user can see only the selected fields from the node/add/reply.
At the moment I'm building the forms manually - copy the form from node/add, do som...
Hello,
I am facing a problem that occasionally comes up when you deal with not fully normalized table. Here is the problem. Imagine a table with 4 columns, and let's call this table dbo.Hierarchical. Here is the definition of the table:
if OBJECT_ID('dbo.Hierarchical') is not null
drop table dbo.Hierarchical
create table dbo.Hierarch...