myexperiment-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Myexperiment-discuss] Get username & store endpoint


From: Jiten Bhagat
Subject: Re: [Myexperiment-discuss] Get username & store endpoint
Date: Thu, 06 Nov 2008 14:40:26 +0000
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Hi Tony,

Linde, A.E. wrote:
Many thanks, Jits: that worked.

Great :-)


One more question: in workflows/_table.rhtml, I want to refer to the username of the person logged in so as to construct the endpoint for storing their RDF claims: how might I do this?

You can use the current_user variable which is available in all views. If you're using it to get the username you will need to first check if the user is logged in. So, for example:

Name: <%= current_user.name if logged_in? -%>

(or using current_user.username in your case).


And, longer term, I’ll want to change the user database table to store this endpoint permanently. Any concerns about doing this? I can forsee all sorts of problems keeping two separate database structures up to date as I pull down later revisions of myExperiment. Has anyone lese done this do you know?

This could potentially pose some problems. You could write a db migrate script to add this field but then the numbering of these scripts could get messed up when you pull down later revisions (as you suggest). You could just do this and then manually renumber subsequent scripts, though ofcourse this isn't ideal. Alternatively you could modify the database directly, bypassing the db migrate scripts? I'll see if there are any other options you can take...

As an aside, in Rails 2.0 instead of numbering there is the option to use timestamping, which allows you to intersperse db migration scripts and rake db:migrate takes care of running any scripts that haven't been applied, and of course there wouldn't be any clashes in ordering.

Cheers,
Jits




On 06/11/2008 03:02, "Jiten Bhagat" <address@hidden> wrote:

    <%= render :partial => "skua/claim_form", :locals => {
    :local_data_passed_in => "my data", :more_local_data => "some more
    data"
    } %>



--
Tony Linde
Project Manager
Department of Physics & Astronomy
University of Leicester
------------------------------------------------------------------------

_______________________________________________
Myexperiment-discuss mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/myexperiment-discuss





reply via email to

[Prev in Thread] Current Thread [Next in Thread]